summaryrefslogtreecommitdiff
path: root/src/modules/srfile/fileexistsdlg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/srfile/fileexistsdlg.cpp')
-rw-r--r--src/modules/srfile/fileexistsdlg.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/modules/srfile/fileexistsdlg.cpp b/src/modules/srfile/fileexistsdlg.cpp
index 4414e69c2a..d98ce59f78 100644
--- a/src/modules/srfile/fileexistsdlg.cpp
+++ b/src/modules/srfile/fileexistsdlg.cpp
@@ -54,7 +54,7 @@ static void DoAnnoyingShellCommand(HWND hwnd, const TCHAR *szFilename, int cmd,
IShellFolder *pDesktopFolder;
if (SHGetDesktopFolder(&pDesktopFolder) == NOERROR) {
ITEMIDLIST *pCurrentIdl;
- WCHAR* wszFilename = ( LPWSTR )szFilename;
+ WCHAR* wszFilename = (LPWSTR)szFilename;
if (pDesktopFolder->ParseDisplayName(NULL, NULL, wszFilename, NULL, &pCurrentIdl, NULL) == NOERROR) {
if (pCurrentIdl->mkid.cb) {
@@ -127,8 +127,8 @@ static LRESULT CALLBACK IconCtrlSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
case WM_RBUTTONUP:
{ POINT pt;
pt.x=(short)LOWORD(lParam); pt.y=(short)HIWORD(lParam);
- ClientToScreen( hwnd, &pt );
- DoAnnoyingShellCommand( hwnd, pft->tszCurrentFile, C_CONTEXTMENU, &pt );
+ ClientToScreen(hwnd, &pt);
+ DoAnnoyingShellCommand(hwnd, pft->tszCurrentFile, C_CONTEXTMENU, &pt);
return 0;
}
}
@@ -141,33 +141,33 @@ struct loadiconsstartinfo {
};
void __cdecl LoadIconsAndTypesThread(void* param)
{
- loadiconsstartinfo *info = ( loadiconsstartinfo* )param;
+ loadiconsstartinfo *info = (loadiconsstartinfo*)param;
SHFILEINFO fileInfo;
- if ( SHGetFileInfo( info->szFilename, 0, &fileInfo, sizeof(fileInfo), SHGFI_TYPENAME|SHGFI_ICON|SHGFI_LARGEICON)) {
+ if (SHGetFileInfo(info->szFilename, 0, &fileInfo, sizeof(fileInfo), SHGFI_TYPENAME|SHGFI_ICON|SHGFI_LARGEICON)) {
TCHAR *pszExtension, *pszFilename;
TCHAR szExtension[64];
TCHAR szIconFile[MAX_PATH];
pszFilename = _tcsrchr(info->szFilename, '\\');
- if ( pszFilename == NULL )
+ if (pszFilename == NULL)
pszFilename = info->szFilename;
- pszExtension = _tcsrchr( pszFilename, '.' );
- if ( pszExtension )
- lstrcpyn( szExtension, pszExtension+1, SIZEOF( szExtension ));
+ pszExtension = _tcsrchr(pszFilename, '.');
+ if (pszExtension)
+ lstrcpyn(szExtension, pszExtension+1, SIZEOF(szExtension));
else {
pszExtension = _T(".");
szExtension[0]='\0';
}
CharUpper(szExtension);
- if ( fileInfo.szTypeName[0] == '\0' )
- mir_sntprintf( fileInfo.szTypeName, SIZEOF(fileInfo.szTypeName), TranslateT("%s File"), szExtension);
+ if (fileInfo.szTypeName[0] == '\0')
+ mir_sntprintf(fileInfo.szTypeName, SIZEOF(fileInfo.szTypeName), TranslateT("%s File"), szExtension);
SetDlgItemText(info->hwndDlg, IDC_EXISTINGTYPE, fileInfo.szTypeName);
SetDlgItemText(info->hwndDlg, IDC_NEWTYPE, fileInfo.szTypeName);
SendDlgItemMessage(info->hwndDlg, IDC_EXISTINGICON, STM_SETICON, (WPARAM)fileInfo.hIcon, 0);
szIconFile[0]='\0';
- if ( !lstrcmp( szExtension, _T("EXE"))) {
+ if ( !lstrcmp(szExtension, _T("EXE"))) {
SRFile_GetRegValue(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons"), _T("2"), szIconFile, SIZEOF(szIconFile));
}
else {
@@ -175,22 +175,22 @@ void __cdecl LoadIconsAndTypesThread(void* param)
if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, pszExtension, NULL, szTypeName, SIZEOF(szTypeName))) {
lstrcat(szTypeName, _T("\\DefaultIcon"));
if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, szTypeName, NULL, szIconFile, SIZEOF(szIconFile))) {
- if ( _tcsstr( szIconFile, _T("%1")))
+ if (_tcsstr(szIconFile, _T("%1")))
SRFile_GetRegValue(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons"), _T("0"), szIconFile, SIZEOF(szIconFile));
else szIconFile[0]='\0';
} } }
- if ( szIconFile[0]) {
+ if (szIconFile[0]) {
int iconIndex;
HICON hIcon;
TCHAR *pszComma = _tcsrchr(szIconFile, ',');
- if ( pszComma == NULL )
+ if (pszComma == NULL)
iconIndex=0;
else {
iconIndex = _ttoi(pszComma+1); *pszComma='\0';
}
- hIcon = ExtractIcon( hMirandaInst, szIconFile, iconIndex );
- if ( hIcon )
+ hIcon = ExtractIcon(hMirandaInst, szIconFile, iconIndex);
+ if (hIcon)
fileInfo.hIcon = hIcon;
}
SendDlgItemMessage(info->hwndDlg, IDC_NEWICON, STM_SETICON, (WPARAM)fileInfo.hIcon, 0);
@@ -227,7 +227,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
pfnIconWindowProc=(WNDPROC)SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_EXISTINGICON), GWLP_WNDPROC, (LONG_PTR)IconCtrlSubclassProc);
hwndFocus=GetDlgItem(hwndDlg, IDC_RESUME);
- if ( _tstati64(fts->tszCurrentFile, &statbuf) == 0) {
+ if (_tstati64(fts->tszCurrentFile, &statbuf) == 0) {
SetControlToUnixTime(hwndDlg, IDC_EXISTINGDATE, statbuf.st_mtime);
GetSensiblyFormattedSize(statbuf.st_size, szSize, SIZEOF(szSize), 0, 1, NULL);
SetDlgItemText(hwndDlg, IDC_EXISTINGSIZE, szSize);
@@ -236,7 +236,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
hwndFocus=GetDlgItem(hwndDlg, IDC_OVERWRITE);
} }
- loadiconsstartinfo *lisi = ( loadiconsstartinfo* )mir_alloc(sizeof(loadiconsstartinfo));
+ loadiconsstartinfo *lisi = (loadiconsstartinfo*)mir_alloc(sizeof(loadiconsstartinfo));
lisi->hwndDlg=hwndDlg;
lisi->szFilename = mir_tstrdup(fts->tszCurrentFile);
//can be a little slow, so why not?
@@ -250,15 +250,15 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
PROTOFILERESUME pfr={0};
switch(LOWORD(wParam)) {
case IDC_OPENFILE:
- ShellExecute( hwndDlg, NULL, fts->tszCurrentFile, NULL, NULL, SW_SHOW );
+ ShellExecute(hwndDlg, NULL, fts->tszCurrentFile, NULL, NULL, SW_SHOW);
return FALSE;
case IDC_OPENFOLDER:
{
TCHAR szFile[MAX_PATH];
- lstrcpyn( szFile, fts->tszCurrentFile, SIZEOF(szFile));
- TCHAR* pszLastBackslash = _tcsrchr( szFile, '\\' );
- if ( pszLastBackslash )
+ lstrcpyn(szFile, fts->tszCurrentFile, SIZEOF(szFile));
+ TCHAR* pszLastBackslash = _tcsrchr(szFile, '\\');
+ if (pszLastBackslash)
*pszLastBackslash = '\0';
ShellExecute(hwndDlg, NULL, szFile, NULL, NULL, SW_SHOW);
return FALSE;
@@ -289,21 +289,21 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
TCHAR filter[512], *pfilter;
TCHAR str[MAX_PATH];
- lstrcpyn( str, fts->tszCurrentFile, SIZEOF(str));
+ lstrcpyn(str, fts->tszCurrentFile, SIZEOF(str));
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
- _tcscpy( filter, TranslateT("All Files"));
- _tcscat( filter, _T(" (*)"));
+ _tcscpy(filter, TranslateT("All Files"));
+ _tcscat(filter, _T(" (*)"));
pfilter = filter + _tcslen(filter) + 1;
- _tcscpy( pfilter, _T("*"));
+ _tcscpy(pfilter, _T("*"));
pfilter = pfilter + _tcslen(pfilter) + 1;
*pfilter='\0';
ofn.lpstrFilter = filter;
ofn.lpstrFile = str;
ofn.nMaxFile = SIZEOF(str);
ofn.nMaxFileTitle = MAX_PATH;
- if (!GetSaveFileName(&ofn))
+ if ( !GetSaveFileName(&ofn))
return FALSE;
pfr.szFilename = mir_tstrdup(str);