- Timestamp:
- Oct 21, 2000, 8:42:42 PM (25 years ago)
- Location:
- trunk/src/comdlg32
- Files:
-
- 6 added
- 1 deleted
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comdlg32/cdlg.h
r3572 r4511 1 /* $Id: cdlg.h,v 1. 6 2000-05-19 19:27:19 sandervl Exp $ */1 /* $Id: cdlg.h,v 1.7 2000-10-21 18:42:09 sandervl Exp $ */ 2 2 /* 3 3 * Common Dialog Boxes interface (32 bit) … … 21 21 extern HINSTANCE COMDLG32_hInstance; 22 22 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 23 27 void COMDLG32_SetCommDlgExtendedError(DWORD err); 24 28 LPVOID COMDLG32_AllocMem(int size); 29 30 #ifdef __cplusplus 31 } 32 #endif 25 33 26 34 … … 128 136 #define COMDLG32_SHGetFileInfoA SHGetFileInfoA 129 137 #define COMDLG32_SHFree SHFree 138 #define COMDLG32_SHAlloc SHAlloc 139 #define COMDLG32_SHGetDataFromIDListA SHGetDataFromIDListA 140 #define COMDLG32_SHGetFolderPathA SHGetFolderPathA 130 141 131 142 DWORD WINAPI PathRemoveFileSpecA(LPSTR fn); … … 134 145 /* PATH */ 135 146 #define COMDLG32_PathIsRootA PathIsRootA 136 #define COMDLG32_PathFindFile nameA PathFindFileNameA147 #define COMDLG32_PathFindFileNameA PathFindFileNameA 137 148 #define COMDLG32_PathRemoveFileSpecA PathRemoveFileSpecA 138 149 #define COMDLG32_PathMatchSpecW PathMatchSpecW 139 150 #define COMDLG32_PathAddBackslashA PathAddBackslashA 151 #define COMDLG32_PathCanonicalizeA PathCanonicalizeA 152 #define COMDLG32_PathGetDriveNumberA PathGetDriveNumberA 153 #define COMDLG32_PathIsRelativeA PathIsRelativeA 154 #define COMDLG32_PathFindNextComponentA PathFindNextComponentA 155 #define COMDLG32_PathAddBackslashW PathAddBackslashW 156 #define COMDLG32_PathFindExtensionA PathFindExtensionA 157 #define COMDLG32_PathAddExtensionA PathAddExtensionA 140 158 141 159 #else 142 extern HDPA (* WINAPI COMDLG32_DPA_Create) (INT);143 extern LPVOID (* WINAPI COMDLG32_DPA_GetPtr) (const HDPA, INT);144 extern LPVOID (* WINAPI COMDLG32_DPA_DeleteAllPtrs) (const HDPA hdpa);145 extern LPVOID (* WINAPI COMDLG32_DPA_DeletePtr) (const HDPA hdpa, INT i);146 extern INT (* WINAPI COMDLG32_DPA_InsertPtr) (const HDPA, INT, LPVOID);147 extern BOOL (* WINAPI COMDLG32_DPA_Destroy) (const HDPA);148 149 160 /* IMAGELIST */ 150 extern HICON (* WINAPI COMDLG32_ImageList_GetIcon) (HIMAGELIST, INT, UINT); 151 extern HIMAGELIST (* WINAPI COMDLG32_ImageList_LoadImageA) (HINSTANCE, LPCSTR, INT, INT, COLORREF, UINT, UINT); 152 extern BOOL (* WINAPI COMDLG32_ImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle); 153 extern BOOL (* WINAPI COMDLG32_ImageList_Destroy) (HIMAGELIST himl); 161 extern BOOL (WINAPI* COMDLG32_ImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle); 154 162 155 163 /* ITEMIDLIST */ 156 164 157 extern LPITEMIDLIST ( * WINAPICOMDLG32_PIDL_ILClone) (LPCITEMIDLIST);158 extern LPITEMIDLIST ( * WINAPICOMDLG32_PIDL_ILCombine)(LPCITEMIDLIST,LPCITEMIDLIST);159 extern LPITEMIDLIST ( * WINAPICOMDLG32_PIDL_ILGetNext)(LPITEMIDLIST);160 extern BOOL ( * WINAPICOMDLG32_PIDL_ILRemoveLastID)(LPCITEMIDLIST);161 extern BOOL ( * WINAPICOMDLG32_PIDL_ILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST);165 extern LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILClone) (LPCITEMIDLIST); 166 extern LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILCombine)(LPCITEMIDLIST,LPCITEMIDLIST); 167 extern LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILGetNext)(LPITEMIDLIST); 168 extern BOOL (WINAPI *COMDLG32_PIDL_ILRemoveLastID)(LPCITEMIDLIST); 169 extern BOOL (WINAPI *COMDLG32_PIDL_ILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST); 162 170 163 171 /* SHELL */ 164 extern BOOL (* WINAPI COMDLG32_SHGetPathFromIDListA) (LPCITEMIDLIST,LPSTR); 165 extern HRESULT (* WINAPI COMDLG32_SHGetSpecialFolderLocation)(HWND,INT,LPITEMIDLIST *); 166 extern DWORD (* WINAPI COMDLG32_SHGetDesktopFolder)(IShellFolder **); 167 extern DWORD (* WINAPI COMDLG32_SHGetFileInfoA)(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT); 168 extern DWORD (* WINAPI COMDLG32_SHFree)(LPVOID); 172 extern BOOL (WINAPI *COMDLG32_SHGetPathFromIDListA) (LPCITEMIDLIST,LPSTR); 173 extern HRESULT (WINAPI *COMDLG32_SHGetSpecialFolderLocation)(HWND,INT,LPITEMIDLIST *); 174 extern DWORD (WINAPI *COMDLG32_SHGetDesktopFolder)(IShellFolder **); 175 extern DWORD (WINAPI *COMDLG32_SHGetFileInfoA)(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT); 176 extern LPVOID (WINAPI *COMDLG32_SHAlloc)(DWORD); 177 extern DWORD (WINAPI *COMDLG32_SHFree)(LPVOID); 178 extern HRESULT (WINAPI *COMDLG32_SHGetDataFromIDListA)(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID dest, int len); 179 extern BOOL (WINAPI *COMDLG32_SHGetFolderPathA)(HWND,int,HANDLE,DWORD,LPSTR); 180 169 181 170 182 /* PATH */ 171 extern BOOL (* WINAPI COMDLG32_PathIsRootA)(LPCSTR x); 172 extern LPCSTR (* WINAPI COMDLG32_PathFindFilenameA)(LPCSTR path); 173 extern DWORD (* WINAPI COMDLG32_PathRemoveFileSpecA)(LPSTR fn); 174 extern BOOL (* WINAPI COMDLG32_PathMatchSpecW)(LPCWSTR x, LPCWSTR y); 175 extern LPSTR (* WINAPI COMDLG32_PathAddBackslashA)(LPSTR path); 183 extern BOOL (WINAPI *COMDLG32_PathIsRootA)(LPCSTR x); 184 extern LPSTR (WINAPI *COMDLG32_PathFindFileNameA)(LPCSTR path); 185 extern DWORD (WINAPI *COMDLG32_PathRemoveFileSpecA)(LPSTR fn); 186 extern BOOL (WINAPI *COMDLG32_PathMatchSpecW)(LPCWSTR x, LPCWSTR y); 187 extern LPSTR (WINAPI *COMDLG32_PathAddBackslashA)(LPSTR path); 188 extern BOOL (WINAPI *COMDLG32_PathCanonicalizeA)(LPSTR pszBuf, LPCSTR pszPath); 189 extern int (WINAPI *COMDLG32_PathGetDriveNumberA)(LPCSTR lpszPath); 190 extern BOOL (WINAPI *COMDLG32_PathIsRelativeA) (LPCSTR lpszPath); 191 extern LPSTR (WINAPI *COMDLG32_PathFindNextComponentA)(LPCSTR pszPath); 192 extern LPWSTR (WINAPI *COMDLG32_PathAddBackslashW)(LPWSTR lpszPath); 193 extern LPSTR (WINAPI *COMDLG32_PathFindExtensionA)(LPCVOID lpszPath); 194 extern BOOL (WINAPI *COMDLG32_PathAddExtensionA)(LPSTR pszPath,LPCSTR pszExtension); 176 195 #endif 177 196 -
trunk/src/comdlg32/cdlg_Ca.orc
r3031 r4511 123 123 124 124 125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 126 126 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 127 127 CAPTION "Color" -
trunk/src/comdlg32/cdlg_Cs.orc
r3031 r4511 106 106 107 107 108 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 200108 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 185 109 109 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 110 110 CAPTION "Barvy" -
trunk/src/comdlg32/cdlg_Da.orc
r3031 r4511 123 123 124 124 125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 126 126 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 127 127 CAPTION "Farve" -
trunk/src/comdlg32/cdlg_De.orc
r3031 r4511 123 123 124 124 125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 126 126 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 127 127 CAPTION "Farbe" -
trunk/src/comdlg32/cdlg_En.orc
r3243 r4511 1 /* $Id: cdlg_En.orc,v 1.2 2000-03-26 16:31:39 cbratschi Exp $ */2 1 LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT 3 4 /* Corel WINE 20000324 level */5 2 6 3 OPEN_FILE DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 275, 134 … … 111 108 COMBOBOX 1138,179,13,32,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | 112 109 WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE | CBS_SORT 113 DEFPUSHBUTTON "OK",IDOK,218,6,40,14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON 110 DEFPUSHBUTTON "OK",IDOK,218,6,40,14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON 114 111 PUSHBUTTON "Cancel",IDCANCEL,218,23,40,14,WS_GROUP | WS_TABSTOP 115 112 PUSHBUTTON "&Apply", 1026,218,40,40,14,WS_GROUP | WS_TABSTOP 116 113 PUSHBUTTON "&Help" , 1038,218,57,40,14,WS_GROUP | WS_TABSTOP 117 114 GROUPBOX "Effects",1072,6,72,84,34,WS_GROUP 118 CHECKBOX 119 CHECKBOX "&Underline", 1041, 10,94,50,10, BS_AUTOCHECKBOX115 CHECKBOX "Stri&keout", 1040, 10,82,50,10, BS_AUTOCHECKBOX | WS_TABSTOP 116 CHECKBOX "&Underline", 1041, 10,94,50,10, BS_AUTOCHECKBOX 120 117 LTEXT "&Color:", 1091 ,6,110,30,9 121 118 COMBOBOX 1139,6,120,84,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | 122 119 CBS_AUTOHSCROLL | WS_BORDER | WS_VSCROLL | WS_TABSTOP 123 120 GROUPBOX "Sample",1073,98,72,160,49,WS_GROUP 124 121 CTEXT "AaBbYyZz",1093,104,81,149,37,SS_NOPREFIX | WS_VISIBLE … … 126 123 127 124 128 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 129 126 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 130 127 CAPTION "Color" … … 173 170 CONTROL "&Down", 1057, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 138, 38, 30, 12 174 171 175 DEFPUSHBUTTON "&Find Next", IDOK, 182, 5, 50, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON 176 PUSHBUTTON "Cancel", IDCANCEL 177 PUSHBUTTON "&Help", pshHelp 172 DEFPUSHBUTTON "&Find Next", IDOK, 182, 5, 50, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON 173 PUSHBUTTON "Cancel", IDCANCEL , 182, 23, 50, 14, WS_GROUP | WS_TABSTOP 174 PUSHBUTTON "&Help", pshHelp , 182, 45, 50, 14, WS_GROUP | WS_TABSTOP 178 175 } 179 176 … … 191 188 CHECKBOX "Match &Case", 1041, 5, 62, 59, 12, BS_AUTOCHECKBOX | WS_TABSTOP 192 189 193 DEFPUSHBUTTON "&Find Next", IDOK, 174, 4, 50, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON 194 PUSHBUTTON "&Replace", psh1 190 DEFPUSHBUTTON "&Find Next", IDOK, 174, 4, 50, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON 191 PUSHBUTTON "&Replace", psh1 , 174, 21, 50, 14, WS_GROUP | WS_TABSTOP 195 192 PUSHBUTTON "Replace &All", psh2 , 174, 38, 50, 14, WS_GROUP | WS_TABSTOP 196 PUSHBUTTON "Cancel", IDCANCEL 197 PUSHBUTTON "&Help", pshHelp 193 PUSHBUTTON "Cancel", IDCANCEL , 174, 55, 50, 14, WS_GROUP | WS_TABSTOP 194 PUSHBUTTON "&Help", pshHelp , 174, 75, 50, 14, WS_GROUP | WS_TABSTOP 198 195 } 199 196 … … 202 199 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | 203 200 DS_CONTEXTHELP | DS_3DLOOK 204 CAPTION "Print 32"201 CAPTION "Print" 205 202 FONT 8, "Helv" 206 203 { … … 242 239 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | 243 240 DS_CONTEXTHELP | DS_3DLOOK 244 CAPTION "Print 32Setup"241 CAPTION "Print Setup" 245 242 FONT 8, "Helv" 246 243 BEGIN … … 267 264 LTEXT "&Source:", stc3, 16,128, 36, 8 268 265 COMBOBOX cmb3, 52,126, 112,112,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_GROUP | WS_TABSTOP 269 266 270 267 GROUPBOX "Orientation", grp1, 180, 92, 100,56, WS_GROUP 271 268 ICON "", ico1, 195,112, 18,20, WS_GROUP … … 275 272 276 273 277 NEWFILEOPENORD DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 28 0, 164274 NEWFILEOPENORD DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 287, 165 278 275 STYLE DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU 279 276 CAPTION "Open" 280 277 FONT 8, "helv" 281 278 { 282 LTEXT "Look &in",IDC_LOOKINSTATIC,7,6,41,8, SS_NOTIFY 283 COMBOBOX IDC_LOOKIN,50,3,138,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP 284 285 LTEXT "" , IDC_TOOLBARSTATIC, 188, 2, 82, 17, NOT WS_GROUP | NOT WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN 286 LISTBOX IDC_SHELLSTATIC,4,20,272,85, LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | WS_HSCROLL | NOT WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN 287 288 LTEXT "File &name:",IDC_FILENAMESTATIC,5,112,46,8, SS_NOTIFY 289 EDITTEXT IDC_FILENAME,54,110,155,12,ES_AUTOHSCROLL 290 291 LTEXT "Files of &type",IDC_FILETYPESTATIC,5,128,42,8, SS_NOTIFY 292 COMBOBOX IDC_FILETYPE,54,126,155,53,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP 293 294 CONTROL "Open as &read-only",IDC_OPENREADONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,54,145,100,10 295 296 DEFPUSHBUTTON "&Open", IDOK,222,110,50,14 297 PUSHBUTTON "Cancel", IDCANCEL,222,128,50,14 298 PUSHBUTTON "&Help", pshHelp,222,145,50,14 299 } 300 301 STRINGTABLE DISCARDABLE 302 { 279 LTEXT "Look &in",IDC_LOOKINSTATIC,4,6,43,8, SS_NOTIFY 280 COMBOBOX IDC_LOOKIN,49,3,132,100,CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP 281 282 LTEXT "" , IDC_TOOLBARSTATIC, 181, 2, 102, 17, NOT WS_GROUP | NOT WS_VISIBLE 283 LISTBOX IDC_SHELLSTATIC,4,20,272,85, LBS_SORT | LBS_NOINTEGRALHEIGHT | LBS_MULTICOLUMN | WS_HSCROLL | NOT WS_VISIBLE 284 285 LTEXT "File &name:",IDC_FILENAMESTATIC,5,112,46,8, SS_NOTIFY 286 EDITTEXT IDC_FILENAME,54,110,155,12,ES_AUTOHSCROLL 287 288 LTEXT "Files of &type",IDC_FILETYPESTATIC,5,128,42,8, SS_NOTIFY 289 COMBOBOX IDC_FILETYPE,54,126,155,53,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP 290 291 CONTROL "Open as &read-only",IDC_OPENREADONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,54,145,100,10 292 293 DEFPUSHBUTTON "&Open", IDOK,222,110,50,14 294 PUSHBUTTON "Cancel", IDCANCEL,222,128,50,14 295 PUSHBUTTON "&Help", pshHelp,222,145,50,14 296 } 297 298 STRINGTABLE DISCARDABLE 299 { 300 IDS_ABOUTBOX "&About FolderPicker Test" 301 IDS_DOCUMENTFOLDERS "Document Folders" 302 IDS_PERSONAL "My Documents" 303 IDS_FAVORITES "My Favorites" 304 IDS_PATH "System Path" 305 IDS_DESKTOP "Desktop" 306 IDS_FONTS "Fonts" 307 IDS_MYCOMPUTER "My Computer" 308 } 309 310 STRINGTABLE DISCARDABLE 311 { 312 IDS_SYSTEMFOLDERS "System Folders" 313 IDS_LOCALHARDRIVES "Local Hard Drives" 314 IDS_FILENOTFOUND "File not found" 303 315 IDS_VERIFYFILE "Please verify if the correct file name was given" 304 316 IDS_CREATEFILE "File does not exist\nDo you want to create file" 305 IDS_CREATEFOLDER_DENIED "Unable to create the folder \"%s\"\n\nAccess is denied." 306 IDS_FILEOPEN_CAPTION "Open" 307 IDS_FILENOTFOUND "File Not Found" 317 IDL_OVERWRITEFILE "File does already exist.\nDo you want to replace it?" 318 IDS_INVALID_FILENAME_TITLE "Invalid character(s) in path" 319 IDS_INVALID_FILENAME "A filename cannot contain any of the following characters: \n / : < > |" 320 IDS_PATHNOTEXISTING "Path does not exist" 321 IDS_FILENOTEXISTING "File does not exist" 308 322 } 309 323 … … 314 328 IDS_LISTVIEW "List" 315 329 IDS_REPORTVIEW "Details" 316 } 330 IDS_TODESKTOP "Browse to Desktop" 331 } 317 332 318 333 STRINGTABLE DISCARDABLE -
trunk/src/comdlg32/cdlg_Eo.orc
r3031 r4511 106 106 107 107 108 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 200108 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 185 109 109 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 110 110 CAPTION "Koloro" -
trunk/src/comdlg32/cdlg_Es.orc
r3031 r4511 123 123 124 124 125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 126 126 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 127 127 CAPTION "Color" -
trunk/src/comdlg32/cdlg_Fi.orc
r3031 r4511 123 123 124 124 125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 126 126 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 127 127 CAPTION "Väri" -
trunk/src/comdlg32/cdlg_Fr.orc
r3031 r4511 121 121 } 122 122 123 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200123 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 124 124 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 125 125 CAPTION "Couleurs" … … 143 143 CONTROL "" ,720,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP,4,14,140,86 144 144 CONTROL "" ,721,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP,4,116,140,28 145 CONTROL "" ,710,"STATIC",WS_BORDER|SS_SIMPLE|WS_TABSTOP|WS_GROUP, 152,4,118,116 CONTROL "" ,702,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP, 278,4,8,116145 CONTROL "" ,710,"STATIC",WS_BORDER|SS_SIMPLE|WS_TABSTOP|WS_GROUP, 152,4,118,116 146 146 CONTROL "" ,702,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP, 278,4,8,116 147 147 CONTROL "" ,709,"STATIC",SS_SIMPLE|WS_TABSTOP|WS_GROUP, 152,124,40,26 -
trunk/src/comdlg32/cdlg_Hu.orc
r3031 r4511 122 122 123 123 124 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200124 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 125 125 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 126 126 CAPTION "Szín" -
trunk/src/comdlg32/cdlg_It.orc
r3031 r4511 121 121 } 122 122 123 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200123 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 124 124 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 125 125 CAPTION "Colore" -
trunk/src/comdlg32/cdlg_Ko.orc
r3031 r4511 106 106 107 107 108 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200108 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 109 109 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 110 110 CAPTION "»ö" -
trunk/src/comdlg32/cdlg_Nl.orc
r3031 r4511 123 123 124 124 125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 126 126 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 127 127 CAPTION "Kleur" -
trunk/src/comdlg32/cdlg_No.orc
r3031 r4511 106 106 107 107 108 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 200108 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 264, 185 109 109 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 110 110 CAPTION "Farge" -
trunk/src/comdlg32/cdlg_Pl.orc
r3031 r4511 158 158 END 159 159 160 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200160 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 161 161 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 162 162 CAPTION "Color" -
trunk/src/comdlg32/cdlg_Pt.orc
r3031 r4511 123 123 124 124 125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 126 126 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 127 127 CAPTION "Cor" -
trunk/src/comdlg32/cdlg_Ru.orc
r3031 r4511 123 123 124 124 125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 126 126 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 127 127 CAPTION "Èçìåíåíèå ïàëèòðû" -
trunk/src/comdlg32/cdlg_Sv.orc
r3031 r4511 123 123 124 124 125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200125 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 126 126 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 127 127 CAPTION "Färg" -
trunk/src/comdlg32/cdlg_Wa.orc
r3031 r4511 128 128 129 129 130 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 200130 CHOOSE_COLOR DIALOG LOADONCALL MOVEABLE DISCARDABLE 36, 24, 300, 185 131 131 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 132 132 CAPTION "Coleurs" -
trunk/src/comdlg32/cdlg_xx.orc
r4049 r4511 1 /* $Id: cdlg_xx.orc,v 1.3 2000-08-19 18:36:16 sandervl Exp $*/2 1 /* 3 2 * Language neutral resources for Common Dialogs 4 *5 * Corel WINE 20000324 level6 3 */ 7 4 … … 11 8 12 9 1 VERSIONINFO 10 //ifdef __WIN32OS2__ 13 11 FILEVERSION 0x04, 0x00, 0x0565, 0x013F 14 12 PRODUCTVERSION 0x04, 0x00, 0x0565, 0x013F 13 //endif 15 14 FILEFLAGSMASK 0x3fL 16 15 FILEFLAGS 0xaL … … 46 45 PD32_COLLATE ICON DISCARDABLE LOADONCALL 47 46 { 48 '00 00 01 00 02 00 20 20 10 00 00 00 00 00 E8 02' 49 '00 00 26 00 00 00 4C 18 10 00 00 00 00 00 48 05' 50 '00 00 0E 03 00 00 28 00 00 00 20 00 00 00 40 00' 51 '00 00 01 00 04 00 00 00 00 00 80 02 00 00 00 00' 52 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 53 '00 00 00 00 80 00 00 80 00 00 00 80 80 00 80 00' 54 '00 00 80 00 80 00 80 80 00 00 C0 C0 C0 00 80 80' 55 '80 00 00 00 FF 00 00 FF 00 00 00 FF FF 00 FF 00' 56 '00 00 FF 00 FF 00 FF FF 00 00 FF FF FF 00 00 00' 57 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 58 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 59 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 60 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 61 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 62 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 63 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 64 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 65 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 66 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 67 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 68 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 69 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 70 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 71 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 72 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 73 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 74 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 75 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 76 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 77 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 78 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 79 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 80 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 81 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 82 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 83 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 84 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 85 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 86 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 87 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 88 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF' 89 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 90 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 91 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 92 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 93 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 94 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 95 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 96 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF 28 00' 47 '00 00 01 00 01 00 4C 18 10 00 00 00 00 00 48 05' 48 '00 00 16 00 00 00 28 00' 97 49 '00 00 4C 00 00 00 30 00 00 00 01 00 04 00 00 00' 98 50 '00 00 E0 04 00 00 00 00 00 00 00 00 00 00 00 00' … … 185 137 186 138 /* BINRES pd32_nocollate.ico */ 187 PD32_NOCOLLATE ICON 188 { 189 '00 00 01 00 02 00 20 20 10 00 00 00 00 00 E8 02' 190 '00 00 26 00 00 00 4C 18 10 00 00 00 00 00 48 05' 191 '00 00 0E 03 00 00 28 00 00 00 20 00 00 00 40 00' 192 '00 00 01 00 04 00 00 00 00 00 80 02 00 00 00 00' 193 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 194 '00 00 00 00 80 00 00 80 00 00 00 80 80 00 80 00' 195 '00 00 80 00 80 00 80 80 00 00 C0 C0 C0 00 80 80' 196 '80 00 00 00 FF 00 00 FF 00 00 00 FF FF 00 FF 00' 197 '00 00 FF 00 FF 00 FF FF 00 00 FF FF FF 00 00 00' 198 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 199 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 200 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 201 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 202 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 203 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 204 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 205 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 206 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 207 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 208 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 209 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 210 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 211 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 212 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 213 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 214 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 215 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 216 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 217 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 218 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 219 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 220 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 221 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 222 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 223 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 224 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 225 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 226 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 227 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 228 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 229 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF' 230 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 231 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 232 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 233 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 234 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 235 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 236 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF' 237 'FF FF FF FF FF FF FF FF FF FF FF FF FF FF 28 00' 139 PD32_NOCOLLATE ICON 140 { 141 '00 00 01 00 01 00 4C 18 10 00 00 00 00 00 48 05' 142 '00 00 16 00 00 00 28 00' 238 143 '00 00 4C 00 00 00 30 00 00 00 01 00 04 00 00 00' 239 144 '00 00 E0 04 00 00 00 00 00 00 00 00 00 00 00 00' … … 323 228 } 324 229 325 /****************** 326 * Bitmap 327 */ 328 329 IDB_TOOLBAR BITMAP DISCARDABLE 330 {' 331 42 4d 36 08 00 00 00 00 00 00 36 04 00 00 28 00 332 00 00 40 00 00 00 10 00 00 00 01 00 08 00 00 00 333 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00 00 334 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 80 335 00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80 336 00 00 c0 c0 c0 00 c0 dc c0 00 f0 ca a6 00 04 04 337 04 00 08 08 08 00 0c 0c 0c 00 11 11 11 00 16 16 338 16 00 1c 1c 1c 00 22 22 22 00 29 29 29 00 55 55 339 55 00 4d 4d 4d 00 42 42 42 00 39 39 39 00 80 7c 340 ff 00 50 50 ff 00 93 00 d6 00 ff ec cc 00 c6 d6 341 ef 00 d6 e7 e7 00 90 a9 ad 00 00 00 33 00 00 00 342 66 00 00 00 99 00 00 00 cc 00 00 33 00 00 00 33 343 33 00 00 33 66 00 00 33 99 00 00 33 cc 00 00 33 344 ff 00 00 66 00 00 00 66 33 00 00 66 66 00 00 66 345 99 00 00 66 cc 00 00 66 ff 00 00 99 00 00 00 99 346 33 00 00 99 66 00 00 99 99 00 00 99 cc 00 00 99 347 ff 00 00 cc 00 00 00 cc 33 00 00 cc 66 00 00 cc 348 99 00 00 cc cc 00 00 cc ff 00 00 ff 66 00 00 ff 349 99 00 00 ff cc 00 33 00 00 00 33 00 33 00 33 00 350 66 00 33 00 99 00 33 00 cc 00 33 00 ff 00 33 33 351 00 00 33 33 33 00 33 33 66 00 33 33 99 00 33 33 352 cc 00 33 33 ff 00 33 66 00 00 33 66 33 00 33 66 353 66 00 33 66 99 00 33 66 cc 00 33 66 ff 00 33 99 354 00 00 33 99 33 00 33 99 66 00 33 99 99 00 33 99 355 cc 00 33 99 ff 00 33 cc 00 00 33 cc 33 00 33 cc 356 66 00 33 cc 99 00 33 cc cc 00 33 cc ff 00 33 ff 357 33 00 33 ff 66 00 33 ff 99 00 33 ff cc 00 33 ff 358 ff 00 66 00 00 00 66 00 33 00 66 00 66 00 66 00 359 99 00 66 00 cc 00 66 00 ff 00 66 33 00 00 66 33 360 33 00 66 33 66 00 66 33 99 00 66 33 cc 00 66 33 361 ff 00 66 66 00 00 66 66 33 00 66 66 66 00 66 66 362 99 00 66 66 cc 00 66 99 00 00 66 99 33 00 66 99 363 66 00 66 99 99 00 66 99 cc 00 66 99 ff 00 66 cc 364 00 00 66 cc 33 00 66 cc 99 00 66 cc cc 00 66 cc 365 ff 00 66 ff 00 00 66 ff 33 00 66 ff 99 00 66 ff 366 cc 00 cc 00 ff 00 ff 00 cc 00 99 99 00 00 99 33 367 99 00 99 00 99 00 99 00 cc 00 99 00 00 00 99 33 368 33 00 99 00 66 00 99 33 cc 00 99 00 ff 00 99 66 369 00 00 99 66 33 00 99 33 66 00 99 66 99 00 99 66 370 cc 00 99 33 ff 00 99 99 33 00 99 99 66 00 99 99 371 99 00 99 99 cc 00 99 99 ff 00 99 cc 00 00 99 cc 372 33 00 66 cc 66 00 99 cc 99 00 99 cc cc 00 99 cc 373 ff 00 99 ff 00 00 99 ff 33 00 99 cc 66 00 99 ff 374 99 00 99 ff cc 00 99 ff ff 00 cc 00 00 00 99 00 375 33 00 cc 00 66 00 cc 00 99 00 cc 00 cc 00 99 33 376 00 00 cc 33 33 00 cc 33 66 00 cc 33 99 00 cc 33 377 cc 00 cc 33 ff 00 cc 66 00 00 cc 66 33 00 99 66 378 66 00 cc 66 99 00 cc 66 cc 00 99 66 ff 00 cc 99 379 00 00 cc 99 33 00 cc 99 66 00 cc 99 99 00 cc 99 380 cc 00 cc 99 ff 00 cc cc 00 00 cc cc 33 00 cc cc 381 66 00 cc cc 99 00 cc cc cc 00 cc cc ff 00 cc ff 382 00 00 cc ff 33 00 99 ff 66 00 cc ff 99 00 cc ff 383 cc 00 cc ff ff 00 cc 00 33 00 ff 00 66 00 ff 00 384 99 00 cc 33 00 00 ff 33 33 00 ff 33 66 00 ff 33 385 99 00 ff 33 cc 00 ff 33 ff 00 ff 66 00 00 ff 66 386 33 00 cc 66 66 00 ff 66 99 00 ff 66 cc 00 cc 66 387 ff 00 ff 99 00 00 ff 99 33 00 ff 99 66 00 ff 99 388 99 00 ff 99 cc 00 ff 99 ff 00 ff cc 00 00 ff cc 389 33 00 ff cc 66 00 ff cc 99 00 ff cc cc 00 ff cc 390 ff 00 ff ff 33 00 cc ff 66 00 ff ff 99 00 ff ff 391 cc 00 66 66 ff 00 66 ff 66 00 66 ff ff 00 ff 66 392 66 00 ff 66 ff 00 ff ff 66 00 21 00 a5 00 5f 5f 393 5f 00 77 77 77 00 86 86 86 00 96 96 96 00 cb cb 394 cb 00 b2 b2 b2 00 d7 d7 d7 00 dd dd dd 00 e3 e3 395 e3 00 ea ea ea 00 f1 f1 f1 00 f8 f8 f8 00 f0 fb 396 ff 00 a4 a0 a0 00 80 80 80 00 00 00 ff 00 00 ff 397 00 00 00 ff ff 00 ff 00 00 00 ff 00 ff 00 ff ff 398 00 00 ff ff ff 00 fa fa fa fa fa fa fa fa fa fa 399 fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 400 fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 401 fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 402 fa fa fa fa fa fa fa fa 92 92 92 92 92 92 92 92 403 92 92 92 92 92 fa fa fa 6d 6d 6d 6d 6d 6d 6d 6d 404 6d 6d 6d 6d 6d fa fa fa 00 00 00 fa fa fa fa fa 405 fa fa fa fa fa fa fa 00 00 fa fa fa fa fa fa fa 406 fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 00 407 00 00 00 00 92 fa fa 00 00 00 00 00 00 00 00 00 408 00 00 00 00 6d fa fa fa ff ff 00 fa 00 00 00 00 409 00 00 fa fa fa fa fa ff 00 fa 00 00 00 00 fa 00 410 00 fa 00 00 00 fa fa 00 ff dd dd dd dd d6 d6 d6 411 d6 d6 d6 00 92 fa fa 00 ff dd dd dd dd d6 d6 d6 412 d6 d6 d6 00 6d fa fa fa ff ff 00 fa 00 00 00 00 413 00 00 fa fa fa fa fa ff 00 fa fa fa fa fa fa fa 414 fa fa fa fa fa fa fa 00 ff dd dd dd dd dd dd d6 415 d6 d6 d6 00 92 fa fa 00 ff dd dd dd dd dd dd d6 416 d6 d6 d6 00 6d fa fa fa ff ff 00 fa fa fa fa fa 417 fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 418 fa fa fa fa fa fa fa 00 ff dd dd dd dd dd dd dd 419 d6 d6 d6 00 92 fa fa 00 ff dd dd dd dd dd dd dd 420 d6 d6 d6 00 6d fa fa fa fa fa fa fa fa fa fa fa 421 fa fa fa fa fa fa fa 00 00 fa fa fa fa fa fa fa 422 fa fa fa fa fa fa fa 00 ff dd dd dd dd 1f 1f 1f 423 d6 d6 d6 00 92 fa fa 00 ff dd dd dd dd dd dd dd 424 d6 fb d6 00 6d fa fa fa 00 00 00 fa fa fa fa fa 425 fa fa fa fa fa fa fa ff 00 fa 00 00 00 00 fa 00 426 00 fa 00 00 00 fa fa 00 ff dd dd dd dd dd dd dd 427 1f d6 d6 00 92 fa fa 00 ff dd dd dd dd dd dd dd 428 d6 fb d6 00 6d fa fa fa ff ff 00 fa 00 00 00 00 429 00 00 fa fa fa fa fa ff 00 fa fa fa fa fa fa fa 430 fa fa fa fa fa fa fa 00 ff dd dd dd dd dd dd dd 431 dd 1f d6 00 92 fa fa 00 ff dd dd dd dd dd fb dd 432 dd fb d6 92 fb fa fa fa ff ff 00 fa 00 00 00 00 433 00 00 fa fa fa fa fa fa fa fa fa fa fa fa fa fa 434 fa fa fa fa fa fa fa 00 ff ff ff ff ff ff ff ff 435 ff 1f c3 00 fa fa fa 00 ff ff ff ff ff ff ff fb 436 ff fb c3 fb fa fa fa fa ff ff 00 fa fa fa fa fa 437 fa fa fa fa fa fa fa 00 00 fa fa fa fa fa fa fa 438 fa fa fa fa fa fa fa 00 d6 d6 d6 d6 d6 d6 d6 00 439 00 1f 00 00 fa fa fa 00 d6 d6 d6 d6 d6 d6 d6 92 440 fb fb fb 92 92 fa fa fa fa fa fa fa fa fa fa fa 441 fa fa fa fa fa fa fa ff 00 fa 00 00 00 00 fa 00 442 00 fa 00 00 00 fa fa fa 00 d6 d6 d6 d6 d6 00 fa 443 fa 1f fa fa fa fa fa fa 00 d6 d6 d6 d6 fb fb fb 444 fb fb fb fb fb fb fa fa 00 00 00 fa fa fa fa fa 445 fa fa fa fa fa fa fa ff 00 fa fa fa fa fa fa fa 446 fa fa fa fa fa fa fa fa fa 00 00 00 00 00 fa fa 447 fa 1f fa fa fa fa fa fa fa 00 00 00 00 00 fa 92 448 fb fb fb 92 fa fa fa fa ff ff 00 fa 00 00 00 00 449 00 00 fa fa fa fa fa fa fa fa fa fa fa fa fa fa 450 fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 1f 451 1f 1f 1f 1f fa fa fa fa fa fa fa fa fa fa ff fb 452 fa fb fa fb 92 fa fa fa ff ff 00 fa 00 00 00 00 453 00 00 fa fa fa fa 92 92 92 92 92 92 92 92 92 92 454 92 92 92 92 92 92 fa fa fa fa fa fa fa fa fa fa 455 1f 1f 1f fa fa fa fa fa fa fa fa fa fa fa fb fa 456 fa fb fa fa fb fa fa fa ff ff 00 fa fa fa fa fa 457 fa fa fa fa fa fa 92 ff ff 92 ff ff ff ff 92 ff 458 ff 92 ff ff ff 92 fa fa fa fa fa fa fa fa fa fa 459 fa 1f fa fa fa fa fa fa fa fa fa fa fa fa fa fa 460 fa fb fa fa fa fa fa fa fa fa fa fa fa fa fa fa 461 fa fa fa fa fa fa 92 92 92 92 92 92 92 92 92 92 462 92 92 92 92 92 92 463 '} 464 230 /* BINRES pd32_portrait.ico */ 231 PD32_PORTRAIT ICON 232 { 233 '00 00 01 00 01 00 20 20 10 00 00 00 00 00 e8 02' 234 '00 00 16 00 00 00 28 00 00 00 20 00 00 00 40 00' 235 '00 00 01 00 04 00 00 00 00 00 80 02 00 00 00 00' 236 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 237 '00 00 00 00 80 00 00 80 00 00 00 80 80 00 80 00' 238 '00 00 80 00 80 00 80 80 00 00 c0 c0 c0 00 80 80' 239 '80 00 00 00 ff 00 00 ff 00 00 00 ff ff 00 ff 00' 240 '00 00 ff 00 ff 00 ff ff 00 00 ff ff ff 00 00 00' 241 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 242 'ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00' 243 'ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00' 244 'ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00' 245 'ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00' 246 'ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00' 247 'ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00' 248 'ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00' 249 'ff f0 00 00 ff ff ff 00 00 00 ff ff 00 00 00 00' 250 'ff ff 00 ff ff ff ff ff 00 0f ff ff 00 00 00 00' 251 'ff ff f0 ff ff ff ff ff 00 ff ff ff 00 00 00 00' 252 'ff ff f0 0f ff ff ff f0 00 ff ff ff 00 00 00 00' 253 'ff ff ff 0f ff ff ff f0 0f ff ff ff 00 00 00 00' 254 'ff ff ff 00 00 00 00 00 0f ff ff ff 00 00 00 00' 255 'ff ff ff f0 ff ff ff 00 ff ff ff ff 00 00 00 00' 256 'ff ff ff f0 0f ff f0 00 ff ff ff ff 00 00 00 00' 257 'ff ff ff ff 0f ff f0 0f ff ff ff ff 00 00 00 00' 258 'ff ff ff ff 00 ff 00 0f ff ff ff ff 00 00 00 00' 259 'ff ff ff ff f0 ff 00 ff ff ff ff ff 00 00 00 00' 260 'ff ff ff ff f0 00 00 ff ff ff ff ff 00 00 00 00' 261 'ff ff ff ff ff 00 0f ff ff ff ff ff 00 00 00 00' 262 'ff ff ff ff ff 00 0f ff ff ff ff ff 00 00 00 00' 263 'ff ff ff ff ff f0 ff ff ff ff ff ff 00 00 00 00' 264 'ff ff ff ff ff f0 ff ff ff ff ff ff 00 00 00 00' 265 'ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00' 266 'ff ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00' 267 'ff ff ff ff ff ff ff ff ff 0f ff f0 00 00 00 00' 268 'ff ff ff ff ff ff ff ff ff 0f ff 00 00 00 00 00' 269 'ff ff ff ff ff ff ff ff ff 0f f0 00 00 00 00 00' 270 'ff ff ff ff ff ff ff ff ff 0f 00 00 00 00 00 00' 271 'ff ff ff ff ff ff ff ff ff 00 00 00 00 00 00 00' 272 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0 00' 273 '00 07 e0 00 00 07 e0 00 00 07 e0 00 00 07 e0 00' 274 '00 07 e0 00 00 07 e0 00 00 07 e0 00 00 07 e0 00' 275 '00 07 e0 00 00 07 e0 00 00 07 e0 00 00 07 e0 00' 276 '00 07 e0 00 00 07 e0 00 00 07 e0 00 00 07 e0 00' 277 '00 07 e0 00 00 07 e0 00 00 07 e0 00 00 07 e0 00' 278 '00 07 e0 00 00 07 e0 00 00 07 e0 00 00 07 e0 00' 279 '00 07 e0 00 00 07 e0 00 00 0f e0 00 00 1f e0 00' 280 '00 3f e0 00 00 7f e0 00 00 ff e0 00 01 ff' 281 } 282 283 /* BINRES pd32_landscape.ico */ 284 PD32_LANDSCAPE ICON 285 { 286 '00 00 01 00 01 00 20 20 10 00 00 00 00 00 e8 02' 287 '00 00 16 00 00 00 28 00 00 00 20 00 00 00 40 00' 288 '00 00 01 00 04 00 00 00 00 00 80 02 00 00 00 00' 289 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 290 '00 00 00 00 80 00 00 80 00 00 00 80 80 00 80 00' 291 '00 00 80 00 80 00 80 80 00 00 c0 c0 c0 00 80 80' 292 '80 00 00 00 ff 00 00 ff 00 00 00 ff ff 00 ff 00' 293 '00 00 ff 00 ff 00 ff ff 00 00 ff ff ff 00 00 00' 294 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 295 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 296 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 297 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 0f ff' 298 'ff ff ff ff ff ff ff ff ff ff ff ff ff f0 0f ff' 299 'ff ff ff ff ff ff ff ff ff ff ff ff ff f0 0f ff' 300 'ff ff ff ff ff ff ff ff ff ff ff ff ff f0 0f ff' 301 'ff ff ff ff ff ff ff ff ff ff ff ff ff f0 0f ff' 302 'ff ff ff ff ff ff ff ff ff ff ff ff ff f0 0f ff' 303 'ff f0 00 00 ff ff ff 00 00 00 ff ff ff f0 0f ff' 304 'ff ff 00 ff ff ff ff ff 00 0f ff ff ff f0 0f ff' 305 'ff ff f0 ff ff ff ff ff 00 ff ff ff ff f0 0f ff' 306 'ff ff f0 0f ff ff ff f0 00 ff ff ff ff f0 0f ff' 307 'ff ff ff 0f ff ff ff f0 0f ff ff ff ff f0 0f ff' 308 'ff ff ff 00 00 00 00 00 0f ff ff ff ff f0 0f ff' 309 'ff ff ff f0 ff ff ff 00 ff ff ff ff ff f0 0f ff' 310 'ff ff ff f0 0f ff f0 00 ff ff ff ff ff f0 0f ff' 311 'ff ff ff ff 0f ff f0 0f ff ff ff ff ff f0 0f ff' 312 'ff ff ff ff 00 ff 00 0f ff ff ff ff ff f0 0f ff' 313 'ff ff ff ff f0 ff 00 ff ff ff ff ff ff f0 0f ff' 314 'ff ff ff ff f0 00 00 ff ff ff ff ff ff f0 0f ff' 315 'ff ff ff ff ff 00 0f ff ff ff ff ff ff f0 0f ff' 316 'ff ff ff ff ff 00 0f ff ff ff f0 00 00 00 0f ff' 317 'ff ff ff ff ff f0 ff ff ff ff f0 ff ff 00 0f ff' 318 'ff ff ff ff ff f0 ff ff ff ff f0 ff f0 00 0f ff' 319 'ff ff ff ff ff ff ff ff ff ff f0 ff 00 00 0f ff' 320 'ff ff ff ff ff ff ff ff ff ff f0 f0 00 00 0f ff' 321 'ff ff ff ff ff ff ff ff ff ff f0 00 00 00 00 00' 322 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 323 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 324 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 325 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff' 326 'ff ff ff ff ff ff ff ff ff ff 00 00 00 00 00 00' 327 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 328 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 329 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 330 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 331 '00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00' 332 '00 03 00 00 00 07 00 00 00 0f 00 00 00 1f 00 00' 333 '00 3f ff ff ff ff ff ff ff ff ff ff ff ff' 334 } 335 336 /* BINRES 800.bmp */ 337 800 BITMAP DISCARDABLE LOADONCALL 338 { 339 '42 4D 36 05 00 00 00 00 00 00 36 04 00 00 28 00' 340 '00 00 10 00 00 00 10 00 00 00 01 00 08 00 00 00' 341 '00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 01' 342 '00 00 00 01 00 00 00 00 00 00 00 00 80 00 00 80' 343 '00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80' 344 '00 00 C0 C0 C0 00 80 80 80 00 00 00 FF 00 00 FF' 345 '00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF' 346 '00 00 FF FF FF 00 00 00 00 00 00 00 00 00 00 00' 347 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 348 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 349 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 350 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 351 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 352 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 353 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 354 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 355 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 356 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 357 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 358 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 359 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 360 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 361 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 362 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 363 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 364 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 365 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 366 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 367 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 368 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 369 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 370 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 371 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 372 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 373 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 374 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 375 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 376 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 377 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 378 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 379 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 380 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 381 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 382 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 383 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 384 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 385 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 386 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 387 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 388 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 389 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 390 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 391 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 392 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 393 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 394 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 395 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 396 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 397 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 398 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 399 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 400 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 401 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 402 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 403 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 404 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 405 '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00' 406 '00 00 00 00 00 00 07 00 00 00 00 00 07 07 00 00' 407 '00 00 00 00 07 07 07 00 0B 0B 0B 00 07 07 00 0B' 408 '0B 03 03 00 07 07 07 00 0B 0B 0B 00 07 07 00 0B' 409 '0B 03 03 00 07 07 07 00 0B 0B 0B 00 07 07 00 0B' 410 '0B 03 03 00 07 07 07 00 0B 0B 0B 00 07 07 00 0B' 411 '0B 03 03 00 07 07 07 00 0B 0B 0B 00 00 00 00 0B' 412 '0B 03 03 00 07 07 07 00 0B 0B 0B 0B 0B 0B 0B 0B' 413 '0B 03 03 00 07 07 00 00 0B 0B 0B 0B 0B 0B 0B 0B' 414 '0B 03 03 00 00 07 00 0B 0B 0B 0B 0B 0B 0B 0B 0B' 415 '0B 03 03 03 00 07 07 00 0B 0B 0B 0B 0B 0B 0B 0B' 416 '0B 03 03 00 07 07 07 00 00 0B 0B 0B 0B 0B 0B 0B' 417 '03 03 00 07 07 07 07 00 07 00 0B 0B 0B 0B 0B 03' 418 '03 00 07 07 07 07 07 00 07 07 00 0B 0B 0B 03 03' 419 '00 07 07 07 07 07 07 00 07 07 07 00 00 00 00 00' 420 '07 07 07 07 07 07 07 07 07 07 07 07 00 00 00 07' 421 '07 07 07 07 07 07 07 07 07 07 07 07 07 07 07 07' 422 '07 07 07 07 07 07' 423 } -
trunk/src/comdlg32/comdlg32.cpp
r3223 r4511 1 /* $Id: comdlg32.cpp,v 1.2 5 2000-03-24 18:22:55 achimhaExp $ */1 /* $Id: comdlg32.cpp,v 1.26 2000-10-21 18:42:13 sandervl Exp $ */ 2 2 3 3 /* … … 26 26 ODINDEBUGCHANNEL(COMDLG32-COMDLG32) 27 27 28 // this controls whether we want to use the Open32 OS/2 file dialogs 29 // or our own Win95 like file dialogs 30 #define useWinFileDlg 1 31 32 #if 0 33 #define COMDLG32_CHECKHOOK(a,b,c) \ 34 if(a->Flags & b) \ 35 { \ 36 wndproc = CreateWindowProc((WNDPROC)a->lpfnHook);\ 37 if(wndproc == NULL) \ 38 return(FALSE); \ 39 \ 40 a->lpfnHook = (c)Win32WindowProc::GetOS2Callback();\ 41 } \ 42 a->hwndOwner = Win32ToOS2Handle(a->hwndOwner); 43 44 #define COMDLG32_CHECKHOOK2(a,b,c,d) \ 45 if(a->Flags & b) \ 46 { \ 47 wndproc = CreateWindowProc((WNDPROC)a->d);\ 48 if(wndproc == NULL) \ 49 return(FALSE); \ 50 \ 51 a->d = (c)Win32WindowProc::GetOS2Callback();\ 52 } \ 53 a->hwndOwner = Win32ToOS2Handle(a->hwndOwner); 54 #else 28 55 29 #define COMDLG32_CHECKHOOK(a,b,c) \ 56 30 if(a->Flags & b) \ … … 66 40 } \ 67 41 a->hwndOwner = Win32ToOS2Handle(a->hwndOwner); 68 #endif69 70 71 /*****************************************************************************72 * Name : iFileDlg_ScanFilterToken73 * Purpose : scan for valid / invalid filter tokens and74 * advance array pointer75 * Parameters:76 * Variables :77 * Result :78 * Remark :79 * Status :80 *81 * Author :82 *****************************************************************************/83 84 // scan filter tokens for validity85 static BOOL iFileDlg_ScanFilterToken( LPSTR *plpstrPair )86 {87 LPSTR lpstrTemp;88 LPSTR lpstrNext;89 BOOL fOK = TRUE;90 91 lpstrTemp = *plpstrPair;92 if (lpstrTemp[0] != 0)93 {94 // get filter description95 lpstrTemp = lpstrTemp + strlen(lpstrTemp);96 lpstrNext = lpstrTemp + 1;97 if (lpstrNext[0] == 0)98 fOK = FALSE;99 else100 {101 // get filter mask102 lpstrTemp = lpstrNext;103 lpstrTemp = lpstrTemp + strlen(lpstrTemp);104 lpstrTemp++;105 }106 107 if (fOK)108 *plpstrPair = lpstrTemp;109 }110 return fOK;111 }112 113 114 /*****************************************************************************115 * Name : iFileDlg_CleanFilterArray116 * Purpose : remove erroneous array entries at the end to prevent117 * Open32 complain about them but open the file dialog118 * instead.119 * Parameters:120 * Variables :121 * Result :122 * Remark :123 * Status :124 *125 * Author :126 *****************************************************************************/127 128 static DWORD iFileDlg_CleanFilterArray( LPSTR lpstrFilters)129 {130 DWORD dwCount = 0;131 LPSTR lpstrTemp;132 133 if (lpstrFilters && *lpstrFilters)134 {135 lpstrTemp = lpstrFilters;136 while (lpstrTemp[0] != 0)137 {138 // if an invalid filter token is found, such as found139 // in NT4's Regedit e. g., return number of proper140 // filter tokens.141 // Here however, as were calling Open32, we need142 // to correct the filter array.143 if (iFileDlg_ScanFilterToken(&lpstrTemp) == FALSE)144 {145 //@@@PH two alternative methods:146 // - copy array to new, corrected array while scanning tokens147 // - just overwrite bogus characters at the end of the array148 *lpstrTemp++ = 0; // try string termination149 *lpstrTemp = 0;150 return dwCount;151 }152 153 dwCount++;154 }155 }156 return dwCount;157 }158 159 42 160 43 /***************************************************************************** … … 173 56 LPOPENFILENAMEA, lpofn) 174 57 { 175 if(useWinFileDlg || (lpofn->Flags & (OFN_ENABLETEMPLATE|OFN_ENABLETEMPLATEHANDLE))) { 176 return GetFileDialog95A(lpofn, SAVE_DIALOG); 177 } 178 179 COMDLG32_CHECKHOOK(lpofn, OFN_ENABLEHOOK, WNDPROC) 180 181 //Note: fix IBM's proper error checking for NT's lazy check 182 if (lpofn->lpstrFilter != NULL) 183 iFileDlg_CleanFilterArray((LPSTR)lpofn->lpstrFilter); 184 185 return(O32_GetSaveFileName(lpofn)); 58 return GetFileDialog95A(lpofn, SAVE_DIALOG); 186 59 } 187 60 … … 202 75 LPOPENFILENAMEW, lpofn) 203 76 { 204 OPENFILENAMEA ofn; 205 char* szFile; 206 char* szFileTitle; 207 char* szCustFilter; 208 BOOL bResult; 209 210 if(useWinFileDlg || (lpofn->Flags & (OFN_ENABLETEMPLATE|OFN_ENABLETEMPLATEHANDLE))) { 211 return GetFileDialog95W(lpofn, SAVE_DIALOG); 212 } 213 214 memcpy(&ofn, // make binary copy first to save all the fields 215 lpofn, 216 sizeof(ofn)); 217 218 // convert to ASCII string 219 if ((lpofn->Flags && OFN_ENABLETEMPLATE) && 220 (lpofn->lpTemplateName != NULL)) 221 ofn.lpTemplateName = UnicodeToAsciiString((WCHAR*)lpofn->lpTemplateName); 222 else 223 ofn.lpTemplateName = NULL; 224 225 if (lpofn->lpstrFilter != NULL) 226 ofn.lpstrFilter = UnicodeToAsciiString((WCHAR*)lpofn->lpstrFilter); 227 228 if (lpofn->lpstrInitialDir != NULL) 229 ofn.lpstrInitialDir = UnicodeToAsciiString((WCHAR*)lpofn->lpstrInitialDir); 230 231 if (lpofn->lpstrTitle != NULL) 232 ofn.lpstrTitle = UnicodeToAsciiString((WCHAR*)lpofn->lpstrTitle); 233 234 if (lpofn->lpstrDefExt != NULL) 235 ofn.lpstrDefExt = UnicodeToAsciiString((WCHAR*)lpofn->lpstrDefExt); 236 237 szFile = (char*)malloc(lpofn->nMaxFile); 238 szFile[0] = 0; 239 240 if (*lpofn->lpstrFile != 0) 241 UnicodeToAscii(lpofn->lpstrFile, 242 szFile); 243 244 if (lpofn->lpstrFileTitle != NULL) 245 { 246 szFileTitle = (char*)malloc(lpofn->nMaxFileTitle); 247 szFileTitle[0] = 0; 248 249 if (*lpofn->lpstrFileTitle != 0) 250 UnicodeToAscii(lpofn->lpstrFileTitle, 251 szFileTitle); 252 } 253 else 254 szFileTitle = NULL; 255 256 if (lpofn->lpstrCustomFilter != NULL) 257 { 258 szCustFilter = (char*)malloc(lpofn->nMaxCustFilter); 259 szCustFilter[0] = 0; 260 261 262 if (*lpofn->lpstrCustomFilter != 0) 263 UnicodeToAscii(lpofn->lpstrCustomFilter, 264 szCustFilter); 265 } 266 else 267 szCustFilter = NULL; 268 269 ofn.lpstrFile = szFile; 270 ofn.lpstrFileTitle = szFileTitle; 271 ofn.lpstrCustomFilter = szCustFilter; 272 273 // call ascii variant of function 274 // @@@PH switch to ODIN_GetSaveFileNameA later 275 bResult = GetSaveFileNameA(&ofn); 276 277 if (ofn.lpTemplateName != NULL) FreeAsciiString((char*)ofn.lpTemplateName); 278 if (ofn.lpstrFilter != NULL) FreeAsciiString((char*)ofn.lpstrFilter); 279 if (ofn.lpstrInitialDir != NULL) FreeAsciiString((char*)ofn.lpstrInitialDir); 280 if (ofn.lpstrTitle != NULL) FreeAsciiString((char*)ofn.lpstrTitle); 281 if (ofn.lpstrDefExt != NULL) FreeAsciiString((char*)ofn.lpstrDefExt); 282 283 // transform back the result 284 AsciiToUnicode(ofn.lpstrFile, 285 lpofn->lpstrFile); 286 free(szFile); 287 288 if (lpofn->lpstrFileTitle != NULL) 289 { 290 AsciiToUnicode(ofn.lpstrFileTitle, 291 lpofn->lpstrFileTitle); 292 free(szFileTitle); 293 } 294 295 if (lpofn->lpstrCustomFilter != NULL) 296 { 297 AsciiToUnicode(ofn.lpstrCustomFilter, 298 lpofn->lpstrCustomFilter); 299 free(szCustFilter); 300 } 301 302 // copy over some altered flags 303 lpofn->nFilterIndex = ofn.nFilterIndex; 304 lpofn->Flags = ofn.Flags; 305 lpofn->nFileOffset = ofn.nFileOffset; 306 lpofn->nFileExtension = ofn.nFileExtension; 307 308 return bResult; 77 return GetFileDialog95W(lpofn, SAVE_DIALOG); 309 78 } 310 79 … … 324 93 LPOPENFILENAMEA, lpofn) 325 94 { 326 BOOL rc; 327 328 CheckCurFS(); 329 if(useWinFileDlg || (lpofn->Flags & (OFN_ENABLETEMPLATE|OFN_ENABLETEMPLATEHANDLE))) 330 { 331 return GetFileDialog95A(lpofn, OPEN_DIALOG); 332 } 333 COMDLG32_CHECKHOOK(lpofn, OFN_ENABLEHOOK, WNDPROC) 334 335 //Note: fix IBM's proper error checking for NT's lazy check 336 if (lpofn->lpstrFilter != NULL) 337 iFileDlg_CleanFilterArray((LPSTR)lpofn->lpstrFilter); 338 339 rc = O32_GetOpenFileName(lpofn); 340 CheckCurFS(); 341 return rc; 95 return GetFileDialog95A(lpofn, OPEN_DIALOG); 342 96 } 343 97 … … 357 111 LPOPENFILENAMEW, lpofn) 358 112 { 359 OPENFILENAMEA ofn; 360 char* szFile; 361 char* szFileTitle; 362 char* szCustFilter; 363 BOOL bResult; 364 365 if(useWinFileDlg || (lpofn->Flags & (OFN_ENABLETEMPLATE|OFN_ENABLETEMPLATEHANDLE))) { 366 return GetFileDialog95W(lpofn, OPEN_DIALOG); 367 } 368 369 memcpy(&ofn, // make binary copy first to save all the fields 370 lpofn, 371 sizeof(ofn)); 372 373 // convert to ASCII string 374 if ((lpofn->Flags && OFN_ENABLETEMPLATE) && 375 (lpofn->lpTemplateName != NULL)) 376 ofn.lpTemplateName = UnicodeToAsciiString((WCHAR*)lpofn->lpTemplateName); 377 else 378 ofn.lpTemplateName = NULL; 379 380 if (lpofn->lpstrFilter != NULL) 381 ofn.lpstrFilter = UnicodeToAsciiString((WCHAR*)lpofn->lpstrFilter); 382 383 if (lpofn->lpstrInitialDir != NULL) 384 ofn.lpstrInitialDir = UnicodeToAsciiString((WCHAR*)lpofn->lpstrInitialDir); 385 386 if (lpofn->lpstrTitle != NULL) 387 ofn.lpstrTitle = UnicodeToAsciiString((WCHAR*)lpofn->lpstrTitle); 388 389 if (lpofn->lpstrDefExt != NULL) 390 ofn.lpstrDefExt = UnicodeToAsciiString((WCHAR*)lpofn->lpstrDefExt); 391 392 szFile = (char*)malloc(lpofn->nMaxFile); 393 szFile[0] = 0; 394 395 if (*lpofn->lpstrFile != 0) 396 UnicodeToAscii(lpofn->lpstrFile, 397 szFile); 398 399 if (lpofn->lpstrFileTitle != NULL) 400 { 401 szFileTitle = (char*)malloc(lpofn->nMaxFileTitle); 402 szFileTitle[0] = 0; 403 404 if (*lpofn->lpstrFileTitle != 0) 405 UnicodeToAscii(lpofn->lpstrFileTitle, 406 szFileTitle); 407 } 408 else 409 szFileTitle = NULL; 410 411 if (lpofn->lpstrCustomFilter != NULL) 412 { 413 szCustFilter = (char*)malloc(lpofn->nMaxCustFilter); 414 szCustFilter[0] = 0; 415 416 417 if (*lpofn->lpstrCustomFilter != 0) 418 UnicodeToAscii(lpofn->lpstrCustomFilter, 419 szCustFilter); 420 } 421 else 422 szCustFilter = NULL; 423 424 ofn.lpstrFile = szFile; 425 ofn.lpstrFileTitle = szFileTitle; 426 ofn.lpstrCustomFilter = szCustFilter; 427 428 // call ascii variant of function 429 // @@@PH switch to ODIN_GetOpenFileNameA later 430 bResult = GetOpenFileNameA(&ofn); 431 432 if (ofn.lpTemplateName != NULL) FreeAsciiString((char*)ofn.lpTemplateName); 433 if (ofn.lpstrFilter != NULL) FreeAsciiString((char*)ofn.lpstrFilter); 434 if (ofn.lpstrInitialDir != NULL) FreeAsciiString((char*)ofn.lpstrInitialDir); 435 if (ofn.lpstrTitle != NULL) FreeAsciiString((char*)ofn.lpstrTitle); 436 if (ofn.lpstrDefExt != NULL) FreeAsciiString((char*)ofn.lpstrDefExt); 437 438 // transform back the result 439 AsciiToUnicode(ofn.lpstrFile, 440 lpofn->lpstrFile); 441 free(szFile); 442 443 if (lpofn->lpstrFileTitle != NULL) 444 { 445 AsciiToUnicode(ofn.lpstrFileTitle, 446 lpofn->lpstrFileTitle); 447 free(szFileTitle); 448 } 449 450 if (lpofn->lpstrCustomFilter != NULL) 451 { 452 AsciiToUnicode(ofn.lpstrCustomFilter, 453 lpofn->lpstrCustomFilter); 454 free(szCustFilter); 455 } 456 457 // copy over some altered flags 458 lpofn->nFilterIndex = ofn.nFilterIndex; 459 lpofn->Flags = ofn.Flags; 460 lpofn->nFileOffset = ofn.nFileOffset; 461 lpofn->nFileExtension = ofn.nFileExtension; 462 463 return bResult; 464 } 465 113 return GetFileDialog95W(lpofn, OPEN_DIALOG); 114 } 115 116 #if 0 466 117 /***************************************************************************** 467 118 * Name : … … 679 330 return O32_CommDlgExtendedError(); 680 331 } 681 682 332 683 333 /***************************************************************************** … … 806 456 return iResult; 807 457 } 458 #endif 808 459 809 460 /***************************************************************************** … … 887 538 888 539 540 #if 0 889 541 /***************************************************************************** 890 542 * Name : … … 979 631 return bResult; 980 632 } 981 633 #endif 982 634 983 635 /***************************************************************************** -
trunk/src/comdlg32/comdlg32.def
r2223 r4511 1 ; $Id: comdlg32.def,v 1. 5 1999-12-28 10:30:59sandervl Exp $1 ; $Id: comdlg32.def,v 1.6 2000-10-21 18:42:13 sandervl Exp $ 2 2 3 3 ; … … 12 12 ChooseFontA = _ChooseFontA@4 @103 13 13 ChooseFontW = _ChooseFontW@4 @104 14 CommDlgExtendedError = _CommDlgExtendedError 32@0@10514 CommDlgExtendedError = _CommDlgExtendedError@0 @105 15 15 FindTextA = _FindTextA@4 @106 16 16 FindTextW = _FindTextW@4 @107 17 GetFileTitleA = _GetFileTitleA 32@12@10818 GetFileTitleW = _GetFileTitleW 32@12@10917 GetFileTitleA = _GetFileTitleA@12 @108 18 GetFileTitleW = _GetFileTitleW@12 @109 19 19 GetOpenFileNameA = _GetOpenFileNameA@4 @110 20 20 GetOpenFileNameW = _GetOpenFileNameW@4 @111 -
trunk/src/comdlg32/filedlg95.c
r4089 r4511 1 /* $Id: filedlg95.c,v 1.14 2000-08-24 12:02:23 sandervl Exp $*/2 1 /* 3 2 * COMMDLG - File Open Dialogs Win95 look and feel 4 3 * 5 * Copyright 2000 Christoph Bratschi (cbratschi@datacomm.ch) 6 * Project Odin Software License can be found in LICENSE.TXT 7 * 8 * Corel WINE 20000324 level 4 * FIXME: lpstrCustomFilter not handled 5 * 6 * FIXME: if the size of lpstrFile (nMaxFile) is to small the first 7 * two bytes of lpstrFile should contain the needed size 8 * 9 * FIXME: algorithm for selecting the initial directory is too simple 10 * 11 * FIXME: add to recent docs 12 * 13 * FIXME: flags not implemented: OFN_CREATEPROMPT, OFN_DONTADDTORECENT, 14 * OFN_ENABLEINCLUDENOTIFY, OFN_ENABLESIZING, OFN_EXTENSIONDIFFERENT, 15 * OFN_NOCHANGEDIR, OFN_NODEREFERENCELINKS, OFN_READONLYRETURN, 16 * OFN_NOTESTFILECREATE, OFN_OVERWRITEPROMPT, OFN_USEMONIKERS 17 * 18 * FIXME: lCustData for lpfnHook (WM_INITDIALOG) 19 * 20 * 9 21 */ 10 22 #ifdef __WIN32OS2__ … … 24 36 #include <ctype.h> 25 37 #include <stdlib.h> 38 #include <stdio.h> 26 39 #include <string.h> 40 27 41 #include "winbase.h" 42 #include "ntddk.h" 43 #include "wine/winestring.h" 28 44 #include "ldt.h" 29 45 #include "heap.h" … … 33 49 #include "debugtools.h" 34 50 #include "cderr.h" 51 #include "tweak.h" 35 52 #include "winnls.h" 36 53 #include "shellapi.h" 37 #include " tchar.h"54 #include "shlguid.h" 38 55 #include "filedlgbrowser.h" 56 #include "shlwapi.h" 39 57 #include "wine/obj_contextmenu.h" 40 58 41 DEFAULT_DEBUG_CHANNEL(commdlg) 59 DEFAULT_DEBUG_CHANNEL(commdlg); 42 60 43 61 /*********************************************************************** … … 46 64 typedef struct SFolder 47 65 { 48 int m_iImageIndex; /* Index of picture in image list */ 49 HIMAGELIST hImgList; 50 int m_iIndent; /* Indentation index */ 51 LPITEMIDLIST pidlItem; /* absolute pidl of the item */ 52 CHAR* szDisplayName; 53 INT iIcon; 54 INT iSelIcon; 55 HIMAGELIST ilItemImage; 66 int m_iImageIndex; /* Index of picture in image list */ 67 HIMAGELIST hImgList; 68 int m_iIndent; /* Indentation index */ 69 LPITEMIDLIST pidlItem; /* absolute pidl of the item */ 56 70 57 71 } SFOLDER,*LPSFOLDER; … … 139 153 static void FILEDLG95_Clean(HWND hwnd); 140 154 141 /* Functions used by the shell object*/155 /* Functions used by the shell navigation */ 142 156 static LRESULT FILEDLG95_SHELL_Init(HWND hwnd); 143 157 static BOOL FILEDLG95_SHELL_UpFolder(HWND hwnd); 144 158 static BOOL FILEDLG95_SHELL_ExecuteCommand(HWND hwnd, LPCSTR lpVerb); 145 static BOOL FILEDLG95_SHELL_NewFolder(HWND hwnd);146 159 static void FILEDLG95_SHELL_Clean(HWND hwnd); 160 static BOOL FILEDLG95_SHELL_BrowseToDesktop(HWND hwnd); 147 161 148 162 /* Functions used by the filetype combo box */ 149 163 static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd); 150 164 static BOOL FILEDLG95_FILETYPE_OnCommand(HWND hwnd, WORD wNotifyCode); 151 static int FILEDLG95_FILETYPE_SearchExt(HWND hwnd,LP STR lpstrExt);165 static int FILEDLG95_FILETYPE_SearchExt(HWND hwnd,LPCSTR lpstrExt); 152 166 static void FILEDLG95_FILETYPE_Clean(HWND hwnd); 153 167 … … 171 185 172 186 /* Shell memory allocation */ 173 void *MemAlloc(UINT size);174 void MemFree(void *mem);187 static void *MemAlloc(UINT size); 188 static void MemFree(void *mem); 175 189 176 190 BOOL WINAPI GetFileName95(FileOpenDlgInfos *fodInfos); … … 184 198 * GetFileName95 185 199 * 186 * Creates an Open common dialog box that lets the user select 200 * Creates an Open common dialog box that lets the user select 187 201 * the drive, directory, and the name of a file or set of files to open. 188 202 * … … 221 235 if( lRes == -1) 222 236 return FALSE; 223 237 224 238 return lRes; 225 239 } … … 228 242 * GetFileDialog95A 229 243 * 230 * Copy the OPENFILENAMEA structure in a FileOpenDlgInfos structure.231 244 * Call GetFileName95 with this structure and clean the memory. 232 245 * … … 235 248 */ 236 249 BOOL WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType) 250 { 251 252 BOOL ret; 253 FileOpenDlgInfos *fodInfos; 254 HINSTANCE hInstance; 255 LPCSTR lpstrInitialDir = (LPCSTR)-1; 256 DWORD dwFlags = 0; 257 258 /* Initialise FileOpenDlgInfos structure*/ 259 fodInfos = (FileOpenDlgInfos*)MemAlloc(sizeof(FileOpenDlgInfos)); 260 ZeroMemory(fodInfos, sizeof(FileOpenDlgInfos)); 261 262 /* Pass in the original ofn */ 263 fodInfos->ofnInfos = ofn; 264 265 /* Save original hInstance value */ 266 hInstance = ofn->hInstance; 267 fodInfos->ofnInfos->hInstance = MapHModuleLS(ofn->hInstance); 268 269 dwFlags = ofn->Flags; 270 ofn->Flags = ofn->Flags|OFN_WINE; 271 272 /* Replace the NULL lpstrInitialDir by the current folder */ 273 if(!ofn->lpstrInitialDir) 274 { 275 lpstrInitialDir = ofn->lpstrInitialDir; 276 ofn->lpstrInitialDir = MemAlloc(MAX_PATH); 277 GetCurrentDirectoryA(MAX_PATH,(LPSTR)ofn->lpstrInitialDir); 278 } 279 280 /* Initialise the dialog property */ 281 fodInfos->DlgInfos.dwDlgProp = 0; 282 fodInfos->DlgInfos.hwndCustomDlg = (HWND)NULL; 283 284 switch(iDlgType) 285 { 286 case OPEN_DIALOG : 287 ret = GetFileName95(fodInfos); 288 break; 289 case SAVE_DIALOG : 290 fodInfos->DlgInfos.dwDlgProp |= FODPROP_SAVEDLG; 291 ret = GetFileName95(fodInfos); 292 break; 293 default : 294 ret = 0; 295 } 296 297 if (lpstrInitialDir != (LPCSTR)-1) 298 { 299 MemFree((LPVOID)(ofn->lpstrInitialDir)); 300 ofn->lpstrInitialDir = lpstrInitialDir; 301 } 302 303 ofn->Flags = dwFlags; 304 ofn->hInstance = hInstance; 305 MemFree((LPVOID)(fodInfos)); 306 return ret; 307 } 308 309 /*********************************************************************** 310 * GetFileDialog95W 311 * 312 * Copy the OPENFILENAMEW structure in a FileOpenDlgInfos structure. 313 * Call GetFileName95 with this structure and clean the memory. 314 * 315 * IN : The OPENFILENAMEW initialisation structure passed to 316 * GetOpenFileNameW win api function (see filedlg.c) 317 * 318 * FIXME: 319 * some more strings are needing to be convertet AtoW 320 */ 321 BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType) 237 322 { 238 323 BOOL ret; … … 241 326 LPCSTR lpstrFilter = NULL; 242 327 LPSTR lpstrCustomFilter = NULL; 243 LPCSTR lpstrInitialDir = NULL; 244 DWORD dwFlags = 0; 328 #ifdef __WIN32OS2__ 329 LPWSTR lpstrInitialDir = NULL; 330 LPWSTR lpstrTitle = NULL; 331 #endif 332 LPWSTR lpstrFile = NULL; 333 DWORD dwFlags; 245 334 246 335 /* Initialise FileOpenDlgInfos structure*/ 247 336 fodInfos = (FileOpenDlgInfos*)MemAlloc(sizeof(FileOpenDlgInfos)); 248 249 /* Pass in the original ofn */ 250 fodInfos->ofnInfos = ofn; 251 252 /* Save original hInstance value */ 253 hInstance = ofn->hInstance; 254 fodInfos->ofnInfos->hInstance = MapHModuleLS(ofn->hInstance); 255 256 if (ofn->lpstrFilter) 257 { 258 LPSTR s,x; 259 lpstrFilter = ofn->lpstrFilter; 260 261 /* filter is a list... title\0ext\0......\0\0 */ 262 s = (LPSTR)ofn->lpstrFilter; 263 while (*s) 264 s = s+strlen(s)+1; 265 s++; 266 x = (LPSTR)MemAlloc(s-ofn->lpstrFilter); 267 memcpy(x,ofn->lpstrFilter,s-ofn->lpstrFilter); 268 fodInfos->ofnInfos->lpstrFilter = (LPSTR)x; 269 } 270 if (ofn->lpstrCustomFilter) 271 { 272 LPSTR s,x; 273 lpstrCustomFilter = ofn->lpstrCustomFilter; 274 275 /* filter is a list... title\0ext\0......\0\0 */ 276 s = (LPSTR)ofn->lpstrCustomFilter; 277 while (*s) 278 s = s+strlen(s)+1; 279 s++; 280 x = MemAlloc(s-ofn->lpstrCustomFilter); 281 memcpy(x,ofn->lpstrCustomFilter,s-ofn->lpstrCustomFilter); 282 fodInfos->ofnInfos->lpstrCustomFilter = (LPSTR)x; 283 } 284 285 dwFlags = ofn->Flags; 286 fodInfos->ofnInfos->Flags = ofn->Flags|OFN_WINE; 287 288 /* Replace the NULL lpstrInitialDir by the current folder */ 289 lpstrInitialDir = ofn->lpstrInitialDir; 290 if(!lpstrInitialDir || *lpstrInitialDir == 0) 291 { 292 fodInfos->ofnInfos->lpstrInitialDir = MemAlloc(MAX_PATH); 293 GetCurrentDirectoryA(MAX_PATH,(LPSTR)fodInfos->ofnInfos->lpstrInitialDir); 294 } 295 296 /* Initialise the dialog property */ 297 fodInfos->DlgInfos.dwDlgProp = 0; 298 fodInfos->DlgInfos.hwndCustomDlg = (HWND)NULL; 299 300 switch(iDlgType) 301 { 302 case OPEN_DIALOG : 303 ret = GetFileName95(fodInfos); 304 break; 305 case SAVE_DIALOG : 306 fodInfos->DlgInfos.dwDlgProp |= FODPROP_SAVEDLG; 307 ret = GetFileName95(fodInfos); 308 break; 309 default : 310 ret = 0; 311 } 312 313 if (lpstrInitialDir) 314 { 315 MemFree((LPVOID)(fodInfos->ofnInfos->lpstrInitialDir)); 316 fodInfos->ofnInfos->lpstrInitialDir = lpstrInitialDir; 317 } 318 if (lpstrFilter) 319 { 320 MemFree((LPVOID)(fodInfos->ofnInfos->lpstrFilter)); 321 fodInfos->ofnInfos->lpstrFilter = lpstrFilter; 322 } 323 if (lpstrCustomFilter) 324 { 325 MemFree((LPVOID)(fodInfos->ofnInfos->lpstrCustomFilter)); 326 fodInfos->ofnInfos->lpstrCustomFilter = lpstrCustomFilter; 327 } 328 329 ofn->Flags = dwFlags; 330 ofn->hInstance = hInstance; 331 MemFree((LPVOID)(fodInfos)); 332 return ret; 333 } 334 335 /*********************************************************************** 336 * GetFileDialog95W 337 * 338 * Copy the OPENFILENAMEW structure in a FileOpenDlgInfos structure. 339 * Call GetFileName95 with this structure and clean the memory. 340 * 341 * IN : The OPENFILENAMEW initialisation structure passed to 342 * GetOpenFileNameW win api function (see filedlg.c) 343 */ 344 BOOL WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType) 345 { 346 BOOL ret; 347 FileOpenDlgInfos *fodInfos; 348 HINSTANCE hInstance; 349 LPCSTR lpstrFilter = NULL; 350 LPSTR lpstrCustomFilter = NULL; 351 LPWSTR lpstrFile = NULL; 352 LPWSTR lpstrInitialDir = NULL; 353 LPWSTR lpstrTitle = NULL; 354 DWORD dwFlags; 355 356 /* Initialise FileOpenDlgInfos structure*/ 357 fodInfos = (FileOpenDlgInfos*)MemAlloc(sizeof(FileOpenDlgInfos)); 337 ZeroMemory(fodInfos, sizeof(FileOpenDlgInfos)); 358 338 359 339 /* Pass in the original ofn */ 360 fodInfos->ofnInfos = (LPOPENFILENAMEA) ofn;340 fodInfos->ofnInfos = (LPOPENFILENAMEA) ofn; 361 341 362 342 /* Save hInstance */ … … 375 355 /* filter is a list... title\0ext\0......\0\0 */ 376 356 s = (LPWSTR)ofn->lpstrFilter; 377 357 378 358 while (*s) 379 359 s = s+lstrlenW(s)+1; … … 384 364 while (*s) { 385 365 lstrcpyWtoA(x,s); 386 x+= lstrlenA(x)+1;366 x+=strlen(x)+1; 387 367 s+=lstrlenW(s)+1; 388 368 } … … 408 388 while (*s) { 409 389 lstrcpyWtoA(x,s); 410 x+= lstrlenA(x)+1;390 x+=strlen(x)+1; 411 391 s+=lstrlenW(s)+1; 412 392 } … … 421 401 /* Initialise the dialog property */ 422 402 fodInfos->DlgInfos.dwDlgProp = 0; 423 403 424 404 /* allocate ansi filename buffer */ 425 405 lpstrFile = ofn->lpstrFile; 426 406 ofn->lpstrFile = MemAlloc(ofn->nMaxFile); 427 407 408 #ifdef __WIN32OS2__ 428 409 // convert initial dir & title (if necessary) 429 410 lpstrInitialDir = (LPWSTR)ofn->lpstrInitialDir; … … 446 427 } 447 428 429 #endif 430 448 431 switch(iDlgType) 449 432 { … … 458 441 ret = 0; 459 442 } 460 443 461 444 /* Cleaning */ 462 445 /* Restore Flags */ … … 484 467 ofn->lpstrFile = lpstrFile; 485 468 469 #ifdef __WIN32OS2__ 486 470 //free converted initial dir & title strings 487 471 if(lpstrInitialDir) { … … 493 477 ofn->lpstrTitle = (LPCWSTR)lpstrTitle; 494 478 } 479 #endif 480 495 481 return ret; 496 482 } … … 499 485 { 500 486 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 487 HWND hwndChild,hwndStc32; 488 RECT rectParent, rectChild, rectCtrl, rectStc32, rectTemp; 489 POINT ptMoveCtl; 490 POINT ptParentClient; 491 492 ptMoveCtl.x = ptMoveCtl.y = 0; 493 hwndStc32=GetDlgItem(hwndChildDlg,stc32); 494 GetClientRect(hwndParentDlg,&rectParent); 495 GetClientRect(hwndChildDlg,&rectChild); 496 if(hwndStc32) 497 { 498 GetWindowRect(hwndStc32,&rectStc32); 499 MapWindowPoints(0, hwndChildDlg,(LPPOINT)&rectStc32,2); 500 CopyRect(&rectTemp,&rectStc32); 501 502 SetRect(&rectStc32,rectStc32.left,rectStc32.top,rectStc32.left + (rectParent.right-rectParent.left),rectStc32.top+(rectParent.bottom-rectParent.top)); 503 SetWindowPos(hwndStc32,0,rectStc32.left,rectStc32.top,rectStc32.right-rectStc32.left,rectStc32.bottom-rectStc32.top,SWP_NOMOVE|SWP_NOZORDER | SWP_NOACTIVATE); 504 505 if(rectStc32.right < rectTemp.right) 506 { 507 ptParentClient.x = max((rectParent.right-rectParent.left),(rectChild.right-rectChild.left)); 508 ptMoveCtl.x = 0; 509 } 510 else 511 { 512 ptMoveCtl.x = (rectStc32.right - rectTemp.right); 513 ptParentClient.x = max((rectParent.right-rectParent.left),((rectChild.right-rectChild.left)+rectStc32.right-rectTemp.right)); 514 } 515 if(rectStc32.bottom < rectTemp.bottom) 516 { 517 ptParentClient.y = max((rectParent.bottom-rectParent.top),(rectChild.bottom-rectChild.top)); 518 ptMoveCtl.y = 0; 519 } 520 else 521 { 522 ptMoveCtl.y = (rectStc32.bottom - rectTemp.bottom); 523 ptParentClient.y = max((rectParent.bottom-rectParent.top),((rectChild.bottom-rectChild.top)+rectStc32.bottom-rectTemp.bottom)); 524 } 525 } 526 else 527 { 528 if( (GetWindow(hwndChildDlg,GW_CHILD)) == (HWND) NULL) 543 529 return; 544 ptParentClient.x = rectParent.right-rectParent.left; 545 ptParentClient.y = (rectParent.bottom-rectParent.top) + (rectChild.bottom-rectChild.top); 546 ptMoveCtl.y = rectParent.bottom-rectParent.top; 547 ptMoveCtl.x=0; 548 } 549 SetRect(&rectParent,rectParent.left,rectParent.top,rectParent.left+ptParentClient.x,rectParent.top+ptParentClient.y); 550 AdjustWindowRectEx( &rectParent,GetWindowLongA(hwndParentDlg,GWL_STYLE),FALSE,GetWindowLongA(hwndParentDlg,GWL_EXSTYLE)); 551 552 SetWindowPos(hwndChildDlg, 0, 0,0, ptParentClient.x,ptParentClient.y, 553 SWP_NOZORDER ); 554 SetWindowPos(hwndParentDlg, 0, rectParent.left,rectParent.top, (rectParent.right- rectParent.left), 555 (rectParent.bottom-rectParent.top),SWP_NOMOVE | SWP_NOZORDER); 556 557 hwndChild = GetWindow(hwndChildDlg,GW_CHILD); 558 if(hwndStc32) 559 { 560 GetWindowRect(hwndStc32,&rectStc32); 561 MapWindowPoints( 0, hwndChildDlg,(LPPOINT)&rectStc32,2); 562 } 563 else 564 SetRect(&rectStc32,0,0,0,0); 565 566 if (hwndChild ) 567 { 568 do 569 { 570 if(hwndChild != hwndStc32) 571 { 572 if (GetWindowLongA( hwndChild, GWL_STYLE ) & WS_MAXIMIZE) 573 continue; 574 GetWindowRect(hwndChild,&rectCtrl); 575 MapWindowPoints( 0, hwndParentDlg,(LPPOINT)&rectCtrl,2); 576 577 /* 578 Check the initial position of the controls relative to the initial 579 position and size of stc32 (before it is expanded). 580 */ 581 if (rectCtrl.left > rectTemp.right && rectCtrl.top > rectTemp.bottom) 582 { 583 rectCtrl.left += ptMoveCtl.x; 584 rectCtrl.top += ptMoveCtl.y; 585 } 586 else if (rectCtrl.left > rectTemp.right) 587 rectCtrl.left += ptMoveCtl.x; 588 else if (rectCtrl.top > rectTemp.bottom) 589 rectCtrl.top += ptMoveCtl.y; 590 591 SetWindowPos( hwndChild, 0, rectCtrl.left, rectCtrl.top, 592 rectCtrl.right-rectCtrl.left,rectCtrl.bottom-rectCtrl.top, 593 SWP_NOSIZE | SWP_NOZORDER ); 594 } 595 } 596 while ((hwndChild=GetWindow( hwndChild, GW_HWNDNEXT )) != (HWND)NULL); 597 } 598 hwndChild = GetWindow(hwndParentDlg,GW_CHILD); 599 600 if(hwndStc32) 601 { 602 GetWindowRect(hwndStc32,&rectStc32); 603 MapWindowPoints( 0, hwndChildDlg,(LPPOINT)&rectStc32,2); 604 ptMoveCtl.x = rectStc32.left - 0; 605 ptMoveCtl.y = rectStc32.top - 0; 606 if (hwndChild ) 607 { 608 do 609 { 610 if(hwndChild != hwndChildDlg) 611 { 612 613 if (GetWindowLongA( hwndChild, GWL_STYLE ) & WS_MAXIMIZE) 614 continue; 615 GetWindowRect(hwndChild,&rectCtrl); 616 MapWindowPoints( 0, hwndParentDlg,(LPPOINT)&rectCtrl,2); 617 618 rectCtrl.left += ptMoveCtl.x; 619 rectCtrl.top += ptMoveCtl.y; 620 621 SetWindowPos( hwndChild, 0, rectCtrl.left, rectCtrl.top, 622 rectCtrl.right-rectCtrl.left,rectCtrl.bottom-rectCtrl.top, 623 SWP_NOSIZE |SWP_NOZORDER ); 624 } 625 } 626 while ((hwndChild=GetWindow( hwndChild, GW_HWNDNEXT )) != (HWND)NULL); 627 } 628 } 530 SetRectEmpty(&rectTemp); 531 ptParentClient.x = max((rectParent.right-rectParent.left),(rectChild.right-rectChild.left)); 532 ptParentClient.y = (rectParent.bottom-rectParent.top) + (rectChild.bottom-rectChild.top); 533 ptMoveCtl.y = rectParent.bottom-rectParent.top; 534 ptMoveCtl.x=0; 535 } 536 SetRect(&rectParent,rectParent.left,rectParent.top,rectParent.left+ptParentClient.x,rectParent.top+ptParentClient.y); 537 AdjustWindowRectEx( &rectParent,GetWindowLongA(hwndParentDlg,GWL_STYLE),FALSE,GetWindowLongA(hwndParentDlg,GWL_EXSTYLE)); 538 539 SetWindowPos(hwndChildDlg, 0, 0,0, ptParentClient.x,ptParentClient.y, 540 SWP_NOZORDER ); 541 SetWindowPos(hwndParentDlg, 0, rectParent.left,rectParent.top, (rectParent.right- rectParent.left), 542 (rectParent.bottom-rectParent.top),SWP_NOMOVE | SWP_NOZORDER); 543 544 hwndChild = GetWindow(hwndChildDlg,GW_CHILD); 545 if(hwndStc32) 546 { 547 GetWindowRect(hwndStc32,&rectStc32); 548 MapWindowPoints( 0, hwndChildDlg,(LPPOINT)&rectStc32,2); 549 } 550 else 551 SetRect(&rectStc32,0,0,0,0); 552 553 if (hwndChild ) 554 { 555 do 556 { 557 if(hwndChild != hwndStc32) 558 { 559 if (GetWindowLongA( hwndChild, GWL_STYLE ) & WS_MAXIMIZE) 560 continue; 561 GetWindowRect(hwndChild,&rectCtrl); 562 MapWindowPoints( 0, hwndParentDlg,(LPPOINT)&rectCtrl,2); 563 564 /* 565 Check the initial position of the controls relative to the initial 566 position and size of stc32 (before it is expanded). 567 */ 568 if (rectCtrl.left >= rectTemp.right && rectCtrl.top >= rectTemp.bottom) 569 { 570 rectCtrl.left += ptMoveCtl.x; 571 rectCtrl.top += ptMoveCtl.y; 572 } 573 else if (rectCtrl.left >= rectTemp.right) 574 rectCtrl.left += ptMoveCtl.x; 575 else if (rectCtrl.top >= rectTemp.bottom) 576 rectCtrl.top += ptMoveCtl.y; 577 578 SetWindowPos( hwndChild, 0, rectCtrl.left, rectCtrl.top, 579 rectCtrl.right-rectCtrl.left,rectCtrl.bottom-rectCtrl.top, 580 SWP_NOSIZE | SWP_NOZORDER ); 581 } 582 } 583 while ((hwndChild=GetWindow( hwndChild, GW_HWNDNEXT )) != (HWND)NULL); 584 } 585 hwndChild = GetWindow(hwndParentDlg,GW_CHILD); 586 587 if(hwndStc32) 588 { 589 GetWindowRect(hwndStc32,&rectStc32); 590 MapWindowPoints( 0, hwndChildDlg,(LPPOINT)&rectStc32,2); 591 ptMoveCtl.x = rectStc32.left - 0; 592 ptMoveCtl.y = rectStc32.top - 0; 593 if (hwndChild ) 594 { 595 do 596 { 597 if(hwndChild != hwndChildDlg) 598 { 599 600 if (GetWindowLongA( hwndChild, GWL_STYLE ) & WS_MAXIMIZE) 601 continue; 602 GetWindowRect(hwndChild,&rectCtrl); 603 MapWindowPoints( 0, hwndParentDlg,(LPPOINT)&rectCtrl,2); 604 605 rectCtrl.left += ptMoveCtl.x; 606 rectCtrl.top += ptMoveCtl.y; 607 608 SetWindowPos( hwndChild, 0, rectCtrl.left, rectCtrl.top, 609 rectCtrl.right-rectCtrl.left,rectCtrl.bottom-rectCtrl.top, 610 SWP_NOSIZE |SWP_NOZORDER ); 611 } 612 } 613 while ((hwndChild=GetWindow( hwndChild, GW_HWNDNEXT )) != (HWND)NULL); 614 } 615 } 629 616 630 617 } … … 636 623 switch(uMsg) 637 624 { 638 639 { 625 case WM_INITDIALOG: 626 { 640 627 fodInfos = (FileOpenDlgInfos *)lParam; 641 lParam = (LPARAM) fodInfos->ofnInfos;642 628 lParam = (LPARAM) fodInfos->ofnInfos; 629 ArrangeCtrlPositions(hwnd,GetParent(hwnd)); 643 630 if(fodInfos && (fodInfos->ofnInfos->Flags & OFN_ENABLEHOOK) && fodInfos->ofnInfos->lpfnHook) 644 631 return CallWindowProcA((WNDPROC)fodInfos->ofnInfos->lpfnHook,hwnd,uMsg,wParam,lParam); 645 return 0; 646 } 632 return 0; 633 } 647 634 } 648 635 if(fodInfos && (fodInfos->ofnInfos->Flags & OFN_ENABLEHOOK) && fodInfos->ofnInfos->lpfnHook ) 649 return CallWindowProcA((WNDPROC)fodInfos->ofnInfos->lpfnHook,hwnd,uMsg,wParam,lParam); 650 return DefWindowProcA(hwnd,uMsg,wParam,lParam); 636 return CallWindowProcA((WNDPROC)fodInfos->ofnInfos->lpfnHook,hwnd,uMsg,wParam,lParam); 637 return DefWindowProcA(hwnd,uMsg,wParam,lParam); 651 638 } 652 639 … … 659 646 if (fodInfos->ofnInfos->Flags & OFN_ENABLETEMPLATE || fodInfos->ofnInfos->Flags & OFN_ENABLETEMPLATEHANDLE) 660 647 { 661 662 648 if (fodInfos->ofnInfos->Flags & OFN_ENABLETEMPLATEHANDLE) 649 { 663 650 if( !(template = LockResource( fodInfos->ofnInfos->hInstance))) 664 665 666 667 668 669 670 671 672 651 { 652 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE); 653 return (HWND)NULL; 654 } 655 656 } 657 else 658 { 659 if (!(hRes = FindResourceA(MapHModuleSL(fodInfos->ofnInfos->hInstance), 673 660 (fodInfos->ofnInfos->lpTemplateName), RT_DIALOGA))) 674 675 676 677 678 661 { 662 COMDLG32_SetCommDlgExtendedError(CDERR_FINDRESFAILURE); 663 return (HWND)NULL; 664 } 665 if (!(hDlgTmpl = LoadResource( MapHModuleSL(fodInfos->ofnInfos->hInstance), 679 666 hRes )) || 680 667 !(template = LockResource( hDlgTmpl ))) 681 682 683 684 685 686 687 688 689 690 ShowWindow(hChildDlg,SW_SHOW);691 692 668 { 669 COMDLG32_SetCommDlgExtendedError(CDERR_LOADRESFAILURE); 670 return (HWND)NULL; 671 } 672 } 673 674 hChildDlg= CreateDialogIndirectParamA(fodInfos->ofnInfos->hInstance,template,hwnd,(DLGPROC)FileOpenDlgProcUserTemplate,(LPARAM)fodInfos); 675 if(hChildDlg) 676 { 677 ShowWindow(hChildDlg,SW_SHOW); 678 return hChildDlg; 679 } 693 680 } 694 681 else if(fodInfos->ofnInfos->Flags & OFN_ENABLEHOOK && fodInfos->ofnInfos->lpfnHook) 695 682 { 696 697 698 699 700 701 702 703 704 705 706 707 683 RECT rectHwnd; 684 DLGTEMPLATE tmplate; 685 GetClientRect(hwnd,&rectHwnd); 686 tmplate.style = WS_CHILD | WS_CLIPSIBLINGS; 687 tmplate.dwExtendedStyle = 0; 688 tmplate.cdit = 0; 689 tmplate.x = 0; 690 tmplate.y = 0; 691 tmplate.cx = rectHwnd.right-rectHwnd.left; 692 tmplate.cy = rectHwnd.bottom-rectHwnd.top; 693 694 return CreateDialogIndirectParamA(fodInfos->ofnInfos->hInstance,&tmplate,hwnd,(DLGPROC)FileOpenDlgProcUserTemplate,(LPARAM)fodInfos); 708 695 } 709 696 return (HWND)NULL; 710 697 } 711 698 712 699 /*********************************************************************** 713 700 * SendCustomDlgNotificationMessage … … 741 728 { 742 729 LPSTR lpstrFileSpec; 743 char lpstrCurrentDir[MAX_PATH]=""; 730 int reqSize; 731 char lpstrPath[MAX_PATH]; 744 732 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); 745 if(!fodInfos) 746 return TRUE; 733 if(!fodInfos) return -1; 734 747 735 switch(uMsg) 748 736 { 749 737 case CDM_GETFILEPATH: 750 { 751 char lpstrPathSpec[MAX_PATH]=""; 752 GetDlgItemTextA(hwnd,IDC_FILENAME,(LPSTR)lParam, (int)wParam); 753 lpstrFileSpec = (LPSTR)COMDLG32_PathFindFilenameA((LPSTR)lParam); 754 strcpy(lpstrPathSpec,(LPSTR)lParam); 755 COMDLG32_PathRemoveFileSpecA(lpstrPathSpec); 756 if(!lpstrPathSpec[0]) 757 COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent, 758 lpstrPathSpec); 759 strcat(lpstrPathSpec,"\\"); 760 strcat(lpstrPathSpec,(LPSTR)lParam); 761 strcpy((LPSTR)lParam,(LPSTR)lpstrPathSpec); 762 } 763 return TRUE; 738 GetDlgItemTextA(hwnd,IDC_FILENAME,lpstrPath, sizeof(lpstrPath)); 739 lpstrFileSpec = (LPSTR)COMDLG32_PathFindFileNameA(lpstrPath); 740 if (lpstrFileSpec==lpstrPath) 741 { 742 char lpstrCurrentDir[MAX_PATH]; 743 /* Prepend the current path */ 744 COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrCurrentDir); 745 if ((LPSTR)lParam!=NULL) 746 wsnprintfA((LPSTR)lParam,(int)wParam,"%s\\%s",lpstrCurrentDir,lpstrPath); 747 reqSize=strlen(lpstrCurrentDir)+1+strlen(lpstrPath)+1; 748 } 749 else 750 { 751 lstrcpynA((LPSTR)lParam,(LPSTR)lpstrPath,(int)wParam); 752 reqSize=strlen(lpstrPath); 753 } 754 /* return the required buffer size */ 755 return reqSize; 756 764 757 case CDM_GETFOLDERPATH: 765 if(lParam) 766 { 767 if(fodInfos) 768 { 769 COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent, 770 lpstrCurrentDir); 771 strncpy((LPSTR)lParam,lpstrCurrentDir,(int)wParam); 772 } 773 else 774 *((LPSTR)lParam)=0; 775 } 776 return TRUE; 777 case CDM_GETSPEC: 778 if(lParam) 779 { 780 GetDlgItemTextA(hwnd,IDC_FILENAME,(LPSTR)lParam, (int)wParam); 781 lpstrFileSpec = (LPSTR)COMDLG32_PathFindFilenameA((LPSTR)lParam); 782 if(lpstrFileSpec) 783 strcpy((LPSTR)lParam, lpstrFileSpec); 784 else 785 *((LPSTR)lParam)=0; 786 } 787 return TRUE; 758 COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath); 759 if ((LPSTR)lParam!=NULL) 760 lstrcpynA((LPSTR)lParam,lpstrPath,(int)wParam); 761 return strlen(lpstrPath); 762 763 case CDM_GETSPEC: 764 reqSize=GetDlgItemTextA(hwnd,IDC_FILENAME,lpstrPath, sizeof(lpstrPath)); 765 lpstrFileSpec = (LPSTR)COMDLG32_PathFindFileNameA(lpstrPath); 766 if ((LPSTR)lParam!=NULL) 767 lstrcpynA((LPSTR)lParam, lpstrFileSpec, (int)wParam); 768 return strlen(lpstrFileSpec); 769 788 770 case CDM_SETCONTROLTEXT: 789 if ( 0 != lParam ) 790 SetDlgItemTextA( hwnd, (UINT) wParam, (LPSTR) lParam ); 791 return TRUE; 771 if ( 0 != lParam ) 772 SetDlgItemTextA( hwnd, (UINT) wParam, (LPSTR) lParam ); 773 return TRUE; 774 792 775 case CDM_HIDECONTROL: 793 776 case CDM_SETDEFEXT: 794 FIXME("CDM_HIDECONTROL,CDM_SETCONTROLTEXT,CDM_SETDEFEXT not implemented\n");795 return TRUE;777 FIXME("CDM_HIDECONTROL,CDM_SETCONTROLTEXT,CDM_SETDEFEXT not implemented\n"); 778 return -1; 796 779 } 797 780 return TRUE; 798 781 } 799 782 800 783 /*********************************************************************** 801 784 * FileOpenDlgProc95 … … 807 790 switch(uMsg) 808 791 { 809 case WM_INITDIALOG 810 /* Adds the FileOpenDlgInfos in the property list of the dialog 792 case WM_INITDIALOG: 793 /* Adds the FileOpenDlgInfos in the property list of the dialog 811 794 so it will be easily accessible through a GetPropA(...) */ 812 813 814 815 ((FileOpenDlgInfos *)lParam)->DlgInfos.hwndCustomDlg =816 795 SetPropA(hwnd, FileOpenDlgInfosStr, (HANDLE) lParam); 796 797 FILEDLG95_OnWMInitDialog(hwnd, wParam, lParam); 798 ((FileOpenDlgInfos *)lParam)->DlgInfos.hwndCustomDlg = 799 CreateTemplateDialog((FileOpenDlgInfos *)lParam,hwnd); 817 800 SendCustomDlgNotificationMessage(hwnd,CDN_INITDONE); 818 801 return 0; … … 829 812 } 830 813 return FALSE; 831 814 832 815 case WM_GETISHELLBROWSER: 833 816 return FILEDLG95_OnWMGetIShellBrowser(hwnd); 834 817 835 case WM_DESTROY: 836 FILEDLG95_Clean(hwnd); 837 RemovePropA(hwnd, FileOpenDlgInfosStr); 838 return FALSE; 818 case WM_DESTROY: 819 RemovePropA(hwnd, FileOpenDlgInfosStr); 820 return FALSE; 839 821 840 822 case WM_NOTIFY: 841 823 { 842 LPNMHDR lpnmh = (LPNMHDR)lParam; 843 UINT stringId = -1; 844 845 /* set up the button tooltips strings */ 846 if(TTN_GETDISPINFOA == lpnmh->code ) 847 { 848 LPNMTTDISPINFOA lpdi = (LPNMTTDISPINFOA)lParam; 849 switch(lpnmh->idFrom ) 850 { 851 /* Up folder button */ 852 case FCIDM_TB_UPFOLDER: 853 stringId = IDS_UPFOLDER; 854 break; 855 /* New folder button */ 856 case FCIDM_TB_NEWFOLDER: 857 stringId = IDS_NEWFOLDER; 858 break; 859 /* List option button */ 860 case FCIDM_TB_SMALLICON: 861 stringId = IDS_LISTVIEW; 862 break; 863 /* Details option button */ 864 case FCIDM_TB_REPORTVIEW: 865 stringId = IDS_REPORTVIEW; 866 break; 867 } 868 lpdi->hinst = COMMDLG_hInstance32; 869 lpdi->lpszText = (LPSTR) stringId; 870 } 824 LPNMHDR lpnmh = (LPNMHDR)lParam; 825 UINT stringId = -1; 826 827 /* set up the button tooltips strings */ 828 if(TTN_GETDISPINFOA == lpnmh->code ) 829 { 830 LPNMTTDISPINFOA lpdi = (LPNMTTDISPINFOA)lParam; 831 switch(lpnmh->idFrom ) 832 { 833 /* Up folder button */ 834 case FCIDM_TB_UPFOLDER: 835 stringId = IDS_UPFOLDER; 836 break; 837 /* New folder button */ 838 case FCIDM_TB_NEWFOLDER: 839 stringId = IDS_NEWFOLDER; 840 break; 841 /* List option button */ 842 case FCIDM_TB_SMALLICON: 843 stringId = IDS_LISTVIEW; 844 break; 845 /* Details option button */ 846 case FCIDM_TB_REPORTVIEW: 847 stringId = IDS_REPORTVIEW; 848 break; 849 /* Desktop button */ 850 case FCIDM_TB_DESKTOP: 851 stringId = IDS_TODESKTOP; 852 break; 853 default: 854 stringId = 0; 855 } 856 lpdi->hinst = COMMDLG_hInstance32; 857 lpdi->lpszText = (LPSTR) stringId; 858 } 871 859 return FALSE; 872 860 } 873 874 861 default : 875 862 if(uMsg >= CDM_FIRST && uMsg <= CDM_LAST) … … 888 875 LPITEMIDLIST pidlItemId; 889 876 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) lParam; 890 DWORD count; 891 892 TRACE("\n"); 893 894 #ifndef __WIN32OS2__ 895 /* Make sure the common control DLL is loaded */ 896 InitCommonControls(); 897 #endif 898 //MessageBox(hwnd,"WM_INITDIALOG",NULL,MB_OK); 899 dprintf(("CB: FILEDLG95_SHELL_Init")); 900 count = GetTickCount(); 877 878 TRACE("dir=%s file=%s\n", 879 fodInfos->ofnInfos->lpstrInitialDir, fodInfos->ofnInfos->lpstrFile); 880 881 /* Get the initial directory pidl */ 882 883 if(!(pidlItemId = GetPidlFromName(fodInfos->Shell.FOIShellFolder,fodInfos->ofnInfos->lpstrInitialDir))) 884 { 885 char path[MAX_PATH]; 886 887 GetCurrentDirectoryA(MAX_PATH,path); 888 pidlItemId = GetPidlFromName(fodInfos->Shell.FOIShellFolder, path); 889 890 } 891 901 892 /* Initialise shell objects */ 902 893 FILEDLG95_SHELL_Init(hwnd); 903 //dprintf(("CB: FILEDLG95_InitUI %d ms",GetTickCount()-count)); 904 //count = GetTickCount(); 894 905 895 /* Initialise dialog UI */ 906 896 FILEDLG95_InitUI(hwnd); 907 //dprintf(("CB: FILEDLG95_LOOKIN_Init %d",GetTickCount()-count)); 908 //count = GetTickCount(); 897 909 898 /* Initialize the Look In combo box*/ 910 899 FILEDLG95_LOOKIN_Init(fodInfos->DlgInfos.hwndLookInCB); 911 //dprintf(("CB: FILEDLG95_FILETYPE_Init %d",GetTickCount()-count)); 912 //count = GetTickCount(); 900 913 901 /* Initialize the filter combo box */ 914 902 FILEDLG95_FILETYPE_Init(hwnd); 915 //dprintf(("CB: FILEDLG95_FILETYPE_Init done %d",GetTickCount()-count)); 916 //count = GetTickCount(); 917 /* Get the initial directory pidl */ 918 919 if(!(pidlItemId = GetPidlFromName(fodInfos->Shell.FOIShellFolder,fodInfos->ofnInfos->lpstrInitialDir))) 920 { 921 char path[MAX_PATH]; 922 923 GetCurrentDirectoryA(MAX_PATH,path); 924 pidlItemId = GetPidlFromName(fodInfos->Shell.FOIShellFolder, 925 path); 926 927 } 928 dprintf(("CB: IShellBrowser_BrowseObject %d",GetTickCount()-count)); 929 count = GetTickCount(); 930 //CB: slowest part 903 931 904 /* Browse to the initial directory */ 932 IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser,pidlItemId, SBSP_RELATIVE);933 dprintf(("CB: done WM_INITDIALOG %d",GetTickCount()-count)); 905 IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser,pidlItemId, SBSP_ABSOLUTE); 906 934 907 /* Free pidlItem memory */ 935 908 COMDLG32_SHFree(pidlItemId); … … 968 941 /* Cancel button */ 969 942 case IDCANCEL: 943 FILEDLG95_Clean(hwnd); 970 944 EndDialog(hwnd, FALSE); 971 945 break; … … 986 960 /* New folder button */ 987 961 case FCIDM_TB_NEWFOLDER: 988 FILEDLG95_SHELL_ NewFolder(hwnd);962 FILEDLG95_SHELL_ExecuteCommand(hwnd,CMDSTR_NEWFOLDER); 989 963 break; 990 964 /* List option button */ … … 996 970 FILEDLG95_SHELL_ExecuteCommand(hwnd,CMDSTR_VIEWDETAILS); 997 971 break; 972 /* Details option button */ 973 case FCIDM_TB_DESKTOP: 974 FILEDLG95_SHELL_BrowseToDesktop(hwnd); 975 break; 998 976 999 977 case IDC_FILENAME: … … 1003 981 /* Do not use the listview selection anymore */ 1004 982 fodInfos->DlgInfos.dwDlgProp &= ~FODPROP_USEVIEW; 1005 return 0; 983 return 0; 1006 984 } 1007 985 … … 1020 998 SetWindowLongA(hwnd,DWL_MSGRESULT,(LONG)fodInfos->Shell.FOIShellBrowser); 1021 999 1022 return TRUE; 1000 return TRUE; 1023 1001 } 1024 1002 … … 1031 1009 { 1032 1010 TBBUTTON tbb[] = 1033 {{VIEW_PARENTFOLDER, FCIDM_TB_UPFOLDER, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, 1011 { 1012 {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0, 0}, 0, 0 }, 1013 {VIEW_PARENTFOLDER, FCIDM_TB_UPFOLDER, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, 1014 {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0, 0}, 0, 0 }, 1015 {VIEW_NEWFOLDER+1, FCIDM_TB_DESKTOP, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, 1034 1016 {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, {0, 0}, 0, 0 }, 1035 1017 {VIEW_NEWFOLDER, FCIDM_TB_NEWFOLDER, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, … … 1038 1020 {VIEW_DETAILS, FCIDM_TB_REPORTVIEW, TBSTATE_ENABLED, TBSTYLE_BUTTON, {0, 0}, 0, 0 }, 1039 1021 }; 1040 TBADDBITMAP tba = { HINST_COMMCTRL, IDB_VIEW_SMALL_COLOR }; 1022 TBADDBITMAP tba[] = 1023 { 1024 { HINST_COMMCTRL, IDB_VIEW_SMALL_COLOR }, 1025 { COMDLG32_hInstance, 800 } // desktop icon 1026 }; 1027 1041 1028 RECT rectTB; 1042 1029 1043 1030 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); 1044 1031 … … 1054 1041 MapWindowPoints( 0, hwnd,(LPPOINT)&rectTB,2); 1055 1042 1056 fodInfos->DlgInfos.hwndTB = CreateWindowExA(0, TOOLBARCLASSNAMEA, (LPSTR) NULL, 1043 fodInfos->DlgInfos.hwndTB = CreateWindowExA(0, TOOLBARCLASSNAMEA, (LPSTR) NULL, 1057 1044 WS_CHILD | WS_GROUP | TBSTYLE_TOOLTIPS | CCS_NODIVIDER | CCS_NORESIZE, 1058 1045 0, 0, 150, 26, 1059 hwnd, (HMENU) IDC_TOOLBAR, COMMDLG_hInstance32, NULL); 1060 1061 SetWindowPos(fodInfos->DlgInfos.hwndTB, 0, 1062 1063 1046 hwnd, (HMENU) IDC_TOOLBAR, COMMDLG_hInstance32, NULL); 1047 1048 SetWindowPos(fodInfos->DlgInfos.hwndTB, 0, 1049 rectTB.left,rectTB.top, rectTB.right-rectTB.left, rectTB.bottom-rectTB.top, 1050 SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOZORDER ); 1064 1051 1065 1052 SendMessageA(fodInfos->DlgInfos.hwndTB, TB_BUTTONSTRUCTSIZE, (WPARAM) sizeof(TBBUTTON), 0); … … 1067 1054 /* fixme: use TB_LOADIMAGES when implemented */ 1068 1055 /* SendMessageA(fodInfos->DlgInfos.hwndTB, TB_LOADIMAGES, (WPARAM) IDB_VIEW_SMALL_COLOR, HINST_COMMCTRL);*/ 1069 SendMessageA(fodInfos->DlgInfos.hwndTB, TB_ADDBITMAP, (WPARAM) 12, (LPARAM) &tba); 1070 1071 SendMessageA(fodInfos->DlgInfos.hwndTB, TB_ADDBUTTONSA, (WPARAM) 6,(LPARAM) &tbb); 1072 SendMessageA(fodInfos->DlgInfos.hwndTB, TB_AUTOSIZE, 0, 0); 1056 SendMessageA(fodInfos->DlgInfos.hwndTB, TB_ADDBITMAP, (WPARAM) 12, (LPARAM) &tba[0]); 1057 SendMessageA(fodInfos->DlgInfos.hwndTB, TB_ADDBITMAP, (WPARAM) 1, (LPARAM) &tba[1]); 1058 1059 SendMessageA(fodInfos->DlgInfos.hwndTB, TB_ADDBUTTONSA, (WPARAM) 9,(LPARAM) &tbb); 1060 SendMessageA(fodInfos->DlgInfos.hwndTB, TB_AUTOSIZE, 0, 0); 1073 1061 1074 1062 /* Set the window text with the text specified in the OPENFILENAME structure */ … … 1085 1073 if(fodInfos->ofnInfos->lpstrFile) 1086 1074 { 1087 /** 1088 * When passed a fully qualified filename, windows removes 1089 * the path component, before showing it in the control 1090 */ 1091 LPSTR lpstrFileName = NULL; 1092 1093 lpstrFileName = (LPSTR)COMDLG32_PathFindFilenameA(fodInfos->ofnInfos->lpstrFile); 1094 if(NULL != lpstrFileName) 1095 SetDlgItemTextA(hwnd,IDC_FILENAME,lpstrFileName); 1096 else 1097 SetDlgItemTextA(hwnd,IDC_FILENAME,""); 1075 LPSTR lpstrFile = COMDLG32_PathFindFileNameA(fodInfos->ofnInfos->lpstrFile); 1076 SetDlgItemTextA(hwnd, IDC_FILENAME, lpstrFile); 1098 1077 } 1099 1078 … … 1103 1082 SendDlgItemMessageA(hwnd,IDC_OPENREADONLY,BM_SETCHECK,(WPARAM)TRUE,0); 1104 1083 } 1084 1105 1085 /* Must the open as read only check box be hid ?*/ 1106 1086 if(fodInfos->ofnInfos->Flags & OFN_HIDEREADONLY) … … 1108 1088 ShowWindow(GetDlgItem(hwnd,IDC_OPENREADONLY),SW_HIDE); 1109 1089 } 1090 1110 1091 /* Must the help button be hid ?*/ 1111 1092 if (!(fodInfos->ofnInfos->Flags & OFN_SHOWHELP)) … … 1113 1094 ShowWindow(GetDlgItem(hwnd, pshHelp), SW_HIDE); 1114 1095 } 1096 1115 1097 /* Resize the height, if open as read only checkbox ad help button 1116 1098 are hidden */ … … 1124 1106 /* subtract the height of the help button plus the space between 1125 1107 the help button and the cancel button to the height of the dialog */ 1126 SetWindowPos(hwnd, 0, 0, 0, rectDlg.right-rectDlg.left, 1127 (rectDlg.bottom-rectDlg.top) - (rectHelp.bottom - rectCancel.bottom), 1108 SetWindowPos(hwnd, 0, 0, 0, rectDlg.right-rectDlg.left, 1109 (rectDlg.bottom-rectDlg.top) - (rectHelp.bottom - rectCancel.bottom), 1128 1110 SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER); 1129 1111 } 1130 /* change Open to Save */ 1112 1113 /* change Open to Save FIXME: use resources */ 1131 1114 if (fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) 1132 1115 { 1133 SetDlgItemTextA(hwnd,IDOK," Save");1116 SetDlgItemTextA(hwnd,IDOK,"&Save"); 1134 1117 SetDlgItemTextA(hwnd,IDC_LOOKINSTATIC,"Save &in"); 1135 1118 } … … 1139 1122 /*********************************************************************** 1140 1123 * FILEDLG95_OnOpenMultipleFiles 1141 * 1124 * 1142 1125 * Handles the opening of multiple files. 1143 1126 * 1127 * FIXME 1128 * check destination buffer size 1129 */ 1130 BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPSTR lpstrFileList, UINT nFileCount, UINT sizeUsed) 1131 { 1132 CHAR lpstrPathSpec[MAX_PATH] = ""; 1133 LPSTR lpstrFile; 1134 UINT nCount, nSizePath; 1135 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); 1136 1137 TRACE("\n"); 1138 1139 lpstrFile = fodInfos->ofnInfos->lpstrFile; 1140 lpstrFile[0] = '\0'; 1141 1142 COMDLG32_SHGetPathFromIDListA( fodInfos->ShellInfos.pidlAbsCurrent, lpstrPathSpec ); 1143 1144 if ( !(fodInfos->ofnInfos->Flags & OFN_NOVALIDATE) && 1145 ( fodInfos->ofnInfos->Flags & OFN_FILEMUSTEXIST)) 1146 { 1147 LPSTR lpstrTemp = lpstrFileList; 1148 1149 for ( nCount = 0; nCount < nFileCount; nCount++ ) 1150 { 1151 LPITEMIDLIST pidl; 1152 1153 pidl = GetPidlFromName(fodInfos->Shell.FOIShellFolder, lpstrTemp); 1154 if (!pidl) 1155 { 1156 CHAR lpstrNotFound[100]; 1157 CHAR lpstrMsg[100]; 1158 CHAR tmp[400]; 1159 1160 LoadStringA(COMMDLG_hInstance32, IDS_FILENOTFOUND, lpstrNotFound, 100); 1161 LoadStringA(COMMDLG_hInstance32, IDS_VERIFYFILE, lpstrMsg, 100); 1162 1163 strcpy(tmp, lpstrTemp); 1164 strcat(tmp, "\n"); 1165 strcat(tmp, lpstrNotFound); 1166 strcat(tmp, "\n"); 1167 strcat(tmp, lpstrMsg); 1168 1169 MessageBoxA(hwnd, tmp, fodInfos->ofnInfos->lpstrTitle, MB_OK | MB_ICONEXCLAMATION); 1170 return FALSE; 1171 } 1172 1173 lpstrTemp += strlen(lpstrFileList) + 1; 1174 COMDLG32_SHFree(pidl); 1175 } 1176 } 1177 1178 nSizePath = strlen(lpstrPathSpec); 1179 strcpy( lpstrFile, lpstrPathSpec); 1180 memcpy( lpstrFile + nSizePath + 1, lpstrFileList, sizeUsed ); 1181 1182 fodInfos->ofnInfos->nFileOffset = nSizePath + 1; 1183 fodInfos->ofnInfos->nFileExtension = 0; 1184 1185 /* clean and exit */ 1186 FILEDLG95_Clean(hwnd); 1187 return EndDialog(hwnd,TRUE); 1188 } 1189 1190 /*********************************************************************** 1191 * FILEDLG95_OnOpen 1192 * 1193 * Ok button WM_COMMAND message handler 1194 * 1195 * If the function succeeds, the return value is nonzero. 1196 */ 1197 #define ONOPEN_BROWSE 1 1198 #define ONOPEN_OPEN 2 1199 #define ONOPEN_SEARCH 3 1200 static void FILEDLG95_OnOpenMessage(HWND hwnd, int idCaption, int idText) 1201 { 1202 char strMsgTitle[MAX_PATH]; 1203 char strMsgText [MAX_PATH]; 1204 if (idCaption) 1205 LoadStringA(COMDLG32_hInstance, idCaption, strMsgTitle, sizeof(strMsgTitle)); 1206 else 1207 strMsgTitle[0] = '\0'; 1208 LoadStringA(COMDLG32_hInstance, idText, strMsgText, sizeof(strMsgText)); 1209 MessageBoxA(hwnd,strMsgText, strMsgTitle, MB_OK | MB_ICONHAND); 1210 } 1211 1212 BOOL FILEDLG95_OnOpen(HWND hwnd) 1213 { 1214 char * lpstrFileList; 1215 UINT nFileCount = 0; 1216 UINT sizeUsed = 0; 1217 BOOL ret = TRUE; 1218 char lpstrPathAndFile[MAX_PATH]; 1219 char lpstrTemp[MAX_PATH]; 1220 LPSHELLFOLDER lpsf = NULL; 1221 int nOpenAction; 1222 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); 1223 1224 TRACE("hwnd=0x%04x\n", hwnd); 1225 1226 /* get the files from the edit control */ 1227 nFileCount = FILEDLG95_FILENAME_GetFileNames(hwnd, &lpstrFileList, &sizeUsed); 1228 1229 /* try if the user selected a folder in the shellview */ 1230 if(nFileCount == 0) 1231 { 1232 BrowseSelectedFolder(hwnd); 1233 return FALSE; 1234 } 1235 1236 if(nFileCount > 1) 1237 { 1238 ret = FILEDLG95_OnOpenMultipleFiles(hwnd, lpstrFileList, nFileCount, sizeUsed); 1239 goto ret; 1240 } 1241 1242 TRACE("count=%u len=%u file=%s\n", nFileCount, sizeUsed, lpstrFileList); 1243 1244 /* 1245 Step 1: Build a complete path name from the current folder and 1246 the filename or path in the edit box. 1247 Special cases: 1248 - the path in the edit box is a root path 1249 (with or without drive letter) 1250 - the edit box contains ".." (or a path with ".." in it) 1144 1251 */ 1145 BOOL FILEDLG95_OnOpenMultipleFiles(HWND hwnd, LPSTR lpstrFileList, UINT nFileCount, UINT sizeUsed) 1146 { 1147 CHAR lpstrPathSpec[MAX_PATH] = ""; 1148 CHAR lpstrTempFileList[MAX_PATH] = ""; 1149 LPSTR lpstrFile; 1150 UINT sizePath; 1151 UINT nCount; 1152 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); 1153 1154 TRACE("\n"); 1155 1156 lpstrFile = fodInfos->ofnInfos->lpstrFile; 1157 1158 COMDLG32_SHGetPathFromIDListA( fodInfos->ShellInfos.pidlAbsCurrent, lpstrPathSpec ); 1159 sizePath = lstrlenA( lpstrPathSpec ); 1160 1161 memset( lpstrFile, 0x0, fodInfos->ofnInfos->nMaxFile * sizeof(CHAR) ); 1162 1163 if ( fodInfos->ofnInfos->Flags & OFN_FILEMUSTEXIST || 1164 !(fodInfos->ofnInfos->Flags & OFN_EXPLORER )) 1165 { 1166 LPSTR lpstrTemp = lpstrFileList; 1167 1168 for ( nCount = 0; nCount < nFileCount; nCount++ ) 1252 1253 /* Get the current directory name */ 1254 if (!COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent, lpstrPathAndFile)) 1255 { 1256 /* we are in a special folder, default to desktop */ 1257 if(FAILED(COMDLG32_SHGetFolderPathA(hwnd, CSIDL_DESKTOPDIRECTORY|CSIDL_FLAG_CREATE, NULL, 0, lpstrPathAndFile))) 1258 { 1259 /* last fallback */ 1260 GetCurrentDirectoryA(MAX_PATH, lpstrPathAndFile); 1261 } 1262 } 1263 COMDLG32_PathAddBackslashA(lpstrPathAndFile); 1264 1265 TRACE("current directory=%s\n", lpstrPathAndFile); 1266 1267 /* if the user specifyed a fully qualified path use it */ 1268 if(COMDLG32_PathIsRelativeA(lpstrFileList)) 1269 { 1270 strcat(lpstrPathAndFile, lpstrFileList); 1271 } 1272 else 1273 { 1274 /* does the path have a drive letter? */ 1275 if (COMDLG32_PathGetDriveNumberA(lpstrFileList) == -1) 1276 strcpy(lpstrPathAndFile+2, lpstrFileList); 1277 else 1278 strcpy(lpstrPathAndFile, lpstrFileList); 1279 } 1280 1281 /* resolve "." and ".." */ 1282 COMDLG32_PathCanonicalizeA(lpstrTemp, lpstrPathAndFile ); 1283 strcpy(lpstrPathAndFile, lpstrTemp); 1284 TRACE("canon=%s\n", lpstrPathAndFile); 1285 1286 MemFree(lpstrFileList); 1287 1288 /* 1289 Step 2: here we have a cleaned up path 1290 1291 We have to parse the path step by step to see if we have to browse 1292 to a folder if the path points to a directory or the last 1293 valid element is a directory. 1294 1295 valid variables: 1296 lpstrPathAndFile: cleaned up path 1297 */ 1298 1299 nOpenAction = ONOPEN_BROWSE; 1300 1301 /* dont apply any checks with OFN_NOVALIDATE */ 1302 if(!(fodInfos->ofnInfos->Flags & OFN_NOVALIDATE)) 1303 { 1304 LPSTR lpszTemp, lpszTemp1; 1305 LPITEMIDLIST pidl = NULL; 1306 1307 /* check for invalid chars */ 1308 if(strpbrk(lpstrPathAndFile+3, "/:<>|") != NULL) 1309 { 1310 FILEDLG95_OnOpenMessage(hwnd, IDS_INVALID_FILENAME_TITLE, IDS_INVALID_FILENAME); 1311 ret = FALSE; 1312 goto ret; 1313 } 1314 1315 if (FAILED (COMDLG32_SHGetDesktopFolder(&lpsf))) return FALSE; 1316 1317 lpszTemp1 = lpszTemp = lpstrPathAndFile; 1318 while (lpszTemp1) 1319 { 1320 LPSHELLFOLDER lpsfChild; 1321 WCHAR lpwstrTemp[MAX_PATH]; 1322 DWORD dwEaten, dwAttributes; 1323 1324 lpszTemp = COMDLG32_PathFindNextComponentA(lpszTemp); 1325 if (*lpszTemp) 1326 lstrcpynAtoW(lpwstrTemp, lpszTemp1, lpszTemp - lpszTemp1); 1327 else 1169 1328 { 1170 WIN32_FIND_DATAA findData; 1171 CHAR lpstrFindFile[MAX_PATH]; 1172 HANDLE hFind; 1173 1174 memset( lpstrFindFile, 0x0, MAX_PATH * sizeof(CHAR) ); 1175 1176 lstrcpyA( lpstrFindFile, lpstrPathSpec ); 1177 lstrcatA( lpstrFindFile, "\\" ); 1178 lstrcatA( lpstrFindFile, lpstrTemp ); 1179 1180 hFind = FindFirstFileA( lpstrFindFile, &findData ); 1181 if (hFind == INVALID_HANDLE_VALUE) 1182 { 1183 CHAR lpstrNotFound[100]; 1184 CHAR lpstrMsg[100]; 1185 CHAR tmp[400]; 1186 1187 LoadStringA(COMMDLG_hInstance32, IDS_FILENOTFOUND, lpstrNotFound, 100); 1188 LoadStringA(COMMDLG_hInstance32, IDS_VERIFYFILE, lpstrMsg, 100); 1189 1190 strcpy(tmp, lpstrFindFile); 1191 strcat(tmp, "\n"); 1192 strcat(tmp, lpstrNotFound); 1193 strcat(tmp, "\n"); 1194 strcat(tmp, lpstrMsg); 1195 1196 MessageBoxA(hwnd, 1197 tmp, 1198 fodInfos->ofnInfos->lpstrTitle, 1199 MB_OK | MB_ICONEXCLAMATION); 1200 return FALSE; 1201 } else FindClose(hFind); 1202 1203 if (!(fodInfos->ofnInfos->Flags & OFN_EXPLORER )) 1204 { 1205 lstrcatA( lpstrTempFileList, findData.cAlternateFileName); 1206 if ( nCount + 1 < nFileCount) 1207 lstrcatA( lpstrTempFileList, " "); 1208 } 1209 lpstrTemp += strlen(lpstrFileList) + 1; 1329 lstrcpyAtoW(lpwstrTemp, lpszTemp1); /* last element */ 1330 if(strpbrk(lpszTemp1, "*?") != NULL) 1331 { 1332 nOpenAction = ONOPEN_SEARCH; 1333 break; 1210 1334 } 1211 1335 } 1212 1213 if ( fodInfos->ofnInfos->Flags & OFN_EXPLORER ) 1336 lpszTemp1 = lpszTemp; 1337 1338 TRACE("parse now=%s next=%s sf=%p\n",debugstr_w(lpwstrTemp), debugstr_a(lpszTemp), lpsf); 1339 1340 if(lstrlenW(lpwstrTemp)==2) COMDLG32_PathAddBackslashW(lpwstrTemp); 1341 1342 dwAttributes = SFGAO_FOLDER; 1343 if(FAILED(IShellFolder_ParseDisplayName(lpsf, hwnd, NULL, lpwstrTemp, &dwEaten, &pidl, &dwAttributes))) 1214 1344 { 1215 lstrcpyA( lpstrFile, lpstrPathSpec); 1216 memcpy( lpstrFile + sizePath + 1, lpstrFileList, sizeof(CHAR) * sizeUsed ); 1345 if(*lpszTemp) /* points to trailing null for last path element */ 1346 { 1347 if(fodInfos->ofnInfos->Flags & OFN_PATHMUSTEXIST) 1348 { 1349 FILEDLG95_OnOpenMessage(hwnd, 0, IDS_PATHNOTEXISTING); 1350 break; 1351 } 1352 } 1353 else 1354 { 1355 if(fodInfos->ofnInfos->Flags & OFN_FILEMUSTEXIST) 1356 { 1357 FILEDLG95_OnOpenMessage(hwnd, 0, IDS_FILENOTEXISTING); 1358 break; 1359 } 1360 } 1361 /* change to the current folder */ 1362 nOpenAction = ONOPEN_OPEN; 1363 break; 1217 1364 } 1218 1365 else 1219 1366 { 1220 memcpy( lpstrFile, lpstrTempFileList, sizeof(CHAR) * strlen(lpstrTempFileList)); 1367 /* the path component is valid */ 1368 TRACE("parse OK attr=0x%08lx pidl=%p\n", dwAttributes, pidl); 1369 if(dwAttributes & SFGAO_FOLDER) 1370 { 1371 if(FAILED(IShellFolder_BindToObject(lpsf, pidl, 0, &IID_IShellFolder, (LPVOID*)&lpsfChild))) 1372 { 1373 ERR("bind to failed\n"); /* should not fail */ 1374 break; 1375 } 1376 IShellFolder_Release(lpsf); 1377 lpsf = lpsfChild; 1378 lpsfChild = NULL; 1379 } 1380 else 1381 { 1382 TRACE("value\n"); 1383 1384 /* end dialog, return value */ 1385 nOpenAction = ONOPEN_OPEN; 1386 break; 1387 } 1388 COMDLG32_SHFree(pidl); 1389 pidl = NULL; 1221 1390 } 1222 1223 fodInfos->ofnInfos->nFileOffset = sizePath + 1; 1224 fodInfos->ofnInfos->nFileExtension = 0; 1225 1226 /* clean and exit */ 1227 return EndDialog(hwnd,TRUE); 1228 } 1229 1230 /*********************************************************************** 1231 * FILEDLG95_OnOpen 1232 * 1233 * Ok button WM_COMMAND message handler 1234 * 1235 * If the function succeeds, the return value is nonzero. 1236 */ 1237 BOOL FILEDLG95_OnOpen(HWND hwnd) 1238 { 1239 CHAR lpstrSpecifiedByUser[MAX_PATH] = ""; 1240 CHAR lpstrFileList[MAX_PATH] = ""; 1241 LPSTR lpstrFile; 1242 UINT nStrCharCount = 0; 1243 UINT nFileCount = 0; 1244 UINT nFileIndex = 0; 1245 UINT sizeUsed = 0; 1246 UINT nStrLen = 0; 1247 1248 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); 1249 1250 TRACE("\n"); 1251 1252 /* If a folder is selected browse folder */ 1253 if (BrowseSelectedFolder(hwnd)) 1254 return FALSE; 1255 1256 lpstrFile = fodInfos->ofnInfos->lpstrFile; 1257 1258 GetDlgItemTextA(hwnd, IDC_FILENAME, lpstrSpecifiedByUser, MAX_PATH); 1259 nStrLen = strlen(lpstrSpecifiedByUser); 1260 1261 while ( nStrCharCount <= nStrLen ) 1262 { 1263 if ( lpstrSpecifiedByUser[nStrCharCount]=='"' ) 1264 { 1265 nStrCharCount++; 1266 1267 while ((lpstrSpecifiedByUser[nStrCharCount]!='"') && 1268 (nStrCharCount <= nStrLen)) 1269 { 1270 lpstrFileList[nFileIndex++] = lpstrSpecifiedByUser[nStrCharCount]; 1271 nStrCharCount++; 1272 sizeUsed++; 1273 } 1274 lpstrFileList[nFileIndex++] = '\0'; 1275 sizeUsed++; 1276 nFileCount++; 1277 } 1278 nStrCharCount++; 1279 } 1280 1281 if(nFileCount > 0) 1282 return FILEDLG95_OnOpenMultipleFiles(hwnd, lpstrFileList, nFileCount, sizeUsed); 1283 1284 if (nStrLen) 1285 { 1286 LPSHELLFOLDER psfDesktop; 1287 LPITEMIDLIST browsePidl; 1288 LPSTR lpstrFileSpec; 1289 LPSTR lpstrTemp; 1290 char lpstrPathSpec[MAX_PATH] = ""; 1291 char lpstrCurrentDir[MAX_PATH] = ""; 1292 char lpstrPathAndFile[MAX_PATH] = ""; 1293 1294 /* Separate the file spec from the path spec 1295 e.g.: 1296 lpstrSpecifiedByUser lpstrPathSpec lpstrFileSpec 1297 C:\TEXT1\TEXT2 C:\TEXT1 TEXT2 1298 */ 1299 if (nFileCount == 0) 1300 { 1301 lpstrFileSpec = (LPSTR)COMDLG32_PathFindFilenameA(lpstrSpecifiedByUser); 1302 strcpy(lpstrPathSpec,lpstrSpecifiedByUser); 1303 COMDLG32_PathRemoveFileSpecA(lpstrPathSpec); 1304 } 1305 1306 /* Get the index of the selected item in the filetype combo box */ 1307 fodInfos->ofnInfos->nFilterIndex = (DWORD) CBGetCurSel(fodInfos->DlgInfos.hwndFileTypeCB); 1308 /* nFilterIndex is 1 based while combo GetCurSel return zero based index */ 1309 fodInfos->ofnInfos->nFilterIndex++; 1310 1311 /* Get the current directory name */ 1312 COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent, 1313 lpstrCurrentDir); 1314 1315 /* Create an absolute path name */ 1316 if(lpstrSpecifiedByUser[1] != ':') 1317 { 1318 switch(lpstrSpecifiedByUser[0]) 1319 { 1320 /* Add drive spec \TEXT => C:\TEXT */ 1321 case '\\': 1322 { 1323 INT iCopy = 2; 1324 char lpstrTmp[MAX_PATH] = ""; 1325 if(!strlen(lpstrPathSpec)) 1326 iCopy = 3; 1327 strncpy(lpstrTmp,lpstrCurrentDir,iCopy); 1328 strcat(lpstrTmp,lpstrPathSpec); 1329 strcpy(lpstrPathSpec,lpstrTmp); 1330 } 1331 break; 1332 /* Go to parent ..\TEXT */ 1333 case '.': 1334 { 1335 INT iSize; 1336 char lpstrTmp2[MAX_PATH] = ""; 1337 LPSTR lpstrTmp = strrchr(lpstrCurrentDir,'\\'); 1338 iSize = lpstrTmp - lpstrCurrentDir; 1339 strncpy(lpstrTmp2,lpstrCurrentDir,iSize + 1); 1340 if(strlen(lpstrSpecifiedByUser) <= 3) 1341 strcpy(lpstrFileSpec,""); 1342 if(strcmp(lpstrPathSpec,"..")) 1343 strcat(lpstrTmp2,&lpstrPathSpec[3]); 1344 strcpy(lpstrPathSpec,lpstrTmp2); 1345 } 1346 break; 1347 default: 1348 { 1349 char lpstrTmp[MAX_PATH] = ""; 1350 if(strcmp(&lpstrCurrentDir[strlen(lpstrCurrentDir)-1],"\\")) 1351 strcat(lpstrCurrentDir,"\\"); 1352 strcpy(lpstrTmp,lpstrCurrentDir); 1353 strcat(lpstrTmp,lpstrPathSpec); 1354 strcpy(lpstrPathSpec,lpstrTmp); 1355 } 1356 1357 } /* end switch */ 1358 } 1359 1360 if(strlen(lpstrPathSpec)) 1361 { 1362 /* Browse to the right directory */ 1363 COMDLG32_SHGetDesktopFolder(&psfDesktop); 1364 browsePidl = GetPidlFromName(psfDesktop,lpstrPathSpec); 1365 if(browsePidl) 1366 { 1367 /* Browse to directory */ 1368 IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser, 1369 browsePidl, 1370 SBSP_ABSOLUTE); 1371 COMDLG32_SHFree(browsePidl); 1372 } 1373 else 1374 { 1375 /* Path does not exist */ 1376 if(fodInfos->ofnInfos->Flags & OFN_PATHMUSTEXIST) 1377 { 1378 MessageBoxA(hwnd, 1379 "Path does not exist", 1380 fodInfos->ofnInfos->lpstrTitle, 1381 MB_OK | MB_ICONEXCLAMATION); 1382 return FALSE; 1383 } 1384 } 1385 1386 strcat(lpstrPathAndFile,lpstrPathSpec); 1387 IShellFolder_Release(psfDesktop); 1388 } 1389 else 1390 { 1391 strcat(lpstrPathAndFile,lpstrCurrentDir); 1392 } 1393 1394 /* Create the path and file string */ 1395 COMDLG32_PathAddBackslashA(lpstrPathAndFile); 1396 strcat(lpstrPathAndFile,lpstrFileSpec); 1397 1398 /* Update the edit field */ 1399 SetDlgItemTextA(hwnd,IDC_FILENAME,lpstrFileSpec); 1400 SendDlgItemMessageA(hwnd,IDC_FILENAME,EM_SETSEL,0,-1); 1401 1402 /* Don't go further if we dont have a file spec */ 1403 if(!strlen(lpstrFileSpec) || !strcmp(lpstrFileSpec,lpstrPathSpec)) 1404 return FALSE; 1405 1406 /* Time to check lpstrFileSpec */ 1407 /* search => contains * or ? */ 1408 /* browse => contains a directory name */ 1409 /* file => contains a file name */ 1410 1411 /* Check if this is a search */ 1412 if(strchr(lpstrFileSpec,'*') || strchr(lpstrFileSpec,'?')) 1391 } 1392 if(pidl) COMDLG32_SHFree(pidl); 1393 } 1394 1395 /* path is valid, clean the edit box */ 1396 SetDlgItemTextA(hwnd,IDC_FILENAME,""); 1397 1398 /* 1399 Step 3: here we have a cleaned up and validated path 1400 1401 valid variables: 1402 lpsf: ShellFolder bound to the rightmost valid path component 1403 lpstrPathAndFile: cleaned up path 1404 nOpenAction: action to do 1405 */ 1406 TRACE("end validate sf=%p\n", lpsf); 1407 1408 switch(nOpenAction) 1409 { 1410 case ONOPEN_SEARCH: /* set the current filter to the file mask and refresh */ 1411 TRACE("ONOPEN_SEARCH %s\n", lpstrPathAndFile); 1413 1412 { 1414 1413 int iPos; 1415 1416 /* Set the current filter with the current selection */ 1414 LPSTR lpszTemp = COMDLG32_PathFindFileNameA(lpstrPathAndFile); 1415 1416 /* replace the current filter */ 1417 1417 if(fodInfos->ShellInfos.lpstrCurrentFilter) 1418 MemFree((LPVOID)fodInfos->ShellInfos.lpstrCurrentFilter); 1419 1420 fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc((strlen(lpstrFileSpec)+1)*2); 1421 lstrcpyAtoW(fodInfos->ShellInfos.lpstrCurrentFilter, 1422 (LPSTR)strlwr((LPSTR)lpstrFileSpec)); 1423 1424 IShellView_Refresh(fodInfos->Shell.FOIShellView); 1425 1426 if(-1 < (iPos = FILEDLG95_FILETYPE_SearchExt(fodInfos->DlgInfos.hwndFileTypeCB, 1427 lpstrFileSpec))) 1428 CBSetCurSel(fodInfos->DlgInfos.hwndFileTypeCB,iPos); 1429 1430 return FALSE; 1418 MemFree((LPVOID)fodInfos->ShellInfos.lpstrCurrentFilter); 1419 fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc((strlen(lpszTemp)+1)*sizeof(WCHAR)); 1420 lstrcpyAtoW(fodInfos->ShellInfos.lpstrCurrentFilter, lpszTemp); 1421 1422 /* set the filter cb to the extension when possible */ 1423 if(-1 < (iPos = FILEDLG95_FILETYPE_SearchExt(fodInfos->DlgInfos.hwndFileTypeCB, lpszTemp))) 1424 CBSetCurSel(fodInfos->DlgInfos.hwndFileTypeCB, iPos); 1431 1425 } 1432 1426 /* fall through */ 1427 case ONOPEN_BROWSE: /* browse to the highest folder we could bind to */ 1428 TRACE("ONOPEN_BROWSE\n"); 1433 1429 { 1434 HANDLE hFile; 1435 WIN32_FIND_DATAA stffile; 1436 1437 /* browse if the user specified a directory */ 1438 hFile = FindFirstFileA(lpstrPathAndFile,&stffile); 1439 if ( hFile != INVALID_HANDLE_VALUE ) 1430 IPersistFolder2 * ppf2; 1431 if(SUCCEEDED(IShellFolder_QueryInterface( lpsf, &IID_IPersistFolder2, (LPVOID*)&ppf2))) 1440 1432 { 1441 FindClose (hFile); 1442 if (stffile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) 1443 browsePidl = GetPidlFromName(fodInfos->Shell.FOIShellFolder, 1444 lpstrFileSpec); 1445 else 1446 { 1447 // if there is an extention, then get the Pidl otherwise 1448 // we are going to need to add the extention 1449 if(strrchr(lpstrFileSpec,'.')) 1450 browsePidl = GetPidlFromName(fodInfos->Shell.FOIShellFolder, 1451 lpstrFileSpec); 1452 else 1453 browsePidl=NULL; 1454 } 1455 } 1456 else 1457 browsePidl=NULL; 1458 } 1459 1460 if (!browsePidl) /* not a directory check the specified file exists */ 1461 { 1462 int i; 1463 int iExt; 1464 char lpstrFileSpecTemp[MAX_PATH] = ""; 1465 LPSTR lpstrExt; 1466 LPSTR lpOrg; 1467 LPSTR lpBuf; 1468 1469 iExt = CBGetCurSel(fodInfos->DlgInfos.hwndFileTypeCB); 1470 lpOrg = (LPSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, iExt); 1471 if (lpOrg == (LPSTR)-1) 1472 lpOrg = NULL; // we get -1 if the filetype LB is empty 1473 1474 lpstrExt = lpOrg; 1475 1476 /* 1477 Simply take the first one of the list as default. 1478 Otherwise the user must specify which extention they want. 1479 Also, make sure we don't have a .*, in this case simply 1480 forget about the extention 1481 */ 1482 lpstrExt = strchr(lpOrg, ';'); 1483 if (lpstrExt) 1484 { 1485 i = lpstrExt - lpOrg; 1486 } 1487 else 1488 i = strlen(lpOrg); 1489 lpBuf = MemAlloc(i+1); 1490 strncpy(lpBuf, lpOrg, i); 1491 lpBuf[i] = 0; 1492 strcpy(lpstrFileSpecTemp, lpstrFileSpec); 1493 1494 if (lpstrFileSpecTemp[strlen(lpstrFileSpecTemp)-1] == '.') 1495 { 1496 if (strchr(lpBuf, '.')) 1497 strcat(lpstrFileSpecTemp, (strchr(lpBuf, '.')) + 1); 1498 } 1499 else 1500 strcat(lpstrFileSpecTemp, strchr(lpBuf, '.')); 1501 1502 browsePidl = GetPidlFromName(fodInfos->Shell.FOIShellFolder, 1503 lpstrFileSpecTemp); 1504 MemFree((void *)lpBuf); 1505 if (browsePidl) 1506 strcpy(lpstrFileSpec,lpstrFileSpecTemp); 1507 if (lpstrExt) 1508 lpOrg = lpstrExt+1; 1509 else 1510 lpOrg = NULL; 1511 } 1512 1513 if (browsePidl) 1514 { 1515 ULONG ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER; 1516 int nMsgBoxRet; 1517 char lpstrFileExist[MAX_PATH + 50]; 1518 1519 IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1520 1, 1521 &browsePidl, 1522 &ulAttr); 1523 1524 /* Browse to directory if it is a folder */ 1525 if (ulAttr & SFGAO_FOLDER) 1526 { 1527 if(FAILED(IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser, 1528 browsePidl, 1529 SBSP_RELATIVE))) 1530 { 1531 if(fodInfos->ofnInfos->Flags & OFN_PATHMUSTEXIST) 1532 { 1533 MessageBoxA(hwnd, 1534 "Path does not exist", 1535 fodInfos->ofnInfos->lpstrTitle, 1536 MB_OK | MB_ICONEXCLAMATION); 1537 COMDLG32_SHFree(browsePidl); 1538 return FALSE; 1539 } 1540 } 1541 COMDLG32_SHFree(browsePidl); 1542 return FALSE; 1543 } 1544 1545 /* The file does exist, so ask the user if we should overwrite it */ 1546 if((fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) && 1547 (fodInfos->ofnInfos->Flags & OFN_OVERWRITEPROMPT)) 1548 { 1549 strcpy(lpstrFileExist, lpstrFileSpec); 1550 strcat(lpstrFileExist, " already exists.\nDo you want to replace it?"); 1551 1552 nMsgBoxRet = MessageBoxA(hwnd, 1553 lpstrFileExist, 1554 fodInfos->ofnInfos->lpstrTitle, 1555 MB_YESNO | MB_ICONEXCLAMATION); 1556 if (nMsgBoxRet == IDNO) 1557 { 1558 COMDLG32_SHFree(browsePidl); 1559 return FALSE; 1560 } 1561 } 1562 COMDLG32_SHFree(browsePidl); 1563 } 1564 else 1565 { 1566 /* File does not exist in current directory */ 1567 1568 /* The selected file does not exist */ 1569 /* Tell the user the selected does not exist */ 1570 if(fodInfos->ofnInfos->Flags & OFN_FILEMUSTEXIST) 1571 { 1572 char lpstrNotFound[100]; 1573 char lpstrMsg[100]; 1574 char tmp[400]; 1575 1576 LoadStringA(COMMDLG_hInstance32, 1577 IDS_FILENOTFOUND, 1578 lpstrNotFound, 1579 100); 1580 LoadStringA(COMMDLG_hInstance32, 1581 IDS_VERIFYFILE, 1582 lpstrMsg, 1583 100); 1584 1585 strcpy(tmp,fodInfos->ofnInfos->lpstrFile); 1586 strcat(tmp,"\n"); 1587 strcat(tmp,lpstrNotFound); 1588 strcat(tmp,"\n"); 1589 strcat(tmp,lpstrMsg); 1590 1591 MessageBoxA(hwnd, 1592 tmp, 1593 fodInfos->ofnInfos->lpstrTitle, 1594 MB_OK | MB_ICONEXCLAMATION); 1595 return FALSE; 1596 } 1597 /* Ask the user if he wants to create the file*/ 1598 if(fodInfos->ofnInfos->Flags & OFN_CREATEPROMPT) 1599 { 1600 char tmp[100]; 1601 1602 LoadStringA(COMMDLG_hInstance32,IDS_CREATEFILE,tmp,100); 1603 1604 if(IDYES == MessageBoxA(hwnd,tmp,fodInfos->ofnInfos->lpstrTitle, 1605 MB_YESNO | MB_ICONQUESTION)) 1606 { 1607 /* Create the file, clean and exit */ 1608 return EndDialog(hwnd,TRUE); 1609 } 1610 return FALSE; 1433 LPITEMIDLIST pidlCurrent; 1434 IPersistFolder2_GetCurFolder(ppf2, &pidlCurrent); 1435 IPersistFolder2_Release(ppf2); 1436 if( ! COMDLG32_PIDL_ILIsEqual(pidlCurrent, fodInfos->ShellInfos.pidlAbsCurrent)) 1437 { 1438 IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser, pidlCurrent, SBSP_ABSOLUTE); 1439 } 1440 else if( nOpenAction == ONOPEN_SEARCH ) 1441 { 1442 IShellView_Refresh(fodInfos->Shell.FOIShellView); 1443 } 1444 COMDLG32_SHFree(pidlCurrent); 1611 1445 } 1612 1446 } 1613 /* check the write access to the current directory before opening the selected file */ 1614 if((fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) && (fodInfos->ofnInfos->Flags & OFN_PATHMUSTEXIST)) 1447 ret = FALSE; 1448 break; 1449 case ONOPEN_OPEN: /* fill in the return struct and close the dialog */ 1450 TRACE("ONOPEN_OPEN %s\n", lpstrPathAndFile); 1615 1451 { 1616 HANDLE hfile; 1617 char testFile[MAX_PATH]; 1618 //CB: I don't like this, what if this file already exists? 1619 strcpy(testFile,lpstrPathSpec); 1620 strcat(testFile,"_tes_13.579"); 1621 1622 hfile = CreateFileA(testFile,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,0); 1623 1624 switch(GetLastError()) 1625 { 1626 case ERROR_ACCESS_DENIED: 1627 case ERROR_WRITE_PROTECT: 1628 case ERROR_PATH_NOT_FOUND: 1629 case ERROR_FILE_NOT_FOUND: 1630 { 1631 char strAccessDenied[MAX_PATH + 100]; 1632 strcpy(strAccessDenied,lpstrPathSpec); 1633 strcat(strAccessDenied,lpstrFileSpec); 1634 strcat(strAccessDenied,"\nWrite access denied for this file !"); 1635 MessageBoxA(hwnd,strAccessDenied,fodInfos->ofnInfos->lpstrTitle,MB_OK | MB_ICONEXCLAMATION); 1636 return FALSE; 1637 } 1638 } 1639 1640 if (hfile != INVALID_HANDLE_VALUE) 1641 { 1642 CloseHandle(hfile); 1643 DeleteFileA(testFile); 1644 } 1645 1452 /* add default extension */ 1453 if (fodInfos->ofnInfos->lpstrDefExt) 1454 { 1455 if (! *COMDLG32_PathFindExtensionA(lpstrPathAndFile)) 1456 { 1457 strcat(lpstrPathAndFile, "."); 1458 strcat(lpstrPathAndFile, fodInfos->ofnInfos->lpstrDefExt); 1459 } 1460 } 1461 1462 /* Check that size size of the file does not exceed buffer size */ 1463 if(strlen(lpstrPathAndFile) < fodInfos->ofnInfos->nMaxFile) 1464 { 1465 LPSTR lpszTemp; 1466 1467 /* fill destination buffer */ 1468 strcpy(fodInfos->ofnInfos->lpstrFile, lpstrPathAndFile); 1469 1470 /* set filename offset */ 1471 lpszTemp = COMDLG32_PathFindFileNameA(lpstrPathAndFile); 1472 fodInfos->ofnInfos->nFileOffset = lpszTemp - lpstrPathAndFile; 1473 1474 /* set extension offset */ 1475 lpszTemp = COMDLG32_PathFindExtensionA(lpstrPathAndFile); 1476 fodInfos->ofnInfos->nFileExtension = (*lpszTemp) ? lpszTemp - lpstrPathAndFile + 1 : 0; 1477 1478 /* set the lpstrFileTitle */ 1479 if(fodInfos->ofnInfos->lpstrFileTitle) 1480 { 1481 LPSTR lpstrFileTitle = COMDLG32_PathFindFileNameA(lpstrPathAndFile); 1482 strncpy(fodInfos->ofnInfos->lpstrFileTitle, lpstrFileTitle, fodInfos->ofnInfos->nMaxFileTitle); 1483 } 1484 1485 FILEDLG95_Clean(hwnd); 1486 ret = EndDialog(hwnd, TRUE); 1487 } 1488 else 1489 { 1490 /* FIXME set error FNERR_BUFFERTOSMALL */ 1491 FILEDLG95_Clean(hwnd); 1492 ret = EndDialog(hwnd, FALSE); 1493 } 1494 goto ret; 1646 1495 } 1647 1648 /* Open the selected file */ 1649 1650 /* Check file extension */ 1651 if(!strrchr(lpstrPathAndFile,'.')) 1652 { 1653 /* if the file has no extension, append the selected 1654 extension of the filetype combo box */ 1655 int iExt; 1656 LPSTR lpstrExt; 1657 iExt = CBGetCurSel(fodInfos->DlgInfos.hwndFileTypeCB); 1658 lpstrTemp = (LPSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB,iExt); 1659 1660 if((LPSTR)-1 != lpstrTemp) 1661 { 1662 lpstrExt = strchr(lpstrTemp,';'); 1663 if(lpstrExt) 1664 { 1665 int i = lpstrExt - lpstrTemp; 1666 lpstrExt = MemAlloc(i); 1667 strncpy(lpstrExt,&lpstrTemp[1],i-1); 1668 } 1669 else 1670 { 1671 lpstrExt = MemAlloc(strlen(lpstrTemp)); 1672 strcpy(lpstrExt,&lpstrTemp[1]); 1673 } 1674 1675 if(strcmp(lpstrExt,".*") != 0) 1676 { 1677 /* OPEN DIALOG: Let's see if the file exists with the current extention, 1678 if not return the file without the extention. 1679 SAVE DIALOG: Concatenate the extention to the file. 1680 */ 1681 1682 if (!(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG)) 1683 { 1684 LPSTR lpstrFindFile; 1685 WIN32_FIND_DATAA fd; 1686 HANDLE hFind; 1687 1688 lpstrFindFile = MemAlloc(strlen(lpstrPathAndFile)+strlen(lpstrExt)); 1689 strcpy(lpstrFindFile, lpstrPathAndFile); 1690 strcat(lpstrFindFile, lpstrExt); 1691 hFind = FindFirstFileA(lpstrFindFile,&fd); 1692 if(hFind != INVALID_HANDLE_VALUE) 1693 { 1694 strcat(lpstrPathAndFile,lpstrExt); 1695 FindClose(hFind); 1696 } 1697 MemFree(lpstrFindFile); 1698 } 1699 else 1700 strcat(lpstrPathAndFile,lpstrExt); 1701 } 1702 MemFree( lpstrExt ); 1703 } 1704 } 1705 /* Check that size size of the file does not exceed buffer size */ 1706 if(strlen(lpstrPathAndFile) > fodInfos->ofnInfos->nMaxFile) 1707 { 1708 /* set error FNERR_BUFFERTOSMALL */ 1709 return EndDialog(hwnd,FALSE); 1710 } 1711 strcpy(fodInfos->ofnInfos->lpstrFile,lpstrPathAndFile); 1712 fodInfos->ofnInfos->lpstrFile[strlen(lpstrPathAndFile)] = '\0'; 1713 fodInfos->ofnInfos->lpstrFile[strlen(lpstrPathAndFile)+1] = '\0'; 1714 1715 /* Set the lpstrFileTitle of the OPENFILENAME structure */ 1716 if(fodInfos->ofnInfos->lpstrFileTitle) 1717 strncpy(fodInfos->ofnInfos->lpstrFileTitle, 1718 lpstrFileSpec, 1719 fodInfos->ofnInfos->nMaxFileTitle); 1720 1721 /* Check if the file is to be opened as read only */ 1722 if(BST_CHECKED == SendDlgItemMessageA(hwnd, 1723 IDC_OPENREADONLY, 1724 BM_GETSTATE,0,0)) 1725 SetFileAttributesA(fodInfos->ofnInfos->lpstrFile, 1726 FILE_ATTRIBUTE_READONLY); 1727 1728 /* nFileExtension and nFileOffset of OPENFILENAME structure */ 1729 lpstrTemp = strrchr(fodInfos->ofnInfos->lpstrFile,'\\'); 1730 fodInfos->ofnInfos->nFileOffset = lpstrTemp - fodInfos->ofnInfos->lpstrFile + 1; 1731 lpstrTemp = strrchr(fodInfos->ofnInfos->lpstrFile,'.'); 1732 fodInfos->ofnInfos->nFileExtension = lpstrTemp - fodInfos->ofnInfos->lpstrFile + 1; 1733 1734 1735 /* clean and exit */ 1736 return EndDialog(hwnd,TRUE); 1737 } 1738 1739 return FALSE; 1496 break; 1497 } 1498 1499 ret: 1500 if(lpsf) IShellFolder_Release(lpsf); 1501 return ret; 1740 1502 } 1741 1503 … … 1752 1514 1753 1515 /* 1754 * Initialisation of the FileOpenDialogInfos structure 1516 * Initialisation of the FileOpenDialogInfos structure 1755 1517 */ 1756 1518 1757 1519 /* Shell */ 1758 1759 fodInfos->Shell.FOIShellView = NULL;1760 if(FAILED(COMDLG32_SHGetDesktopFolder(&fodInfos->Shell.FOIShellFolder)))1761 return E_FAIL;1762 1520 1763 1521 /*ShellInfos */ 1764 1522 fodInfos->ShellInfos.hwndOwner = hwnd; 1765 1523 1766 fodInfos->ShellInfos.folderSettings.fFlags = 0;1767 1524 /* Disable multi-select if flag not set */ 1768 1525 if (!(fodInfos->ofnInfos->Flags & OFN_ALLOWMULTISELECT)) 1769 1526 { 1770 fodInfos->ShellInfos.folderSettings.fFlags |= FWF_SINGLESEL; 1527 fodInfos->ShellInfos.folderSettings.fFlags |= FWF_SINGLESEL; 1771 1528 } 1772 1529 fodInfos->ShellInfos.folderSettings.fFlags |= FWF_AUTOARRANGE | FWF_ALIGNLEFT; … … 1778 1535 1779 1536 /* Construct the IShellBrowser interface */ 1780 fodInfos->Shell.FOIShellBrowser = IShellBrowserImpl_Construct(hwnd); 1781 1537 fodInfos->Shell.FOIShellBrowser = IShellBrowserImpl_Construct(hwnd); 1538 1782 1539 return NOERROR; 1783 1540 } … … 1794 1551 1795 1552 IContextMenu * pcm; 1796 CMINVOKECOMMANDINFO ci; 1797 TRACE("\n"); 1553 TRACE("(0x%08x,%p)\n", hwnd, lpVerb); 1798 1554 1799 1555 if(SUCCEEDED(IShellView_GetItemObject(fodInfos->Shell.FOIShellView, 1800 SVGIO_BACKGROUND, 1801 &IID_IContextMenu, 1802 (LPVOID*)&pcm))) 1803 { 1556 SVGIO_BACKGROUND, 1557 &IID_IContextMenu, 1558 (LPVOID*)&pcm))) 1559 { 1560 CMINVOKECOMMANDINFO ci; 1561 ZeroMemory(&ci, sizeof(CMINVOKECOMMANDINFO)); 1804 1562 ci.cbSize = sizeof(CMINVOKECOMMANDINFO); 1805 1563 ci.lpVerb = lpVerb; … … 1835 1593 1836 1594 /*********************************************************************** 1837 * FILEDLG95_SHELL_ NewFolder1838 * 1839 * Creates a new directory with New folder as name1595 * FILEDLG95_SHELL_BrowseToDesktop 1596 * 1597 * Browse to the Desktop 1840 1598 * If the function succeeds, the return value is nonzero. 1841 * FIXME: let the contextmenu (CMDSTR_NEWFOLDER) do this thing 1842 */ 1843 static BOOL FILEDLG95_SHELL_NewFolder(HWND hwnd) 1844 { 1845 char lpstrDirName[MAX_PATH] = "New Folder"; 1846 char lpstrNewDir[MAX_PATH]; 1847 BOOL bRes = FALSE; 1848 HANDLE hHandle; 1849 WIN32_FIND_DATAA FindData; 1599 */ 1600 static BOOL FILEDLG95_SHELL_BrowseToDesktop(HWND hwnd) 1601 { 1850 1602 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); 1851 1603 LPITEMIDLIST pidl; 1604 HRESULT hres; 1605 1852 1606 TRACE("\n"); 1853 1607 1854 /* Create the absolute path for "New Folder" */ 1855 COMDLG32_SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent, lpstrNewDir); 1856 COMDLG32_PathAddBackslashA(lpstrNewDir); 1857 strcat(lpstrNewDir, lpstrDirName); 1858 1859 /* Find a Unique directory name */ 1860 hHandle = FindFirstFileA(lpstrNewDir,&FindData); 1861 if(hHandle != INVALID_HANDLE_VALUE) 1862 { 1863 int i; 1864 char lpstrDupNewDir[MAX_PATH]; 1865 char lpstrDirNameExt[8]; 1866 strcpy(lpstrDupNewDir, lpstrNewDir); 1867 for(i=0; i < 256 && hHandle != INVALID_HANDLE_VALUE; i++) 1868 { 1869 FindClose(hHandle); 1870 sprintf(lpstrNewDir,"%s (%d)", lpstrDupNewDir, i+1); 1871 hHandle = FindFirstFileA(lpstrNewDir,&FindData); 1872 } 1873 sprintf(lpstrDirNameExt," (%d)", i); 1874 strcat(lpstrDirName, lpstrDirNameExt); 1875 } 1876 /* Is Unique Found */ 1877 if(hHandle == INVALID_HANDLE_VALUE) 1878 { 1879 bRes = CreateDirectoryA(lpstrNewDir,NULL); 1880 1881 if(bRes) 1882 { 1883 LPITEMIDLIST pidl; 1884 /* Refresh the list (this will update the pidl, to include the new directory) */ 1885 /* Might want to only update the list (so the directory appears at the end */ 1886 IShellView_Refresh(fodInfos->Shell.FOIShellView); 1887 pidl = GetPidlFromName(fodInfos->Shell.FOIShellFolder,lpstrDirName); 1888 1889 IShellView_SelectItem(fodInfos->Shell.FOIShellView, 1890 pidl,(SVSI_DESELECTOTHERS | SVSI_EDIT | SVSI_ENSUREVISIBLE 1891 |SVSI_FOCUSED|SVSI_SELECT)); 1892 1893 COMDLG32_SHFree(pidl); 1894 } 1895 else 1896 { 1897 char lpstrText[128+MAX_PATH]; 1898 char lpstrTempText[128]; 1899 char lpstrCaption[32]; 1900 1901 /* Cannot Create folder because of permissions */ 1902 LoadStringA(COMMDLG_hInstance32, IDS_CREATEFOLDER_DENIED, lpstrTempText, sizeof(lpstrTempText)); 1903 LoadStringA(COMMDLG_hInstance32, IDS_FILEOPEN_CAPTION, lpstrCaption, sizeof(lpstrCaption)); 1904 sprintf(lpstrText,lpstrTempText, lpstrDirName); 1905 MessageBoxA(hwnd,lpstrText, lpstrCaption, MB_OK | MB_ICONEXCLAMATION); 1906 } 1907 } else FindClose(hHandle); 1908 return bRes; 1909 } 1910 1608 COMDLG32_SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidl); 1609 hres = IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser, pidl, SBSP_ABSOLUTE); 1610 COMDLG32_SHFree(pidl); 1611 return SUCCEEDED(hres); 1612 } 1911 1613 /*********************************************************************** 1912 1614 * FILEDLG95_SHELL_Clean … … 1919 1621 1920 1622 TRACE("\n"); 1623 1624 COMDLG32_SHFree(fodInfos->ShellInfos.pidlAbsCurrent); 1921 1625 1922 1626 /* clean Shell interfaces */ … … 1925 1629 IShellFolder_Release(fodInfos->Shell.FOIShellFolder); 1926 1630 IShellBrowser_Release(fodInfos->Shell.FOIShellBrowser); 1631 if (fodInfos->Shell.FOIDataObject) 1632 IDataObject_Release(fodInfos->Shell.FOIDataObject); 1927 1633 } 1928 1634 … … 1930 1636 * FILEDLG95_FILETYPE_Init 1931 1637 * 1932 * Initialisation of the file type combo box 1638 * Initialisation of the file type combo box 1933 1639 */ 1934 1640 static HRESULT FILEDLG95_FILETYPE_Init(HWND hwnd) … … 1940 1646 if(fodInfos->ofnInfos->lpstrFilter) 1941 1647 { 1942 int iStrIndex = 0; 1943 int iPos = 0; 1648 int nFilters = 0; /* number of filters */ 1944 1649 LPSTR lpstrFilter; 1945 LP STR lpstrTmp;1650 LPCSTR lpstrPos = fodInfos->ofnInfos->lpstrFilter; 1946 1651 1947 1652 for(;;) 1948 1653 { 1949 /* filter is a list... title\0ext\0......\0\0 1654 /* filter is a list... title\0ext\0......\0\0 1950 1655 * Set the combo item text to the title and the item data 1951 1656 * to the ext 1952 1657 */ 1953 char *lpstrExt = NULL;1954 LPSTR lpstrExt Tmp = NULL;1658 LPCSTR lpstrDisplay; 1659 LPSTR lpstrExt; 1955 1660 1956 1661 /* Get the title */ 1957 lpstrTmp = (&((LPBYTE)fodInfos->ofnInfos->lpstrFilter)[iStrIndex]); 1958 if(!strlen(lpstrTmp)) 1959 break; 1960 iStrIndex += strlen(lpstrTmp) +1; 1961 /* Get the extension */ 1962 lpstrExtTmp = (&((LPBYTE)fodInfos->ofnInfos->lpstrFilter)[iStrIndex]); 1963 if(!lpstrExtTmp) 1964 break; 1965 1966 lpstrExt = (LPSTR) MemAlloc(strlen(lpstrExtTmp)+1); 1967 if(!lpstrExt) 1968 break; 1969 1970 strcpy(lpstrExt,lpstrExtTmp); 1971 1972 iStrIndex += strlen(lpstrExt) +1; 1973 1662 if(! *lpstrPos) break; /* end */ 1663 lpstrDisplay = lpstrPos; 1664 lpstrPos += strlen(lpstrPos) + 1; 1665 1666 /* Copy the extensions */ 1667 if (! *lpstrPos) return E_FAIL; /* malformed filter */ 1668 if (!(lpstrExt = (LPSTR) MemAlloc(strlen(lpstrPos)+1))) return E_FAIL; 1669 strcpy(lpstrExt,lpstrPos); 1670 lpstrPos += strlen(lpstrPos) + 1; 1671 1974 1672 /* Add the item at the end of the combo */ 1975 CBAddString(fodInfos->DlgInfos.hwndFileTypeCB,lpstrTmp); 1976 CBSetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB,iPos++,lpstrExt); 1977 } 1978 /* Set the current filter to the one specified 1979 * in the initialisation structure 1980 */ 1981 1982 /* set default filter index */ 1983 if(fodInfos->ofnInfos->nFilterIndex == 0 && fodInfos->ofnInfos->lpstrCustomFilter == NULL) 1984 fodInfos->ofnInfos->nFilterIndex = 1; 1985 /* First, check to make sure our index isn't out of bounds. */ 1986 if ( fodInfos->ofnInfos->nFilterIndex > iPos ) 1987 fodInfos->ofnInfos->nFilterIndex = iPos; 1988 1989 1990 /* Get the current index selection. */ 1991 CBSetCurSel(fodInfos->DlgInfos.hwndFileTypeCB, 1992 fodInfos->ofnInfos->nFilterIndex-1); 1993 1994 /* Get the corresponding text string from the combo box. */ 1995 lpstrFilter = (LPSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, 1673 CBAddString(fodInfos->DlgInfos.hwndFileTypeCB, lpstrDisplay); 1674 CBSetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, nFilters, lpstrExt); 1675 nFilters++; 1676 } 1677 /* 1678 * Set the current filter to the one specified 1679 * in the initialisation structure 1680 * FIXME: lpstrCustomFilter not handled at all 1681 */ 1682 1683 /* set default filter index */ 1684 if(fodInfos->ofnInfos->nFilterIndex == 0 && fodInfos->ofnInfos->lpstrCustomFilter == NULL) 1685 fodInfos->ofnInfos->nFilterIndex = 1; 1686 1687 /* First, check to make sure our index isn't out of bounds. */ 1688 if ( fodInfos->ofnInfos->nFilterIndex > nFilters ) 1689 fodInfos->ofnInfos->nFilterIndex = nFilters; 1690 1691 /* Set the current index selection. */ 1692 CBSetCurSel(fodInfos->DlgInfos.hwndFileTypeCB, fodInfos->ofnInfos->nFilterIndex-1); 1693 1694 /* Get the corresponding text string from the combo box. */ 1695 lpstrFilter = (LPSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB, 1996 1696 fodInfos->ofnInfos->nFilterIndex-1); 1997 1697 1998 if ((INT)lpstrFilter == -1)1999 lpstrFilter = NULL; // we get -1 if the control is empty1698 if ((INT)lpstrFilter == CB_ERR) /* control is empty */ 1699 lpstrFilter = NULL; 2000 1700 2001 1701 if(lpstrFilter) 2002 1702 { 2003 fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc((strlen(lpstrFilter)+1)*2); 2004 lstrcpyAtoW(fodInfos->ShellInfos.lpstrCurrentFilter,strlwr(lpstrFilter)); 1703 _strlwr(lpstrFilter); /* lowercase */ 1704 fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc((strlen(lpstrFilter)+1)*2); 1705 lstrcpyAtoW(fodInfos->ShellInfos.lpstrCurrentFilter, lpstrFilter); 2005 1706 } 2006 1707 } … … 2026 1727 /* Get the current item of the filetype combo box */ 2027 1728 int iItem = CBGetCurSel(fodInfos->DlgInfos.hwndFileTypeCB); 2028 2029 if (iItem+1 == fodInfos->ofnInfos->nFilterIndex) break;2030 1729 2031 1730 /* set the current filter index - indexed from 1 */ … … 2041 1740 { 2042 1741 fodInfos->ShellInfos.lpstrCurrentFilter = MemAlloc((strlen(lpstrFilter)+1)*2); 2043 lstrcpyAtoW(fodInfos->ShellInfos.lpstrCurrentFilter, (LPSTR)strlwr((LPSTR)lpstrFilter));1742 lstrcpyAtoW(fodInfos->ShellInfos.lpstrCurrentFilter,_strlwr(lpstrFilter)); 2044 1743 SendCustomDlgNotificationMessage(hwnd,CDN_TYPECHANGE); 2045 1744 } … … 2054 1753 * FILEDLG95_FILETYPE_SearchExt 2055 1754 * 2056 * Search for pidl in the lookin combo box 2057 * returns the index of the found item 2058 */ 2059 static int FILEDLG95_FILETYPE_SearchExt(HWND hwnd,LPSTR lpstrExt) 2060 { 2061 int i = 0; 2062 int iCount = CBGetCount(hwnd); 2063 2064 TRACE("\n"); 2065 2066 for(;i<iCount;i++) 2067 { 2068 LPSTR ext = (LPSTR) CBGetItemDataPtr(hwnd,i); 2069 2070 if(!strcasecmp(lpstrExt,ext)) 1755 * searches for a extension in the filetype box 1756 */ 1757 static int FILEDLG95_FILETYPE_SearchExt(HWND hwnd,LPCSTR lpstrExt) 1758 { 1759 int i, iCount = CBGetCount(hwnd); 1760 1761 TRACE("%s\n", lpstrExt); 1762 1763 if(iCount != CB_ERR) 1764 { 1765 for(i=0;i<iCount;i++) 1766 { 1767 if(!strcasecmp(lpstrExt,(LPSTR)CBGetItemDataPtr(hwnd,i))) 2071 1768 return i; 2072 }2073 1769 } 1770 } 2074 1771 return -1; 2075 1772 } … … 2089 1786 2090 1787 /* Delete each string of the combo and their associated data */ 2091 for(iPos = iCount-1;iPos>=0;iPos--) 2092 { 2093 MemFree((LPVOID)(CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB,iPos))); 2094 CBDeleteString(fodInfos->DlgInfos.hwndFileTypeCB,iPos); 1788 if(iCount != CB_ERR) 1789 { 1790 for(iPos = iCount-1;iPos>=0;iPos--) 1791 { 1792 MemFree((LPSTR) CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB,iPos)); 1793 CBDeleteString(fodInfos->DlgInfos.hwndFileTypeCB,iPos); 1794 } 2095 1795 } 2096 1796 /* Current filter */ 2097 1797 if(fodInfos->ShellInfos.lpstrCurrentFilter) 2098 MemFree( (LPVOID)fodInfos->ShellInfos.lpstrCurrentFilter);2099 2100 } 2101 1798 MemFree(fodInfos->ShellInfos.lpstrCurrentFilter); 1799 1800 } 1801 2102 1802 /*********************************************************************** 2103 1803 * FILEDLG95_LOOKIN_Init 2104 1804 * 2105 * Initialisation of the look in combo box 1805 * Initialisation of the look in combo box 2106 1806 */ 2107 1807 static HRESULT FILEDLG95_LOOKIN_Init(HWND hwndCombo) 2108 1808 { 2109 IShellFolder 2110 IEnumIDList 2111 LPITEMIDLIST 1809 IShellFolder *psfRoot, *psfDrives; 1810 IEnumIDList *lpeRoot, *lpeDrives; 1811 LPITEMIDLIST pidlDrives, pidlTmp, pidlTmp1, pidlAbsTmp; 2112 1812 2113 1813 LookInInfos *liInfos = MemAlloc(sizeof(LookInInfos)); … … 2120 1820 CBSetItemHeight(hwndCombo,0,GetSystemMetrics(SM_CYSMICON)); 2121 1821 2122 #ifndef SHELL_NO_DESKTOP2123 1822 /* Initialise data of Desktop folder */ 2124 1823 COMDLG32_SHGetSpecialFolderLocation(0,CSIDL_DESKTOP,&pidlTmp); 2125 1824 FILEDLG95_LOOKIN_AddItem(hwndCombo, pidlTmp,LISTEND); 2126 1825 COMDLG32_SHFree(pidlTmp); 2127 #endif2128 1826 2129 1827 COMDLG32_SHGetSpecialFolderLocation(0,CSIDL_DRIVES,&pidlDrives); … … 2138 1836 while (S_OK == IEnumIDList_Next(lpeRoot, 1, &pidlTmp, NULL)) 2139 1837 { 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 1838 FILEDLG95_LOOKIN_AddItem(hwndCombo, pidlTmp,LISTEND); 1839 1840 /* special handling for CSIDL_DRIVES */ 1841 if (COMDLG32_PIDL_ILIsEqual(pidlTmp, pidlDrives)) 1842 { 1843 if(SUCCEEDED(IShellFolder_BindToObject(psfRoot, pidlTmp, NULL, &IID_IShellFolder, (LPVOID*)&psfDrives))) 1844 { 1845 /* enumerate the drives */ 1846 if(SUCCEEDED(IShellFolder_EnumObjects(psfDrives, hwndCombo,SHCONTF_FOLDERS, &lpeDrives))) 1847 { 1848 while (S_OK == IEnumIDList_Next(lpeDrives, 1, &pidlTmp1, NULL)) 1849 { 1850 pidlAbsTmp = COMDLG32_PIDL_ILCombine(pidlTmp, pidlTmp1); 1851 FILEDLG95_LOOKIN_AddItem(hwndCombo, pidlAbsTmp,LISTEND); 1852 COMDLG32_SHFree(pidlAbsTmp); 1853 COMDLG32_SHFree(pidlTmp1); 1854 } 1855 IEnumIDList_Release(lpeDrives); 1856 } 1857 IShellFolder_Release(psfDrives); 1858 } 1859 } 2162 1860 COMDLG32_SHFree(pidlTmp); 2163 1861 } … … 2168 1866 IShellFolder_Release(psfRoot); 2169 1867 COMDLG32_SHFree(pidlDrives); 2170 2171 1868 return NOERROR; 2172 1869 } … … 2184 1881 RECT rectText; 2185 1882 RECT rectIcon; 1883 SHFILEINFOA sfi; 1884 HIMAGELIST ilItemImage; 2186 1885 int iIndentation; 2187 1886 LPSFOLDER tmpFolder; 2188 INT iIcon; 1887 2189 1888 2190 1889 LookInInfos *liInfos = (LookInInfos *)GetPropA(pDIStruct->hwndItem,LookInInfosStr); … … 2195 1894 return 0; 2196 1895 2197 if( (LPSFOLDER)CB_ERR ==(tmpFolder = (LPSFOLDER) CBGetItemDataPtr(pDIStruct->hwndItem,1896 if(!(tmpFolder = (LPSFOLDER) CBGetItemDataPtr(pDIStruct->hwndItem, 2198 1897 pDIStruct->itemID))) 2199 1898 return 0; 2200 1899 2201 if (!tmpFolder->szDisplayName) 2202 { 2203 SHFILEINFOA sfi; 2204 INT len; 2205 2206 tmpFolder->ilItemImage = (HIMAGELIST) COMDLG32_SHGetFileInfoA ((LPCSTR)tmpFolder->pidlItem, 2207 0, 2208 &sfi, 1900 1901 if(pDIStruct->itemID == liInfos->uSelectedItem) 1902 { 1903 ilItemImage = (HIMAGELIST) COMDLG32_SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem, 1904 0, 1905 &sfi, 1906 sizeof (SHFILEINFOA), 1907 SHGFI_PIDL | SHGFI_SMALLICON | 1908 SHGFI_OPENICON | SHGFI_SYSICONINDEX | 1909 SHGFI_DISPLAYNAME ); 1910 } 1911 else 1912 { 1913 ilItemImage = (HIMAGELIST) COMDLG32_SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem, 1914 0, 1915 &sfi, 2209 1916 sizeof (SHFILEINFOA), 2210 SHGFI_PIDL | SHGFI_SMALLICON | SHGFI_SYSICONINDEX | SHGFI_DISPLAYNAME); 2211 len = strlen(sfi.szDisplayName)+1; 2212 tmpFolder->szDisplayName = MemAlloc(len); 2213 strcpy(tmpFolder->szDisplayName,sfi.szDisplayName); 2214 tmpFolder->iIcon = sfi.iIcon; 2215 } 2216 2217 if((pDIStruct->itemID == liInfos->uSelectedItem) || (pDIStruct->itemState & ODS_COMBOBOXEDIT)) 2218 { 2219 if (!tmpFolder->iSelIcon) 2220 { 2221 SHFILEINFOA sfi2; 2222 2223 COMDLG32_SHGetFileInfoA((LPCSTR)tmpFolder->pidlItem,0,&sfi2,sizeof(SHFILEINFOA), 2224 SHGFI_PIDL | SHGFI_SMALLICON | 2225 SHGFI_OPENICON | SHGFI_SYSICONINDEX); 2226 tmpFolder->iSelIcon = sfi2.iIcon; 2227 } 2228 iIcon = tmpFolder->iSelIcon; 2229 } else iIcon = tmpFolder->iIcon; 2230 1917 SHGFI_PIDL | SHGFI_SMALLICON | 1918 SHGFI_SYSICONINDEX | 1919 SHGFI_DISPLAYNAME); 1920 } 2231 1921 2232 1922 /* Is this item selected ?*/ … … 2245 1935 2246 1936 /* Do not indent item if drawing in the edit of the combo*/ 2247 if (pDIStruct->itemState & ODS_COMBOBOXEDIT) 1937 if(pDIStruct->itemState & ODS_COMBOBOXEDIT) 1938 { 2248 1939 iIndentation = 0; 1940 ilItemImage = (HIMAGELIST) COMDLG32_SHGetFileInfoA ((LPCSTR) tmpFolder->pidlItem, 1941 0, 1942 &sfi, 1943 sizeof (SHFILEINFOA), 1944 SHGFI_PIDL | SHGFI_SMALLICON | SHGFI_OPENICON 1945 | SHGFI_SYSICONINDEX | SHGFI_DISPLAYNAME ); 1946 1947 } 2249 1948 else 1949 { 2250 1950 iIndentation = tmpFolder->m_iIndent; 2251 1951 } 2252 1952 /* Draw text and icon */ 2253 1953 … … 2264 1964 rectText.bottom = pDIStruct->rcItem.bottom; 2265 1965 2266 1966 2267 1967 /* Draw the icon from the image list */ 2268 COMDLG32_ImageList_Draw( tmpFolder->ilItemImage,2269 iIcon,2270 pDIStruct->hDC, 2271 rectIcon.left, 2272 rectIcon.top, 2273 ILD_TRANSPARENT ); 1968 COMDLG32_ImageList_Draw(ilItemImage, 1969 sfi.iIcon, 1970 pDIStruct->hDC, 1971 rectIcon.left, 1972 rectIcon.top, 1973 ILD_TRANSPARENT ); 2274 1974 2275 1975 /* Draw the associated text */ 2276 if (tmpFolder->szDisplayName)2277 TextOutA(pDIStruct->hDC,rectText.left,rectText.top, tmpFolder->szDisplayName,strlen(tmpFolder->szDisplayName));1976 if(sfi.szDisplayName) 1977 TextOutA(pDIStruct->hDC,rectText.left,rectText.top,sfi.szDisplayName,strlen(sfi.szDisplayName)); 2278 1978 2279 1979 … … 2291 1991 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); 2292 1992 2293 TRACE(" \n");1993 TRACE("%p\n", fodInfos); 2294 1994 2295 1995 switch(wNotifyCode) 2296 1996 { 2297 case CBN_SELENDOK:1997 case CBN_SELENDOK: 2298 1998 { 2299 1999 LPSFOLDER tmpFolder; 2300 int iItem; 2000 int iItem; 2301 2001 2302 2002 iItem = CBGetCurSel(fodInfos->DlgInfos.hwndLookInCB); … … 2304 2004 if(!(tmpFolder = (LPSFOLDER) CBGetItemDataPtr(fodInfos->DlgInfos.hwndLookInCB, 2305 2005 iItem))) 2306 2006 return FALSE; 2307 2007 2308 2008 … … 2315 2015 break; 2316 2016 } 2317 2017 2318 2018 } 2319 2019 return FALSE; … … 2340 2040 if(!(liInfos = (LookInInfos *)GetPropA(hwnd,LookInInfosStr))) 2341 2041 return -1; 2342 2042 2343 2043 tmpFolder = MemAlloc(sizeof(SFOLDER)); 2344 2044 tmpFolder->m_iIndent = 0; 2345 tmpFolder->szDisplayName = NULL;2346 2045 2347 2046 /* Calculate the indentation of the item in the lookin*/ 2348 2047 pidlNext = pidl; 2349 while( (pidlNext = COMDLG32_PIDL_ILGetNext(pidlNext)) != NULL)2048 while( (pidlNext=COMDLG32_PIDL_ILGetNext(pidlNext)) ) 2350 2049 { 2351 2050 tmpFolder->m_iIndent++; 2352 2051 } 2353 2052 2354 tmpFolder->pidlItem = COMDLG32_PIDL_ILClone(pidl); 2053 tmpFolder->pidlItem = COMDLG32_PIDL_ILClone(pidl); /* FIXME: memory leak*/ 2355 2054 2356 2055 if(tmpFolder->m_iIndent > liInfos->iMaxIndentation) 2357 2056 liInfos->iMaxIndentation = tmpFolder->m_iIndent; 2358 2057 2058 sfi.dwAttributes = SFGAO_FILESYSANCESTOR | SFGAO_FILESYSTEM; 2359 2059 COMDLG32_SHGetFileInfoA((LPSTR)pidl, 2360 2060 0, 2361 2061 &sfi, 2362 2062 sizeof(sfi), 2363 SHGFI_PIDL | SHGFI_ATTRIBUTES); 2063 SHGFI_DISPLAYNAME | SHGFI_SYSICONINDEX 2064 | SHGFI_PIDL | SHGFI_SMALLICON | SHGFI_ATTRIBUTES | SHGFI_ATTR_SPECIFIED); 2065 2364 2066 2365 2067 if((sfi.dwAttributes & SFGAO_FILESYSANCESTOR) || (sfi.dwAttributes & SFGAO_FILESYSTEM)) 2366 2068 { 2367 2069 int iItemID; 2368 2070 2369 2071 /* Add the item at the end of the list */ 2370 2072 if(iInsertId < 0) 2371 2073 { 2372 iItemID = CBAddString(hwnd, NULL);2074 iItemID = CBAddString(hwnd,sfi.szDisplayName); 2373 2075 } 2374 2076 /* Insert the item at the iInsertId position*/ 2375 2077 else 2376 2078 { 2377 iItemID = CBInsertString(hwnd, NULL,iInsertId);2378 } 2379 2380 2381 2382 } 2383 2384 MemFree( tmpFolder);2079 iItemID = CBInsertString(hwnd,sfi.szDisplayName,iInsertId); 2080 } 2081 2082 CBSetItemDataPtr(hwnd,iItemID,tmpFolder); 2083 return iItemID; 2084 } 2085 2086 MemFree( tmpFolder ); 2385 2087 return -1; 2088 2386 2089 } 2387 2090 … … 2389 2092 * FILEDLG95_LOOKIN_InsertItemAfterParent 2390 2093 * 2391 * Insert an item below its parent 2094 * Insert an item below its parent 2392 2095 */ 2393 2096 static int FILEDLG95_LOOKIN_InsertItemAfterParent(HWND hwnd,LPITEMIDLIST pidl) 2394 2097 { 2395 2098 2396 2099 LPITEMIDLIST pidlParent = GetParentPidl(pidl); 2397 2100 int iParentPos; … … 2448 2151 } 2449 2152 } 2450 2153 2451 2154 CBSetCurSel(hwnd,iItemPos); 2452 2155 liInfos->uSelectedItem = iItemPos; … … 2474 2177 if((iItemPos = FILEDLG95_LOOKIN_SearchItem(hwnd,(WPARAM)liInfos->iMaxIndentation,SEARCH_EXP)) >=0) 2475 2178 { 2476 SFOLDER *tmpFolder; 2477 2478 tmpFolder = (LPSFOLDER) CBGetItemDataPtr(hwnd,iItemPos); 2479 if (tmpFolder->szDisplayName) MemFree(tmpFolder->szDisplayName); 2179 SFOLDER *tmpFolder = (LPSFOLDER) CBGetItemDataPtr(hwnd,iItemPos); 2180 COMDLG32_SHFree(tmpFolder->pidlItem); 2480 2181 MemFree(tmpFolder); 2481 2182 CBDeleteString(hwnd,iItemPos); … … 2501 2202 TRACE("\n"); 2502 2203 2503 for(;i<iCount;i++) 2504 { 2505 LPSFOLDER tmpFolder = (LPSFOLDER) CBGetItemDataPtr(hwnd,i); 2506 2507 if(iSearchMethod == SEARCH_PIDL && COMDLG32_PIDL_ILIsEqual((LPITEMIDLIST)searchArg,tmpFolder->pidlItem)) 2508 return i; 2509 if(iSearchMethod == SEARCH_EXP && tmpFolder->m_iIndent == (int)searchArg) 2510 return i; 2511 2204 if (iCount != CB_ERR) 2205 { 2206 for(;i<iCount;i++) 2207 { 2208 LPSFOLDER tmpFolder = (LPSFOLDER) CBGetItemDataPtr(hwnd,i); 2209 2210 if(iSearchMethod == SEARCH_PIDL && COMDLG32_PIDL_ILIsEqual((LPITEMIDLIST)searchArg,tmpFolder->pidlItem)) 2211 return i; 2212 if(iSearchMethod == SEARCH_EXP && tmpFolder->m_iIndent == (int)searchArg) 2213 return i; 2214 } 2512 2215 } 2513 2216 … … 2529 2232 2530 2233 /* Delete each string of the combo and their associated data */ 2531 for(iPos = iCount-1;iPos>=0;iPos--)2234 if (iCount != CB_ERR) 2532 2235 { 2533 SFOLDER *tmpFolder = (LPSFOLDER)CBGetItemDataPtr(fodInfos->DlgInfos.hwndLookInCB,iPos); 2534 2535 if (tmpFolder->szDisplayName) MemFree(tmpFolder->szDisplayName); 2536 MemFree(tmpFolder); 2537 CBDeleteString(fodInfos->DlgInfos.hwndLookInCB,iPos); 2538 } 2236 for(iPos = iCount-1;iPos>=0;iPos--) 2237 { 2238 SFOLDER *tmpFolder = (LPSFOLDER) CBGetItemDataPtr(fodInfos->DlgInfos.hwndLookInCB,iPos); 2239 COMDLG32_SHFree(tmpFolder->pidlItem); 2240 MemFree(tmpFolder); 2241 CBDeleteString(fodInfos->DlgInfos.hwndLookInCB,iPos); 2242 } 2243 } 2244 2539 2245 /* LookInInfos structure */ 2540 2246 RemovePropA(fodInfos->DlgInfos.hwndLookInCB,LookInInfosStr); 2541 2247 2542 2248 } 2249 /*********************************************************************** 2250 * FILEDLG95_FILENAME_FillFromSelection 2251 * 2252 * fills the edit box from the cached DataObject 2253 */ 2254 void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd) 2255 { 2256 FileOpenDlgInfos *fodInfos; 2257 LPITEMIDLIST pidl; 2258 UINT nFiles = 0, nFileToOpen, nFileSelected, nLength = 0; 2259 char lpstrTemp[MAX_PATH]; 2260 LPSTR lpstrAllFile = NULL, lpstrCurrFile = NULL; 2261 2262 TRACE("\n"); 2263 fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); 2264 2265 /* Count how many files we have */ 2266 nFileSelected = GetNumSelected( fodInfos->Shell.FOIDataObject ); 2267 2268 /* calculate the string length, count files */ 2269 if (nFileSelected >= 1) 2270 { 2271 nLength += 3; /* first and last quotes, trailing \0 */ 2272 for ( nFileToOpen = 0; nFileToOpen < nFileSelected; nFileToOpen++ ) 2273 { 2274 pidl = GetPidlFromDataObject( fodInfos->Shell.FOIDataObject, nFileToOpen+1 ); 2275 2276 if (pidl) 2277 { 2278 /* get the total length of the selected file names*/ 2279 lpstrTemp[0] = '\0'; 2280 GetName( fodInfos->Shell.FOIShellFolder, pidl, SHGDN_INFOLDER, lpstrTemp ); 2281 2282 if ( ! IsPidlFolder(fodInfos->Shell.FOIShellFolder, pidl) ) /* Ignore folders */ 2283 { 2284 nLength += strlen( lpstrTemp ) + 3; 2285 nFiles++; 2286 } 2287 COMDLG32_SHFree( pidl ); 2288 } 2289 } 2290 } 2291 2292 /* allocate the buffer */ 2293 if (nFiles <= 1) nLength = MAX_PATH; 2294 lpstrAllFile = (LPSTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nLength); 2295 lpstrAllFile[0] = '\0'; 2296 2297 /* Generate the string for the edit control */ 2298 if(nFiles >= 1) 2299 { 2300 lpstrCurrFile = lpstrAllFile; 2301 for ( nFileToOpen = 0; nFileToOpen < nFileSelected; nFileToOpen++ ) 2302 { 2303 pidl = GetPidlFromDataObject( fodInfos->Shell.FOIDataObject, nFileToOpen+1 ); 2304 2305 if (pidl) 2306 { 2307 /* get the file name */ 2308 lpstrTemp[0] = '\0'; 2309 GetName( fodInfos->Shell.FOIShellFolder, pidl, SHGDN_INFOLDER, lpstrTemp ); 2310 2311 if (! IsPidlFolder(fodInfos->Shell.FOIShellFolder, pidl)) /* Ignore folders */ 2312 { 2313 if ( nFiles > 1) 2314 { 2315 *lpstrCurrFile++ = '\"'; 2316 strcpy( lpstrCurrFile, lpstrTemp ); 2317 lpstrCurrFile += strlen( lpstrTemp ); 2318 strcpy( lpstrCurrFile, "\" " ); 2319 lpstrCurrFile += 2; 2320 } 2321 else 2322 { 2323 strcpy( lpstrAllFile, lpstrTemp ); 2324 } 2325 } 2326 COMDLG32_SHFree( (LPVOID) pidl ); 2327 } 2328 } 2329 } 2330 2331 SetWindowTextA( fodInfos->DlgInfos.hwndFileName, lpstrAllFile ); 2332 HeapFree(GetProcessHeap(),0, lpstrAllFile ); 2333 } 2334 2335 2336 /* copied from shell32 to avoid linking to it */ 2337 static HRESULT COMDLG32_StrRetToStrNA (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl) 2338 { 2339 switch (src->uType) 2340 { 2341 case STRRET_WSTR: 2342 WideCharToMultiByte(CP_ACP, 0, src->u.pOleStr, -1, (LPSTR)dest, len, NULL, NULL); 2343 COMDLG32_SHFree(src->u.pOleStr); 2344 break; 2345 2346 case STRRET_CSTRA: 2347 lstrcpynA((LPSTR)dest, src->u.cStr, len); 2348 break; 2349 2350 case STRRET_OFFSETA: 2351 lstrcpynA((LPSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len); 2352 break; 2353 2354 default: 2355 FIXME("unknown type!\n"); 2356 if (len) 2357 { 2358 *(LPSTR)dest = '\0'; 2359 } 2360 return(FALSE); 2361 } 2362 return S_OK; 2363 } 2364 2365 /*********************************************************************** 2366 * FILEDLG95_FILENAME_GetFileNames 2367 * 2368 * copies the filenames to a 0-delimited string list (A\0B\0C\0\0) 2369 */ 2370 int FILEDLG95_FILENAME_GetFileNames (HWND hwnd, LPSTR * lpstrFileList, UINT * sizeUsed) 2371 { 2372 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); 2373 UINT nStrCharCount = 0; /* index in src buffer */ 2374 UINT nFileIndex = 0; /* index in dest buffer */ 2375 UINT nFileCount = 0; /* number of files */ 2376 UINT nStrLen = 0; /* length of string in edit control */ 2377 LPSTR lpstrEdit; /* buffer for string from edit control */ 2378 2379 TRACE("\n"); 2380 2381 /* get the filenames from the edit control */ 2382 nStrLen = SendMessageA(fodInfos->DlgInfos.hwndFileName, WM_GETTEXTLENGTH, 0, 0); 2383 lpstrEdit = MemAlloc(nStrLen+1); 2384 GetDlgItemTextA(hwnd, IDC_FILENAME, lpstrEdit, nStrLen+1); 2385 2386 TRACE("nStrLen=%u str=%s\n", nStrLen, lpstrEdit); 2387 2388 /* we might get single filename without any '"', 2389 * so we need nStrLen + terminating \0 + end-of-list \0 */ 2390 *lpstrFileList = MemAlloc(nStrLen+2); 2391 *sizeUsed = 0; 2392 2393 /* build 0-delimited file list from filenames */ 2394 while ( nStrCharCount <= nStrLen ) 2395 { 2396 if ( lpstrEdit[nStrCharCount]=='"' ) 2397 { 2398 nStrCharCount++; 2399 while ((lpstrEdit[nStrCharCount]!='"') && (nStrCharCount <= nStrLen)) 2400 { 2401 (*lpstrFileList)[nFileIndex++] = lpstrEdit[nStrCharCount]; 2402 (*sizeUsed)++; 2403 nStrCharCount++; 2404 } 2405 (*lpstrFileList)[nFileIndex++] = '\0'; 2406 (*sizeUsed)++; 2407 nFileCount++; 2408 } 2409 nStrCharCount++; 2410 } 2411 2412 /* single, unquoted string */ 2413 if ((nStrLen > 0) && (*sizeUsed == 0) ) 2414 { 2415 strcpy(*lpstrFileList, lpstrEdit); 2416 nFileIndex = strlen(lpstrEdit) + 1; 2417 (*sizeUsed) = nFileIndex; 2418 nFileCount = 1; 2419 } 2420 2421 /* trailing \0 */ 2422 (*lpstrFileList)[nFileIndex] = '\0'; 2423 (*sizeUsed)++; 2424 2425 MemFree(lpstrEdit); 2426 return nFileCount; 2427 } 2428 2429 #define SETDefFormatEtc(fe,cf,med) \ 2430 { \ 2431 (fe).cfFormat = cf;\ 2432 (fe).dwAspect = DVASPECT_CONTENT; \ 2433 (fe).ptd =NULL;\ 2434 (fe).tymed = med;\ 2435 (fe).lindex = -1;\ 2436 }; 2437 2438 /* 2439 * DATAOBJECT Helper functions 2440 */ 2441 2442 /*********************************************************************** 2443 * COMCTL32_ReleaseStgMedium 2444 * 2445 * like ReleaseStgMedium from ole32 2446 */ 2447 static void COMCTL32_ReleaseStgMedium (STGMEDIUM medium) 2448 { 2449 if(medium.pUnkForRelease) 2450 { 2451 IUnknown_Release(medium.pUnkForRelease); 2452 } 2453 else 2454 { 2455 GlobalUnlock(medium.u.hGlobal); 2456 GlobalFree(medium.u.hGlobal); 2457 } 2458 } 2459 2460 /*********************************************************************** 2461 * GetPidlFromDataObject 2462 * 2463 * Return pidl(s) by number from the cached DataObject 2464 * 2465 * nPidlIndex=0 gets the fully qualified root path 2466 */ 2467 LPITEMIDLIST GetPidlFromDataObject ( IDataObject *doSelected, UINT nPidlIndex) 2468 { 2469 2470 STGMEDIUM medium; 2471 FORMATETC formatetc; 2472 LPITEMIDLIST pidl = NULL; 2473 2474 TRACE("sv=%p index=%u\n", doSelected, nPidlIndex); 2475 2476 /* Set the FORMATETC structure*/ 2477 SETDefFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); 2478 2479 /* Get the pidls from IDataObject */ 2480 if(SUCCEEDED(IDataObject_GetData(doSelected,&formatetc,&medium))) 2481 { 2482 LPIDA cida = GlobalLock(medium.u.hGlobal); 2483 if(nPidlIndex <= cida->cidl) 2484 { 2485 pidl = COMDLG32_PIDL_ILClone((LPITEMIDLIST)(&((LPBYTE)cida)[cida->aoffset[nPidlIndex]])); 2486 } 2487 COMCTL32_ReleaseStgMedium(medium); 2488 } 2489 return pidl; 2490 } 2491 2492 /*********************************************************************** 2493 * GetNumSelected 2494 * 2495 * Return the number of selected items in the DataObject. 2496 * 2497 */ 2498 UINT GetNumSelected( IDataObject *doSelected ) 2499 { 2500 UINT retVal = 0; 2501 STGMEDIUM medium; 2502 FORMATETC formatetc; 2503 2504 TRACE("sv=%p\n", doSelected); 2505 2506 if (!doSelected) return 0; 2507 2508 /* Set the FORMATETC structure*/ 2509 SETDefFormatEtc(formatetc, RegisterClipboardFormatA(CFSTR_SHELLIDLIST), TYMED_HGLOBAL); 2510 2511 /* Get the pidls from IDataObject */ 2512 if(SUCCEEDED(IDataObject_GetData(doSelected,&formatetc,&medium))) 2513 { 2514 LPIDA cida = GlobalLock(medium.u.hGlobal); 2515 retVal = cida->cidl; 2516 COMCTL32_ReleaseStgMedium(medium); 2517 return retVal; 2518 } 2519 return 0; 2520 } 2521 2543 2522 /* 2544 2523 * TOOLS … … 2548 2527 * GetName 2549 2528 * 2550 * Get the pidl's display name (relative to folder) and 2529 * Get the pidl's display name (relative to folder) and 2551 2530 * put it in lpstrFileName. 2552 * 2531 * 2553 2532 * Return NOERROR on success, 2554 2533 * E_FAIL otherwise … … 2560 2539 HRESULT hRes; 2561 2540 2562 TRACE(" %p%p\n", lpsf, pidl);2541 TRACE("sf=%p pidl=%p\n", lpsf, pidl); 2563 2542 2564 2543 if(!lpsf) … … 2572 2551 2573 2552 /* Get the display name of the pidl relative to the folder */ 2574 if (SUCCEEDED(hRes = IShellFolder_GetDisplayNameOf(lpsf, 2575 pidl, 2576 dwFlags, 2577 &str))) 2578 { 2579 return StrRetToBufA(&str, pidl,lpstrFileName, MAX_PATH); 2553 if (SUCCEEDED(hRes = IShellFolder_GetDisplayNameOf(lpsf, pidl, dwFlags, &str))) 2554 { 2555 return COMDLG32_StrRetToStrNA(lpstrFileName, MAX_PATH, &str, pidl); 2580 2556 } 2581 2557 return E_FAIL; … … 2585 2561 * GetShellFolderFromPidl 2586 2562 * 2587 * pidlRel is the item pidl relative 2563 * pidlRel is the item pidl relative 2588 2564 * Return the IShellFolder of the absolute pidl 2589 2565 */ … … 2601 2577 if(SUCCEEDED(IShellFolder_BindToObject(psfParent, pidlAbs, NULL, &IID_IShellFolder, (LPVOID*)&psf))) 2602 2578 { 2603 2579 IShellFolder_Release(psfParent); 2604 2580 return psf; 2605 2581 } … … 2624 2600 pidlParent = COMDLG32_PIDL_ILClone(pidl); 2625 2601 COMDLG32_PIDL_ILRemoveLastID(pidlParent); 2626 2602 2627 2603 return pidlParent; 2628 2604 } … … 2631 2607 * GetPidlFromName 2632 2608 * 2633 * returns the pidl of the file name relative to folder 2609 * returns the pidl of the file name relative to folder 2634 2610 * NULL if an error occured 2635 2611 */ 2636 LPITEMIDLIST GetPidlFromName(IShellFolder * psf,LPCSTR lpcstrFileName)2612 LPITEMIDLIST GetPidlFromName(IShellFolder *lpsf,LPCSTR lpcstrFileName) 2637 2613 { 2638 2614 LPITEMIDLIST pidl; 2639 2615 ULONG ulEaten; 2640 wchar_t lpwstrDirName[MAX_PATH]; 2641 2642 2643 TRACE("sf=%p file=%s\n", psf, lpcstrFileName); 2644 2645 if(!lpcstrFileName) 2646 return NULL; 2647 2648 MultiByteToWideChar(CP_ACP, 2649 MB_PRECOMPOSED, 2650 lpcstrFileName, 2651 -1, 2652 (LPWSTR)lpwstrDirName, 2653 MAX_PATH); 2654 2655 IShellFolder_ParseDisplayName(psf, 0, 2656 NULL, 2657 (LPWSTR)lpwstrDirName, 2658 &ulEaten, 2659 &pidl, 2660 NULL); 2661 2662 return pidl; 2663 } 2664 2665 /*********************************************************************** 2666 * GetFileExtension 2667 * 2668 */ 2669 BOOL GetFileExtension(IShellFolder *psf,LPITEMIDLIST pidl,LPSTR lpstrFileExtension) 2670 { 2671 char FileName[MAX_PATH]; 2672 int result; 2673 char *pdest; 2674 int ch = '.'; 2675 2676 if(SUCCEEDED(GetName(psf,pidl,SHGDN_NORMAL,FileName))) 2677 { 2678 if(!(pdest = strrchr( FileName, ch ))) 2679 return FALSE; 2680 2681 result = pdest - FileName + 1; 2682 strcpy(lpstrFileExtension,&FileName[result]); 2683 return TRUE; 2684 } 2685 return FALSE; 2686 } 2616 WCHAR lpwstrDirName[MAX_PATH]; 2617 2618 TRACE("sf=%p file=%s\n", lpsf, lpcstrFileName); 2619 2620 if(!lpcstrFileName) return NULL; 2621 2622 MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,lpcstrFileName,-1,(LPWSTR)lpwstrDirName,MAX_PATH); 2623 2624 if(!lpsf) 2625 { 2626 COMDLG32_SHGetDesktopFolder(&lpsf); 2627 pidl = GetPidlFromName(lpsf, lpcstrFileName); 2628 IShellFolder_Release(lpsf); 2629 } 2630 else 2631 { 2632 IShellFolder_ParseDisplayName(lpsf, 0, NULL, (LPWSTR)lpwstrDirName, &ulEaten, &pidl, NULL); 2633 } 2634 return pidl; 2635 } 2636 2637 /* 2638 */ 2639 BOOL IsPidlFolder (LPSHELLFOLDER psf, LPITEMIDLIST pidl) 2640 { 2641 ULONG uAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER; 2642 HRESULT ret; 2643 2644 TRACE("%p, %p\n", psf, pidl); 2645 2646 ret = IShellFolder_GetAttributesOf( psf, 1, &pidl, &uAttr ); 2647 2648 TRACE("-- 0x%08lx 0x%08lx\n", uAttr, ret); 2649 /* see documentation shell 4.1*/ 2650 return uAttr & (SFGAO_FOLDER | SFGAO_HASSUBFOLDER); 2651 } 2652 2653 /*********************************************************************** 2654 * BrowseSelectedFolder 2655 */ 2656 static BOOL BrowseSelectedFolder(HWND hwnd) 2657 { 2658 BOOL bBrowseSelFolder = FALSE; 2659 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr); 2660 2661 TRACE("\n"); 2662 2663 if (GetNumSelected(fodInfos->Shell.FOIDataObject) == 1) 2664 { 2665 LPITEMIDLIST pidlSelection; 2666 2667 /* get the file selected */ 2668 pidlSelection = GetPidlFromDataObject( fodInfos->Shell.FOIDataObject, 1); 2669 if (IsPidlFolder (fodInfos->Shell.FOIShellFolder, pidlSelection)) 2670 { 2671 if ( FAILED( IShellBrowser_BrowseObject( fodInfos->Shell.FOIShellBrowser, 2672 pidlSelection, SBSP_RELATIVE ) ) ) 2673 { 2674 MessageBoxA( hwnd, "Path does not exist", fodInfos->ofnInfos->lpstrTitle, 2675 MB_OK | MB_ICONEXCLAMATION ); 2676 } 2677 2678 bBrowseSelFolder = TRUE; 2679 } 2680 COMDLG32_SHFree( pidlSelection ); 2681 } 2682 2683 return bBrowseSelFolder; 2684 } 2687 2685 2688 2686 /* 2689 2687 * Memory allocation methods */ 2690 void *MemAlloc(UINT size)2688 static void *MemAlloc(UINT size) 2691 2689 { 2692 2690 return HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,size); 2693 2691 } 2694 2692 2695 void MemFree(void *mem)2693 static void MemFree(void *mem) 2696 2694 { 2697 2695 if(mem) … … 2701 2699 } 2702 2700 2703 /***********************************************************************2704 * BrowseSelectedFolder2705 *2706 */2707 static BOOL BrowseSelectedFolder(HWND hwnd)2708 {2709 BOOL bBrowseSelFolder = FALSE;2710 2711 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwnd,FileOpenDlgInfosStr);2712 2713 if (GetNumSelected(fodInfos->Shell.FOIShellView) == 1)2714 {2715 LPITEMIDLIST pidlSelection;2716 ULONG uAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER;2717 2718 /* get the file selected */2719 EnumSelectedPidls( fodInfos->Shell.FOIShellView, 0, &pidlSelection );2720 IShellFolder_GetAttributesOf( fodInfos->Shell.FOIShellFolder, 1, &pidlSelection, &uAttr );2721 if ( uAttr & SFGAO_FOLDER )2722 {2723 if ( FAILED( IShellBrowser_BrowseObject( fodInfos->Shell.FOIShellBrowser,2724 pidlSelection, SBSP_RELATIVE ) ) )2725 {2726 MessageBoxA( hwnd, "Path does not exist", fodInfos->ofnInfos->lpstrTitle,2727 MB_OK | MB_ICONEXCLAMATION );2728 }2729 2730 bBrowseSelFolder = TRUE;2731 }2732 COMDLG32_SHFree( pidlSelection );2733 }2734 2735 return bBrowseSelFolder;2736 }2737 -
trunk/src/comdlg32/filedlgbrowser.c
r3256 r4511 1 /* $Id: filedlgbrowser.c,v 1.5 2000-03-28 15:26:48 cbratschi Exp $ */2 1 /* 3 2 * Implementation of IShellBrowser for the File Open common dialog 3 * 4 4 * 5 * Copyright 2000 Christoph Bratschi (cbratschi@datacomm.ch)6 * Project Odin Software License can be found in LICENSE.TXT7 *8 * Corel WINE 20000324 level9 5 */ 10 6 … … 22 18 #include "unknwn.h" 23 19 #include "filedlgbrowser.h" 20 #include "windef.h" 21 #include "wingdi.h" 24 22 #include "winuser.h" 23 #include "wine/winestring.h" 25 24 #include "heap.h" 25 #include "shlguid.h" 26 26 #include "wine/obj_dataobject.h" 27 27 #include "debugtools.h" 28 28 #include "cdlg.h" 29 #include "wine/undocshell.h" 30 31 DEFAULT_DEBUG_CHANNEL(commdlg) 32 33 #define SETDefFormatEtc(fe,cf,med) \ 34 { \ 35 (fe).cfFormat = cf;\ 36 (fe).dwAspect = DVASPECT_CONTENT; \ 37 (fe).ptd =NULL;\ 38 (fe).tymed = med;\ 39 (fe).lindex = -1;\ 40 }; 41 29 30 DEFAULT_DEBUG_CHANNEL(commdlg); 42 31 43 32 /************************************************************************** … … 96 85 * External Prototypes 97 86 */ 98 extern const char *FileOpenDlgInfosStr; 87 extern const char *FileOpenDlgInfosStr; 99 88 100 89 extern HRESULT GetName(LPSHELLFOLDER lpsf, LPITEMIDLIST pidl,DWORD dwFlags,LPSTR lpstrFileName); … … 121 110 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(hwndOwner,FileOpenDlgInfosStr); 122 111 123 sb=(IShellBrowserImpl*) SHAlloc(sizeof(IShellBrowserImpl));112 sb=(IShellBrowserImpl*)COMDLG32_SHAlloc(sizeof(IShellBrowserImpl)); 124 113 125 114 /* Initialisation of the member variables */ … … 131 120 sb->lpVtbl2 = &IShellBrowserImpl_ICommDlgBrowser_Vtbl; 132 121 133 COMDLG32_SHGetSpecialFolderLocation(hwndOwner, 134 CSIDL_DESKTOP, 122 COMDLG32_SHGetSpecialFolderLocation(hwndOwner, CSIDL_DESKTOP, 135 123 &fodInfos->ShellInfos.pidlAbsCurrent); 136 124 … … 155 143 */ 156 144 HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface, 157 REFIID riid, 145 REFIID riid, 158 146 LPVOID *ppvObj) 159 147 { … … 165 153 166 154 if(IsEqualIID(riid, &IID_IUnknown)) /*IUnknown*/ 167 { *ppvObj = This; 155 { *ppvObj = This; 168 156 } 169 157 else if(IsEqualIID(riid, &IID_IOleWindow)) /*IOleWindow*/ … … 207 195 TRACE("(%p)\n", This); 208 196 209 if (!--(This->ref)) 210 { 211 COMDLG32_SHFree(This);197 if (!--(This->ref)) 198 { 199 HeapFree(GetProcessHeap(),0, This); 212 200 return 0; 213 201 } … … 227 215 * 228 216 * Note : We will never be window less in the File Open dialog 229 * 230 */ 231 HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface, 217 * 218 */ 219 HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface, 232 220 HWND * phwnd) 233 221 { … … 241 229 *phwnd = This->hwndOwner; 242 230 243 return (*phwnd) ? S_OK : E_UNEXPECTED; 231 return (*phwnd) ? S_OK : E_UNEXPECTED; 244 232 245 233 } … … 268 256 * See Windows documentation on IShellBrowser::BrowseObject for more details 269 257 * 270 * This function will override user specified flags and will always 271 * use SBSP_DEFBROWSER and SBSP_DEFMODE. 272 */ 273 HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface, 274 LPCITEMIDLIST pidl, 258 * This function will override user specified flags and will always 259 * use SBSP_DEFBROWSER and SBSP_DEFMODE. 260 */ 261 HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface, 262 LPCITEMIDLIST pidl, 275 263 UINT wFlags) 276 264 { … … 280 268 FileOpenDlgInfos *fodInfos; 281 269 LPITEMIDLIST pidlTmp; 282 283 ICOM_THIS(IShellBrowserImpl, iface); 284 285 TRACE("(%p)\n", This); 270 HWND hwndView; 271 HWND hDlgWnd; 272 BOOL bViewHasFocus; 273 274 ICOM_THIS(IShellBrowserImpl, iface); 275 276 TRACE("(%p)(%p,0x%08x)\n", This, pidl, wFlags); 286 277 287 278 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); … … 290 281 if(wFlags & SBSP_RELATIVE) 291 282 { 292 283 293 284 /* SBSP_RELATIVE A relative pidl (relative from the current folder) */ 294 hRes = IShellFolder_BindToObject(fodInfos->Shell.FOIShellFolder, 295 pidl, 296 NULL, 297 &IID_IShellFolder, 298 (LPVOID *)&psfTmp); 299 if(FAILED(hRes)) 285 if(FAILED(hRes = IShellFolder_BindToObject(fodInfos->Shell.FOIShellFolder, 286 pidl, NULL, &IID_IShellFolder, (LPVOID *)&psfTmp))) 300 287 { 301 return hRes; 288 ERR("bind to object failed\n"); 289 return hRes; 302 290 } 303 291 /* create an absolute pidl */ 304 292 pidlTmp = COMDLG32_PIDL_ILCombine(fodInfos->ShellInfos.pidlAbsCurrent, 305 293 (LPITEMIDLIST)pidl); 306 307 294 } 308 295 else if(wFlags & SBSP_PARENT) 309 296 { 310 297 /* Browse the parent folder (ignores the pidl) */ 311 312 298 pidlTmp = GetParentPidl(fodInfos->ShellInfos.pidlAbsCurrent); 313 299 psfTmp = GetShellFolderFromPidl(pidlTmp); 314 300 315 301 } 316 else 302 else /* SBSP_ABSOLUTE is 0x0000 */ 317 303 { 318 304 /* An absolute pidl (relative from the desktop) */ … … 320 306 psfTmp = GetShellFolderFromPidl(pidlTmp); 321 307 } 322 323 324 /* Retrieve the IShellFolder interface of the pidl specified folder */ 325 if(!psfTmp) 326 return E_FAIL; 327 328 /* If the pidl to browse to is equal to the actual pidl ... 308 309 if(!psfTmp) return E_FAIL; 310 311 /* If the pidl to browse to is equal to the actual pidl ... 329 312 do nothing and pretend you did it*/ 330 313 if(COMDLG32_PIDL_ILIsEqual(pidlTmp,fodInfos->ShellInfos.pidlAbsCurrent)) 331 314 { 332 315 IShellFolder_Release(psfTmp); 333 316 COMDLG32_SHFree(pidlTmp); 334 317 return NOERROR; 335 318 } 336 #ifdef SHELL_NO_DESKTOP 337 338 if(pidlTmp->mkid.cb == 0x00) 339 { 340 IShellFolder_Release(psfTmp); 341 COMDLG32_SHFree(pidlTmp); 342 return NOERROR; 343 } 344 #endif 345 346 /* Release the current fodInfos->Shell.FOIShellFolder and update its value */ 347 IShellFolder_Release(fodInfos->Shell.FOIShellFolder); 319 320 /* Release the current DataObject */ 321 if (fodInfos->Shell.FOIDataObject) 322 { 323 IDataObject_Release(fodInfos->Shell.FOIDataObject); 324 fodInfos->Shell.FOIDataObject = NULL; 325 } 326 327 /* Create the associated view */ 328 if(FAILED(hRes = IShellFolder_CreateViewObject(psfTmp, fodInfos->ShellInfos.hwndOwner, 329 &IID_IShellView, (LPVOID *)&psvTmp))) return hRes; 330 331 /* Check if listview has focus */ 332 bViewHasFocus = IsChild(fodInfos->ShellInfos.hwndView,GetFocus()); 333 334 /* Get the foldersettings from the old view */ 335 if(fodInfos->Shell.FOIShellView) 336 IShellView_GetCurrentInfo(fodInfos->Shell.FOIShellView, &fodInfos->ShellInfos.folderSettings); 337 338 /* Release the old fodInfos->Shell.FOIShellView and update its value. 339 We have to update this early since ShellView_CreateViewWindow of native 340 shell32 calls OnStateChange and needs the correct view here.*/ 341 if(fodInfos->Shell.FOIShellView) 342 { 343 IShellView_DestroyViewWindow(fodInfos->Shell.FOIShellView); 344 IShellView_Release(fodInfos->Shell.FOIShellView); 345 } 346 fodInfos->Shell.FOIShellView = psvTmp; 347 348 /* Release old FOIShellFolder and update its value */ 349 if (fodInfos->Shell.FOIShellFolder) 350 IShellFolder_Release(fodInfos->Shell.FOIShellFolder); 348 351 fodInfos->Shell.FOIShellFolder = psfTmp; 349 352 350 /* Create the associated view */ 351 if(SUCCEEDED(hRes = IShellFolder_CreateViewObject(psfTmp, 352 fodInfos->ShellInfos.hwndOwner, 353 &IID_IShellView, 354 (LPVOID *)&psvTmp))) 355 { 356 HWND hwndView; 357 HWND hDlgWnd; 358 BOOL bViewHasFocus; 359 360 /* Check if listview has focus */ 361 bViewHasFocus = IsChild(fodInfos->ShellInfos.hwndView,GetFocus()); 362 363 /* Get the foldersettings from the old view */ 364 if(fodInfos->Shell.FOIShellView) 365 { 366 IShellView_GetCurrentInfo(fodInfos->Shell.FOIShellView, 367 &fodInfos->ShellInfos.folderSettings); 368 } 369 370 /* Create the window */ 371 if(SUCCEEDED(hRes = IShellView_CreateViewWindow(psvTmp, 372 NULL, 373 &fodInfos->ShellInfos.folderSettings, 374 fodInfos->Shell.FOIShellBrowser, 375 &fodInfos->ShellInfos.rectView, 376 &hwndView))) 377 { 378 /* Fit the created view in the appropriate RECT */ 379 MoveWindow(hwndView, 380 fodInfos->ShellInfos.rectView.left, 381 fodInfos->ShellInfos.rectView.top, 382 fodInfos->ShellInfos.rectView.right-fodInfos->ShellInfos.rectView.left, 383 fodInfos->ShellInfos.rectView.bottom-fodInfos->ShellInfos.rectView.top, 384 FALSE); 385 386 /* Select the new folder in the Look In combo box of the Open file dialog */ 387 388 FILEDLG95_LOOKIN_SelectItem(fodInfos->DlgInfos.hwndLookInCB,pidlTmp); 389 390 /* Release old pidlAbsCurrent memory and update its value */ 391 COMDLG32_SHFree((LPVOID)fodInfos->ShellInfos.pidlAbsCurrent); 392 fodInfos->ShellInfos.pidlAbsCurrent = pidlTmp; 393 394 /* Release the current fodInfos->Shell.FOIShellView and update its value */ 395 if(fodInfos->Shell.FOIShellView) 396 { 397 IShellView_DestroyViewWindow(fodInfos->Shell.FOIShellView); 398 IShellView_Release(fodInfos->Shell.FOIShellView); 399 } 400 #if 0 401 ShowWindow(fodInfos->ShellInfos.hwndView,SW_HIDE); 402 #endif 403 fodInfos->Shell.FOIShellView = psvTmp; 404 405 fodInfos->ShellInfos.hwndView = hwndView; 406 407 /* changes the tab order of the ListView to reflect the window's File Dialog */ 408 hDlgWnd = GetDlgItem(GetParent(hwndView), IDC_LOOKIN); 409 SetWindowPos(hwndView, hDlgWnd, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE); 410 411 /* Since we destroyed the old view if it had focus set focus 412 to the newly created view */ 413 if (bViewHasFocus) 414 SetFocus(fodInfos->ShellInfos.hwndView); 415 416 return NOERROR; 417 } 418 } 419 353 /* Release old pidlAbsCurrent and update its value */ 354 COMDLG32_SHFree((LPVOID)fodInfos->ShellInfos.pidlAbsCurrent); 355 fodInfos->ShellInfos.pidlAbsCurrent = pidlTmp; 356 357 /* Create the window */ 358 TRACE("create view window\n"); 359 if(FAILED(hRes = IShellView_CreateViewWindow(psvTmp, NULL, 360 &fodInfos->ShellInfos.folderSettings, fodInfos->Shell.FOIShellBrowser, 361 &fodInfos->ShellInfos.rectView, &hwndView))) return hRes; 362 363 fodInfos->ShellInfos.hwndView = hwndView; 364 365 /* Select the new folder in the Look In combo box of the Open file dialog */ 420 366 FILEDLG95_LOOKIN_SelectItem(fodInfos->DlgInfos.hwndLookInCB,fodInfos->ShellInfos.pidlAbsCurrent); 421 return hRes; 367 368 /* changes the tab order of the ListView to reflect the window's File Dialog */ 369 hDlgWnd = GetDlgItem(GetParent(hwndView), IDC_LOOKIN); 370 SetWindowPos(hwndView, hDlgWnd, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE); 371 372 /* Since we destroyed the old view if it had focus set focus to the newly created view */ 373 if (bViewHasFocus) 374 SetFocus(fodInfos->ShellInfos.hwndView); 375 376 return hRes; 422 377 } 423 378 … … 425 380 * IShellBrowserImpl_EnableModelessSB 426 381 */ 427 HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface, 382 HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface, 428 383 BOOL fEnable) 429 384 430 385 { 431 386 ICOM_THIS(IShellBrowserImpl, iface); … … 440 395 * IShellBrowserImpl_GetControlWindow 441 396 */ 442 HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface, 443 UINT id, 397 HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface, 398 UINT id, 444 399 HWND *lphwnd) 445 400 446 401 { 447 402 ICOM_THIS(IShellBrowserImpl, iface); … … 456 411 */ 457 412 HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface, 458 DWORD grfMode, 413 DWORD grfMode, 459 414 LPSTREAM *ppStrm) 460 461 { 462 ICOM_THIS(IShellBrowserImpl, iface); 463 464 TRACE("(%p)\n", This); 465 466 /* Feature not implemented */ 467 return E_NOTIMPL; 468 } 415 416 { 417 ICOM_THIS(IShellBrowserImpl, iface); 418 419 TRACE("(%p)\n", This); 420 421 /* Feature not implemented */ 422 return E_NOTIMPL; 423 } 469 424 /************************************************************************** 470 425 * IShellBrowserImpl_InsertMenusSB … … 473 428 HMENU hmenuShared, 474 429 LPOLEMENUGROUPWIDTHS lpMenuWidths) 475 430 476 431 { 477 432 ICOM_THIS(IShellBrowserImpl, iface); … … 487 442 HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface, 488 443 IShellView *ppshv) 489 490 { 491 ICOM_THIS(IShellBrowserImpl, iface); 492 493 TRACE("(%p)\n", This); 494 495 /* Feature not implemented */ 496 return E_NOTIMPL; 497 } 444 445 { 446 ICOM_THIS(IShellBrowserImpl, iface); 447 448 TRACE("(%p)\n", This); 449 450 /* Feature not implemented */ 451 return E_NOTIMPL; 452 } 498 453 /************************************************************************** 499 454 * IShellBrowserImpl_QueryActiveShellView … … 501 456 HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface, 502 457 IShellView **ppshv) 503 458 504 459 { 505 460 ICOM_THIS(IShellBrowserImpl, iface); … … 517 472 IShellView_AddRef(fodInfos->Shell.FOIShellView); 518 473 return NOERROR; 519 } 474 } 520 475 /************************************************************************** 521 476 * IShellBrowserImpl_RemoveMenusSB … … 523 478 HRESULT WINAPI IShellBrowserImpl_RemoveMenusSB(IShellBrowser *iface, 524 479 HMENU hmenuShared) 525 526 { 527 ICOM_THIS(IShellBrowserImpl, iface); 528 529 TRACE("(%p)\n", This); 530 531 /* Feature not implemented */ 532 return E_NOTIMPL; 533 } 480 481 { 482 ICOM_THIS(IShellBrowserImpl, iface); 483 484 TRACE("(%p)\n", This); 485 486 /* Feature not implemented */ 487 return E_NOTIMPL; 488 } 534 489 /************************************************************************** 535 490 * IShellBrowserImpl_SendControlMsg 536 491 */ 537 HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface, 538 UINT id, 539 UINT uMsg, 540 WPARAM wParam, 492 HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface, 493 UINT id, 494 UINT uMsg, 495 WPARAM wParam, 541 496 LPARAM lParam, 542 497 LRESULT *pret) 543 498 544 499 { 545 500 ICOM_THIS(IShellBrowserImpl, iface); 546 501 LRESULT lres; 547 502 548 503 TRACE("(%p)->(0x%08x 0x%08x 0x%08x 0x%08lx %p)\n", This, id, uMsg, wParam, lParam, pret); 549 504 … … 552 507 case FCW_TOOLBAR: 553 508 lres = SendDlgItemMessageA( This->hwndOwner, IDC_TOOLBAR, uMsg, wParam, lParam); 554 509 break; 555 510 default: 556 511 FIXME("ctrl id: %x\n", id); … … 564 519 */ 565 520 HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface, 566 HMENU hmenuShared, 521 HMENU hmenuShared, 567 522 HOLEMENU holemenuReserved, 568 523 HWND hwndActiveObject) 569 570 { 571 ICOM_THIS(IShellBrowserImpl, iface); 572 573 TRACE("(%p)\n", This); 574 575 /* Feature not implemented */ 576 return E_NOTIMPL; 577 } 524 525 { 526 ICOM_THIS(IShellBrowserImpl, iface); 527 528 TRACE("(%p)\n", This); 529 530 /* Feature not implemented */ 531 return E_NOTIMPL; 532 } 578 533 /************************************************************************** 579 534 * IShellBrowserImpl_SetStatusTextSB … … 581 536 HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface, 582 537 LPCOLESTR lpszStatusText) 583 584 { 585 ICOM_THIS(IShellBrowserImpl, iface); 586 587 TRACE("(%p)\n", This); 588 589 /* Feature not implemented */ 590 return E_NOTIMPL; 591 } 538 539 { 540 ICOM_THIS(IShellBrowserImpl, iface); 541 542 TRACE("(%p)\n", This); 543 544 /* Feature not implemented */ 545 return E_NOTIMPL; 546 } 592 547 /************************************************************************** 593 548 * IShellBrowserImpl_SetToolbarItems 594 549 */ 595 550 HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface, 596 LPTBBUTTON lpButtons, 597 UINT nButtons, 551 LPTBBUTTON lpButtons, 552 UINT nButtons, 598 553 UINT uFlags) 599 600 { 601 ICOM_THIS(IShellBrowserImpl, iface); 602 603 TRACE("(%p)\n", This); 604 605 /* Feature not implemented */ 606 return E_NOTIMPL; 607 } 554 555 { 556 ICOM_THIS(IShellBrowserImpl, iface); 557 558 TRACE("(%p)\n", This); 559 560 /* Feature not implemented */ 561 return E_NOTIMPL; 562 } 608 563 /************************************************************************** 609 564 * IShellBrowserImpl_TranslateAcceleratorSB 610 565 */ 611 566 HRESULT WINAPI IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser *iface, 612 LPMSG lpmsg, 567 LPMSG lpmsg, 613 568 WORD wID) 614 569 615 570 { 616 571 ICOM_THIS(IShellBrowserImpl, iface); … … 630 585 */ 631 586 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(ICommDlgBrowser *iface, 632 REFIID riid, 587 REFIID riid, 633 588 LPVOID *ppvObj) 634 589 { … … 678 633 TRACE("(%p)\n", This); 679 634 680 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); 681 635 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); 636 682 637 /* If the selected object is not a folder, send a IDOK command to parent window */ 683 pidl = GetSelectedPidl(ppshv); 684 if (pidl) 638 if((pidl = GetPidlFromDataObject(fodInfos->Shell.FOIDataObject, 1))) 685 639 { 686 640 HRESULT hRes; … … 688 642 ULONG ulAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER; 689 643 IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr); 690 if (ulAttr) 691 hRes = IShellBrowser_BrowseObject((IShellBrowser *)This,pidl,SBSP_RELATIVE); 692 /* Tell the dialog that the user selected a file */ 644 if (ulAttr & (SFGAO_FOLDER | SFGAO_HASSUBFOLDER) ) 645 { 646 hRes = IShellBrowser_BrowseObject((IShellBrowser *)This,pidl,SBSP_RELATIVE); 647 } 693 648 else 694 { 695 hRes = PostMessageA(This->hwndOwner, WM_COMMAND, IDOK, 0L); 696 } 649 { 650 /* Tell the dialog that the user selected a file */ 651 hRes = PostMessageA(This->hwndOwner, WM_COMMAND, IDOK, 0L); 652 } 697 653 698 654 /* Free memory used by pidl */ … … 715 671 _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface); 716 672 717 TRACE("(%p )\n", This);673 TRACE("(%p shv=%p)\n", This, ppshv); 718 674 719 675 switch (uChange) … … 721 677 case CDBOSC_SETFOCUS: 722 678 /* FIXME: Reset the default button. 723 724 725 679 This should be taken care of by defdlg. If control 680 other than button receives focus the default button 681 should be restored. */ 726 682 SendMessageA(This->hwndOwner, DM_SETDEFID, IDOK, 0); 683 727 684 break; 728 case CDBOSC_KILLFOCUS: 729 730 731 732 685 case CDBOSC_KILLFOCUS: 686 { 687 FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); 688 if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) 689 SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner,IDOK,"&Save"); 733 690 } 734 691 break; … … 736 693 return IShellBrowserImpl_ICommDlgBrowser_OnSelChange(iface,ppshv); 737 694 case CDBOSC_RENAME: 695 /* nothing to do */ 738 696 break; 739 697 } 740 698 741 return NOERROR; 699 return NOERROR; 700 } 701 702 /* copied from shell32 to avoid linking to it */ 703 static HRESULT COMDLG32_StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl) 704 { 705 TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl); 706 707 switch (src->uType) 708 { 709 case STRRET_WSTR: 710 lstrcpynW((LPWSTR)dest, src->u.pOleStr, len); 711 COMDLG32_SHFree(src->u.pOleStr); 712 break; 713 714 case STRRET_CSTRA: 715 lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len); 716 break; 717 718 case STRRET_OFFSETA: 719 if (pidl) 720 { 721 lstrcpynAtoW((LPWSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len); 722 } 723 break; 724 725 default: 726 FIXME("unknown type!\n"); 727 if (len) 728 { *(LPSTR)dest = '\0'; 729 } 730 return(FALSE); 731 } 732 return S_OK; 742 733 } 743 734 /************************************************************************** 744 735 * IShellBrowserImpl_ICommDlgBrowser_IncludeObject 745 736 */ 746 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface, 737 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface, 747 738 IShellView * ppshv, 748 739 LPCITEMIDLIST pidl) … … 756 747 757 748 TRACE("(%p)\n", This); 758 //CB: slow!!! 749 759 750 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); 760 751 761 752 ulAttr = SFGAO_HIDDEN | SFGAO_FOLDER | SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR | SFGAO_LINK; 762 753 IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidl, &ulAttr); 763 754 764 755 if( (ulAttr & SFGAO_HIDDEN) /* hidden */ 765 756 | !(ulAttr & (SFGAO_FILESYSTEM | SFGAO_FILESYSANCESTOR))) /* special folder */ 766 757 return S_FALSE; 758 767 759 /* always include directorys and links */ 768 if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK)) 760 if(ulAttr & (SFGAO_FOLDER | SFGAO_LINK)) 769 761 return S_OK; 762 770 763 /* Check if there is a mask to apply if not */ 771 if(!fodInfos->ShellInfos.lpstrCurrentFilter || 772 !lstrlenW(fodInfos->ShellInfos.lpstrCurrentFilter)) 764 if(!fodInfos->ShellInfos.lpstrCurrentFilter || !lstrlenW(fodInfos->ShellInfos.lpstrCurrentFilter)) 773 765 return S_OK; 774 766 775 if (SUCCEEDED(IShellFolder_GetDisplayNameOf(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_ FORPARSING, &str)))776 { 777 if (SUCCEEDED( StrRetToBufW(&str, pidl,szPathW, MAX_PATH)))767 if (SUCCEEDED(IShellFolder_GetDisplayNameOf(fodInfos->Shell.FOIShellFolder, pidl, SHGDN_INFOLDER | SHGDN_FORPARSING, &str))) 768 { 769 if (SUCCEEDED(COMDLG32_StrRetToStrNW(szPathW, MAX_PATH, &str, pidl))) 778 770 { 779 780 771 if (COMDLG32_PathMatchSpecW(szPathW, fodInfos->ShellInfos.lpstrCurrentFilter)) 772 return S_OK; 781 773 } 782 774 } 783 775 return S_FALSE; 776 784 777 } 785 778 786 779 /************************************************************************** 787 780 * IShellBrowserImpl_ICommDlgBrowser_OnSelChange 788 */ 781 */ 789 782 HRESULT IShellBrowserImpl_ICommDlgBrowser_OnSelChange(ICommDlgBrowser *iface, IShellView *ppshv) 790 783 { 791 ULONG uAttr;792 784 FileOpenDlgInfos *fodInfos; 793 UINT nFiles = 0; /* Intial to zero */794 UINT nCurrLength;795 UINT nFileToOpen;796 UINT nAllLength = 2; /* Include intial '"' and final NULL */797 UINT nSize = MAX_PATH;798 UINT nFileSelected = 0;799 LPITEMIDLIST pidlSelection;800 LPSTR lpstrTemp = NULL;801 LPSTR lpstrAllFile = NULL;802 char lpstrCurrFile[MAX_PATH];803 785 804 786 _ICOM_THIS_FromICommDlgBrowser(IShellBrowserImpl,iface); 805 787 806 788 fodInfos = (FileOpenDlgInfos *) GetPropA(This->hwndOwner,FileOpenDlgInfosStr); 807 TRACE("(%p)\n", This); 808 809 /* Locate memory and Get selected item counter */ 810 if((lpstrAllFile = (LPSTR)SHAlloc(nSize * sizeof(char))) != NULL) 811 { 812 ZeroMemory(lpstrAllFile, nSize * sizeof(char)); 813 *lpstrAllFile = '\"'; 814 lpstrTemp = lpstrAllFile + 1; 815 nFileSelected = GetNumSelected(fodInfos->Shell.FOIShellView); /* Get all selected counter */ 816 } 817 818 /* Count all selected files we have */ 819 for(nFileToOpen = 0; nFileToOpen < nFileSelected; nFileToOpen++) 820 { /* get the file selected */ 821 pidlSelection = NULL; 822 uAttr = SFGAO_FOLDER | SFGAO_HASSUBFOLDER; 823 ZeroMemory(lpstrCurrFile, MAX_PATH * sizeof(char)); 824 EnumSelectedPidls(fodInfos->Shell.FOIShellView, nFileToOpen, &pidlSelection); 825 826 /* get the file name and attrib of the selected files*/ 827 GetName(fodInfos->Shell.FOIShellFolder, pidlSelection, SHGDN_NORMAL, lpstrCurrFile); 828 IShellFolder_GetAttributesOf(fodInfos->Shell.FOIShellFolder, 1, &pidlSelection, &uAttr); 829 COMDLG32_SHFree((LPVOID) pidlSelection); 830 831 if(!uAttr) 832 { /* Get the new file name */ 833 nCurrLength = lstrlenA(lpstrCurrFile); 834 if(nAllLength + nCurrLength + 3 > nSize) 835 { /* increase the memory and transfer string to new location */ 836 nSize += MAX_PATH; 837 if((lpstrTemp = (LPSTR)SHAlloc(nSize * sizeof(char))) != NULL) 838 { /* Transfer old file names */ 839 ZeroMemory(lpstrTemp, nSize * sizeof(char)); 840 lstrcpyA(lpstrTemp, lpstrAllFile); 841 SHFree(lpstrAllFile); 842 lpstrAllFile = lpstrTemp; 843 lpstrTemp = lpstrAllFile + nAllLength - 1; 844 } 845 else 846 { /* if failure, stop the loop to get filename */ 847 nFileSelected = 0; 848 } 849 } 850 851 if(lpstrTemp != NULL) 852 { /* Add the new file name */ 853 nFiles++; 854 lstrcpyA(lpstrTemp, lpstrCurrFile); 855 *(lpstrTemp + nCurrLength) = '\"'; 856 *(lpstrTemp + nCurrLength + 1) = ' '; 857 *(lpstrTemp + nCurrLength + 2) = '\"'; 858 nAllLength += nCurrLength + 3; 859 lpstrTemp = lpstrAllFile + nAllLength - 1; 860 } 861 } 862 } 863 864 if(lpstrAllFile) 865 { 866 if(nFiles > 1) 867 { 868 *(lpstrTemp - 2) = '\0'; 869 SetWindowTextA(fodInfos->DlgInfos.hwndFileName, lpstrAllFile); 870 } 871 else 872 { 873 *(lpstrTemp - 3) = '\0'; 874 SetWindowTextA(fodInfos->DlgInfos.hwndFileName, lpstrAllFile + 1); 875 } 876 877 fodInfos->DlgInfos.dwDlgProp |= FODPROP_USEVIEW; 878 SendCustomDlgNotificationMessage(This->hwndOwner, CDN_SELCHANGE); 879 SHFree( lpstrAllFile ); 880 } 881 else 882 { 883 SetWindowTextA(fodInfos->DlgInfos.hwndFileName, ""); 884 } 885 886 if(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) 887 SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner, IDOK, "&Save"); 888 else 889 SetDlgItemTextA(fodInfos->ShellInfos.hwndOwner, IDOK, "&Open"); 890 891 fodInfos->DlgInfos.dwDlgProp &= ~FODPROP_USEVIEW; 892 893 return nFileSelected ? S_OK : E_FAIL; 894 } 895 896 /*********************************************************************** 897 * GetSelectedPidl 898 * 899 * Return the pidl of the first selected item in the view 900 */ 901 LPITEMIDLIST GetSelectedPidl(IShellView *ppshv) 902 { 903 904 IDataObject *doSelected; 905 LPITEMIDLIST pidlSelected = NULL; 906 907 TRACE("sv=%p\n", ppshv); 908 909 /* Get an IDataObject from the view */ 910 if(SUCCEEDED(IShellView_GetItemObject(ppshv, 911 SVGIO_SELECTION, 912 &IID_IDataObject, 913 (LPVOID *)&doSelected))) 914 { 915 STGMEDIUM medium; 916 FORMATETC formatetc; 917 918 /* Set the FORMATETC structure*/ 919 SETDefFormatEtc(formatetc, 920 RegisterClipboardFormatA(CFSTR_SHELLIDLIST), 921 TYMED_HGLOBAL); 922 923 /* Get the pidl from IDataObject */ 924 if(SUCCEEDED(IDataObject_GetData(doSelected,&formatetc,&medium))) 925 { 926 LPIDA cida = GlobalLock(medium.u.hGlobal); 927 TRACE("cida=%p\n", cida); 928 pidlSelected = COMDLG32_PIDL_ILClone((LPITEMIDLIST)(&((LPBYTE)cida)[cida->aoffset[1]])); 929 930 if(medium.pUnkForRelease) 931 IUnknown_Release(medium.pUnkForRelease); 932 else 933 { 934 GlobalUnlock(medium.u.hGlobal); 935 GlobalFree(medium.u.hGlobal); 936 } 937 } 938 IDataObject_Release(doSelected); 939 return pidlSelected; 940 } 941 942 return NULL; 943 } 944 945 /*********************************************************************** 946 * EnumSelectedPidls 947 * 948 * Return the pidl(s) of the selected item(s) in the view. 949 * 950 */ 951 BOOL EnumSelectedPidls( IShellView *ppshv, /*[in]*/ 952 UINT nPidlIndex, /*[in]*/ 953 LPITEMIDLIST *pidlSelected /*[out]*/ ) 954 { 955 956 IDataObject *doSelected; 957 BOOL retVal = TRUE; 958 959 /* Get an IDataObject from the view */ 960 if(SUCCEEDED(IShellView_GetItemObject(ppshv, 961 SVGIO_SELECTION, 962 &IID_IDataObject, 963 (LPVOID *)&doSelected))) 964 { 965 STGMEDIUM medium; 966 FORMATETC formatetc; 967 968 /* Set the FORMATETC structure*/ 969 SETDefFormatEtc(formatetc, 970 RegisterClipboardFormatA(CFSTR_SHELLIDLIST), 971 TYMED_HGLOBAL); 972 973 /* Get the pidls from IDataObject */ 974 if(SUCCEEDED(IDataObject_GetData(doSelected,&formatetc,&medium))) 975 { 976 LPIDA cida = GlobalLock(medium.u.hGlobal); 977 if(nPidlIndex < cida->cidl) 978 { 979 *pidlSelected = COMDLG32_PIDL_ILClone((LPITEMIDLIST)(&((LPBYTE)cida)[cida->aoffset[nPidlIndex + 1]])); 980 } 981 else 982 { 983 retVal = FALSE; 984 } 985 986 if(medium.pUnkForRelease) 987 { 988 IUnknown_Release(medium.pUnkForRelease); 989 } 990 else 991 { 992 GlobalUnlock(medium.u.hGlobal); 993 GlobalFree(medium.u.hGlobal); 994 } 995 } 996 IDataObject_Release(doSelected); 997 return retVal; 998 } 999 return FALSE; 1000 } 1001 1002 /*********************************************************************** 1003 * GetNumSelected 1004 * 1005 * Return the number of selected items in the view. 1006 * 1007 */ 1008 UINT GetNumSelected( IShellView *ppshv ) 1009 { 1010 IDataObject *doSelected; 1011 UINT retVal = 0; 1012 1013 /* Get an IDataObject from the view */ 1014 if(SUCCEEDED(IShellView_GetItemObject(ppshv, 1015 SVGIO_SELECTION, 1016 &IID_IDataObject, 1017 (LPVOID *)&doSelected))) 1018 { 1019 STGMEDIUM medium; 1020 FORMATETC formatetc; 1021 1022 /* Set the FORMATETC structure*/ 1023 SETDefFormatEtc(formatetc, 1024 RegisterClipboardFormatA(CFSTR_SHELLIDLIST), 1025 TYMED_HGLOBAL); 1026 1027 /* Get the pidls from IDataObject */ 1028 if(SUCCEEDED(IDataObject_GetData(doSelected,&formatetc,&medium))) 1029 { 1030 LPIDA cida = GlobalLock(medium.u.hGlobal); 1031 retVal = cida->cidl; 1032 1033 if(medium.pUnkForRelease) 1034 IUnknown_Release(medium.pUnkForRelease); 1035 else 1036 { 1037 GlobalUnlock(medium.u.hGlobal); 1038 GlobalFree(medium.u.hGlobal); 1039 } 1040 } 1041 IDataObject_Release(doSelected); 1042 return retVal; 1043 } 1044 1045 return 0; 1046 } 1047 1048 1049 789 TRACE("(%p do=%p view=%p)\n", This, fodInfos->Shell.FOIDataObject, fodInfos->Shell.FOIShellView); 790 791 /* release old selections */ 792 if (fodInfos->Shell.FOIDataObject) 793 IDataObject_Release(fodInfos->Shell.FOIDataObject); 794 795 /* get a new DataObject from the ShellView */ 796 if(FAILED(IShellView_GetItemObject(fodInfos->Shell.FOIShellView, SVGIO_SELECTION, 797 &IID_IDataObject, (LPVOID*)&fodInfos->Shell.FOIDataObject))) 798 return E_FAIL; 799 800 FILEDLG95_FILENAME_FillFromSelection(This->hwndOwner); 801 802 SendCustomDlgNotificationMessage(This->hwndOwner, CDN_SELCHANGE); 803 return S_OK; 804 } 805 -
trunk/src/comdlg32/filedlgbrowser.h
r3243 r4511 1 1 /* 2 2 * Implementation of IShellBrowser for the File Open common dialog 3 * 3 4 * 4 * Corel WINE 20000324 level5 5 */ 6 6 … … 21 21 22 22 #define FODPROP_SAVEDLG 0x0001 /* File dialog is a Save file dialog */ 23 #define FODPROP_USEVIEW 0x0002 /* Indicates the user selection must be taken 24 23 #define FODPROP_USEVIEW 0x0002 /* Indicates the user selection must be taken 24 from the IShellView */ 25 25 26 26 /*********************************************************************** … … 41 41 typedef struct 42 42 { 43 43 44 44 LPOPENFILENAMEA ofnInfos; 45 45 struct { 46 IShellBrowser *FOIShellBrowser; 46 IShellBrowser *FOIShellBrowser; 47 47 IShellFolder *FOIShellFolder; 48 48 IShellView *FOIShellView; 49 IDataObject *FOIDataObject; 49 50 } Shell; 50 51 … … 62 63 HWND hwndLookInCB; 63 64 HWND hwndFileName; 64 65 HWND hwndTB; 65 66 HWND hwndCustomDlg; 66 67 DWORD dwDlgProp; 67 68 } DlgInfos; 68 69 … … 72 73 * Control ID's 73 74 */ 75 #define IDS_ABOUTBOX 101 76 #define IDS_DOCUMENTFOLDERS 102 77 #define IDS_PERSONAL 103 78 #define IDS_FAVORITES 104 79 #define IDS_PATH 105 80 #define IDS_DESKTOP 106 81 82 #define IDS_FONTS 108 83 #define IDS_MYCOMPUTER 110 84 #define IDS_SYSTEMFOLDERS 112 85 #define IDS_LOCALHARDRIVES 113 74 86 #define IDS_FILENOTFOUND 114 75 87 #define IDS_VERIFYFILE 115 … … 77 89 #define IDS_CREATEFOLDER_DENIED 117 78 90 #define IDS_FILEOPEN_CAPTION 118 91 #define IDL_OVERWRITEFILE 119 92 #define IDS_INVALID_FILENAME_TITLE 120 93 #define IDS_INVALID_FILENAME 121 94 #define IDS_PATHNOTEXISTING 122 95 #define IDS_FILENOTEXISTING 123 79 96 80 97 /* File Dialog Tooltips string IDs */ … … 84 101 #define IDS_LISTVIEW 152 85 102 #define IDS_REPORTVIEW 153 103 #define IDS_TODESKTOP 154 86 104 87 105 #define IDC_OPENREADONLY chx1 88 106 89 #define IDC_TOOLBARSTATIC 107 #define IDC_TOOLBARSTATIC stc1 90 108 #define IDC_FILETYPESTATIC stc2 91 109 #define IDC_FILENAMESTATIC stc3 … … 99 117 #define IDC_FILENAME edt1 100 118 101 #define IDC_TOOLBAR 119 #define IDC_TOOLBAR ctl1 102 120 103 121 /*********************************************************************** … … 109 127 /* IUnknown */ 110 128 HRESULT WINAPI IShellBrowserImpl_QueryInterface(IShellBrowser *iface, 111 REFIID riid, 129 REFIID riid, 112 130 LPVOID *ppvObj); 113 131 … … 117 135 118 136 /* IOleWindow */ 119 HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface, 137 HRESULT WINAPI IShellBrowserImpl_GetWindow(IShellBrowser * iface, 120 138 HWND * phwnd); 121 139 … … 125 143 /* IShellBrowser */ 126 144 127 HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface, 128 LPCITEMIDLIST pidl, 145 HRESULT WINAPI IShellBrowserImpl_BrowseObject(IShellBrowser *iface, 146 LPCITEMIDLIST pidl, 129 147 UINT wFlags); 130 148 131 HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface, 149 HRESULT WINAPI IShellBrowserImpl_EnableModelessSB(IShellBrowser *iface, 132 150 BOOL fEnable); 133 134 HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface, 135 UINT id, 151 152 HRESULT WINAPI IShellBrowserImpl_GetControlWindow(IShellBrowser *iface, 153 UINT id, 136 154 HWND *lphwnd); 137 155 138 156 HRESULT WINAPI IShellBrowserImpl_GetViewStateStream(IShellBrowser *iface, 139 DWORD grfMode, 157 DWORD grfMode, 140 158 LPSTREAM *ppStrm); 141 159 … … 146 164 HRESULT WINAPI IShellBrowserImpl_OnViewWindowActive(IShellBrowser *iface, 147 165 IShellView *ppshv); 148 166 149 167 150 168 HRESULT WINAPI IShellBrowserImpl_QueryActiveShellView(IShellBrowser *iface, … … 154 172 HMENU hmenuShared); 155 173 156 HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface, 157 UINT id, 158 UINT uMsg, 159 WPARAM wParam, 174 HRESULT WINAPI IShellBrowserImpl_SendControlMsg(IShellBrowser *iface, 175 UINT id, 176 UINT uMsg, 177 WPARAM wParam, 160 178 LPARAM lParam, 161 179 LRESULT *pret); 162 180 163 181 HRESULT WINAPI IShellBrowserImpl_SetMenuSB(IShellBrowser *iface, 164 HMENU hmenuShared, 182 HMENU hmenuShared, 165 183 HOLEMENU holemenuReserved, 166 184 HWND hwndActiveObject); … … 168 186 HRESULT WINAPI IShellBrowserImpl_SetStatusTextSB(IShellBrowser *iface, 169 187 LPCOLESTR lpszStatusText); 170 188 171 189 172 190 HRESULT WINAPI IShellBrowserImpl_SetToolbarItems(IShellBrowser *iface, 173 LPTBBUTTON lpButtons, 174 UINT nButtons, 191 LPTBBUTTON lpButtons, 192 UINT nButtons, 175 193 UINT uFlags); 176 194 177 195 HRESULT WINAPI IShellBrowserImpl_TranslateAcceleratorSB(IShellBrowser *iface, 178 LPMSG lpmsg, 196 LPMSG lpmsg, 179 197 WORD wID); 180 198 … … 183 201 184 202 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_QueryInterface(ICommDlgBrowser *iface, 185 REFIID riid, 203 REFIID riid, 186 204 LPVOID *ppvObj); 187 205 … … 197 215 ULONG uChange); 198 216 199 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface, 217 HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *iface, 200 218 IShellView * ppshv, 201 219 LPCITEMIDLIST pidl); 202 220 203 221 204 205 LPITEMIDLIST GetSelectedPidl(IShellView *ppshv); 206 BOOL EnumSelectedPidls(IShellView *ppshv, UINT nPidlIndex, LPITEMIDLIST *pidlSelected); 207 UINT GetNumSelected(IShellView *ppshv); 222 LPITEMIDLIST GetPidlFromDataObject ( IDataObject *doSelected, UINT nPidlIndex); 223 UINT GetNumSelected(IDataObject *doSelected); 224 225 /* pidl handling */ 226 BOOL IsPidlFolder (LPSHELLFOLDER psf, LPITEMIDLIST pidl); 227 228 /* Functions used by the EDIT box */ 229 void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd); 230 int FILEDLG95_FILENAME_GetFileNames (HWND hwnd, LPSTR * lpstrFileList, UINT * sizeUsed); 208 231 209 232 #endif /*SHBROWSER_H*/ -
trunk/src/comdlg32/filetitle.c
r3924 r4511 1 /* $Id: filetitle.c,v 1.3 2000-08-02 15:11:59 bird Exp $ */2 1 /* 3 2 * COMMDLG - File Dialogs … … 5 4 * Copyright 1994 Martin Ayotte 6 5 * Copyright 1996 Albrecht Kleine 7 *8 * Corel WINE 20000324 level9 6 */ 10 7 … … 16 13 #include "debugtools.h" 17 14 18 #include "heap.h" 15 #include "heap.h" /* Has to go */ 19 16 20 17 DEFAULT_DEBUG_CHANNEL(commdlg) … … 22 19 #include "cdlg.h" 23 20 24 #ifdef __WIN32OS2__25 #include <misc.h>26 #endif27 28 21 /*********************************************************************** 29 * GetFileTitleA(COMDLG32.8)22 * GetFileTitleA (COMDLG32.8) 30 23 * 31 24 */ 32 25 short WINAPI GetFileTitleA(LPCSTR lpFile, LPSTR lpTitle, UINT cbBuf) 33 26 { 34 27 int i, len; 35 28 36 29 TRACE("(%p %p %d); \n", lpFile, lpTitle, cbBuf); 37 30 38 if(lpFile == NULL || (lpTitle == NULL))39 31 if(lpFile == NULL || lpTitle == NULL) 32 return -1; 40 33 41 34 len = strlen(lpFile); 42 35 43 44 36 if (len == 0) 37 return -1; 45 38 46 47 39 if(strpbrk(lpFile, "*[]")) 40 return -1; 48 41 49 42 len--; 50 43 51 52 44 if(lpFile[len] == '/' || lpFile[len] == '\\' || lpFile[len] == ':') 45 return -1; 53 46 54 55 56 57 58 59 60 61 47 for(i = len; i >= 0; i--) 48 { 49 if (lpFile[i] == '/' || lpFile[i] == '\\' || lpFile[i] == ':') 50 { 51 i++; 52 break; 53 } 54 } 62 55 63 64 56 if(i == -1) 57 i++; 65 58 66 TRACE("---> '%s' \n", &lpFile[i]); 59 TRACE("---> '%s' \n", &lpFile[i]); 60 61 len = strlen(lpFile+i)+1; 62 if(cbBuf < len) 63 return len; 67 64 68 len = strlen(lpFile+i)+1; 69 if(cbBuf < len) 70 return len; 71 72 strncpy(lpTitle,&lpFile[i],len); 73 return 0; 65 strncpy(lpTitle, &lpFile[i], len); 66 return 0; 74 67 } 75 68 76 69 77 70 /*********************************************************************** 78 * GetFileTitleW(COMDLG32.9)71 * GetFileTitleW (COMDLG32.9) 79 72 * 80 73 */ 81 74 short WINAPI GetFileTitleW(LPCWSTR lpFile, LPWSTR lpTitle, UINT cbBuf) 82 75 { 83 LPSTR file = HEAP_strdupWtoA(GetProcessHeap(), 0, lpFile);/* Has to go */84 85 shortret;76 LPSTR file = HEAP_strdupWtoA(GetProcessHeap(), 0, lpFile); /* Has to go */ 77 LPSTR title = HeapAlloc(GetProcessHeap(), 0, cbBuf); 78 short ret; 86 79 87 80 ret = GetFileTitleA(file, title, cbBuf); 88 81 89 90 91 92 82 lstrcpynAtoW(lpTitle, title, cbBuf); 83 HeapFree(GetProcessHeap(), 0, file); 84 HeapFree(GetProcessHeap(), 0, title); 85 return ret; 93 86 } 94 87 95 88 89 #ifndef __WIN32OS2__ 96 90 /*********************************************************************** 97 * GetFileTitle16(COMMDLG.27)91 * GetFileTitle16 (COMMDLG.27) 98 92 */ 99 93 short WINAPI GetFileTitle16(LPCSTR lpFile, LPSTR lpTitle, UINT16 cbBuf) 100 94 { 101 95 return GetFileTitleA(lpFile, lpTitle, cbBuf); 102 96 } 97 #endif 103 98 -
trunk/src/comdlg32/makefile
r3864 r4511 1 # $Id: makefile,v 1.1 8 2000-07-19 19:05:05sandervl Exp $1 # $Id: makefile,v 1.19 2000-10-21 18:42:17 sandervl Exp $ 2 2 3 3 # … … 24 24 # Object files. All objects should be prefixed with $(OBJDIR)! 25 25 OBJS = \ 26 $(OBJDIR)\comdlg32.obj \ 26 $(OBJDIR)\colordlg.obj \ 27 $(OBJDIR)\fontdlg.obj \ 27 28 $(OBJDIR)\initterm.obj \ 28 29 $(OBJDIR)\cdlg32.obj \ 30 $(OBJDIR)\filetitle.obj \ 29 31 $(OBJDIR)\finddlg32.obj \ 30 32 $(OBJDIR)\filedlg95.obj \ 33 $(OBJDIR)\comdlg32.obj \ 31 34 $(OBJDIR)\filedlgbrowser.obj \ 32 $(OBJDIR)\filetitle.obj \33 35 $(OBJDIR)\comdlgguid.obj \ 34 36 $(OBJDIR)\rsrc.obj -
trunk/src/comdlg32/rsrc.orc
r3243 r4511 1 /* $Id: rsrc.orc,v 1.3 2000-03-26 16:31:45 cbratschi Exp $ */2 1 /* 3 2 * Top level resource file for Common Dialogs … … 5 4 */ 6 5 6 #include "windef.h" 7 7 #include "winuser.h" 8 8 #include "winnls.h" … … 26 26 * get localized bitmaps for example. 27 27 */ 28 29 /* TODO TODO FIXME30 * The localized resources have be pulled out due to31 * the time required to move some strings from here to32 * shell32.dll. This is something to deal with33 * after release34 */35 #if 036 28 #include "cdlg_Ca.orc" 37 29 #include "cdlg_Cs.orc" 38 30 #include "cdlg_Da.orc" 39 31 #include "cdlg_De.orc" 40 #endif41 32 #include "cdlg_En.orc" 42 #if 043 33 #include "cdlg_Eo.orc" 44 34 #include "cdlg_Es.orc" … … 53 43 #include "cdlg_Pt.orc" 54 44 #include "cdlg_Ru.orc" 45 #include "cdlg_Sk.orc" 55 46 #include "cdlg_Sv.orc" 56 47 #include "cdlg_Wa.orc" 57 # endif48 #include "cdlg_Ja.orc"
Note:
See TracChangeset
for help on using the changeset viewer.