Commit e2f4aefb authored by Juergen Schmied's avatar Juergen Schmied Committed by Alexandre Julliard

- Rewrite of the shell related parts of the dialog to use the already

in shell32implemented functions (ShellFolder/Path*). Eliminated direct file access. - Replaced LoadLibraryA with GetModuleHandleA since comdlg32 is imports some dlls per *.spec file - Most OpenFile Flags (OFN_*) should work properly now - The edit box should work right with all stuff entered in it like ..\temp\file.txt or just c: to change a drive - Optimized DataObject handling - Some bugs fixed, should work with native shell32 again. - Stubs for PrintDlgEx
parent 2e011a52
......@@ -106,16 +106,25 @@ extern BOOL (WINAPI *COMDLG32_PIDL_ILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST);
extern BOOL (WINAPI *COMDLG32_SHGetPathFromIDListA) (LPCITEMIDLIST,LPSTR);
extern HRESULT (WINAPI *COMDLG32_SHGetSpecialFolderLocation)(HWND,INT,LPITEMIDLIST *);
extern DWORD (WINAPI *COMDLG32_SHGetDesktopFolder)(IShellFolder **);
extern DWORD (WINAPI *COMDLG32_SHGetFileInfoA)(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT);
extern DWORD (WINAPI *COMDLG32_SHGetFileInfoA)(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT);
extern LPVOID (WINAPI *COMDLG32_SHAlloc)(DWORD);
extern DWORD (WINAPI *COMDLG32_SHFree)(LPVOID);
extern HRESULT (WINAPI *COMDLG32_SHGetDataFromIDListA)(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID dest, int len);
extern BOOL (WINAPI *COMDLG32_SHGetSpecialFolderPathA)(HWND hwndOwner,LPSTR szPath,DWORD csidl,BOOL bCreate);
/* PATH */
extern BOOL (WINAPI *COMDLG32_PathIsRootA)(LPCSTR x);
extern LPCSTR (WINAPI *COMDLG32_PathFindFilenameA)(LPCSTR path);
extern LPSTR (WINAPI *COMDLG32_PathFindFileNameA)(LPCSTR path);
extern DWORD (WINAPI *COMDLG32_PathRemoveFileSpecA)(LPSTR fn);
extern BOOL (WINAPI *COMDLG32_PathMatchSpecW)(LPCWSTR x, LPCWSTR y);
extern LPSTR (WINAPI *COMDLG32_PathAddBackslashA)(LPSTR path);
extern BOOL (WINAPI *COMDLG32_PathCanonicalizeA)(LPSTR pszBuf, LPCSTR pszPath);
extern int (WINAPI *COMDLG32_PathGetDriveNumberA)(LPCSTR lpszPath);
extern BOOL (WINAPI *COMDLG32_PathIsRelativeA) (LPCSTR lpszPath);
extern LPSTR (WINAPI *COMDLG32_PathFindNextComponentA)(LPCSTR pszPath);
extern LPWSTR (WINAPI *COMDLG32_PathAddBackslashW)(LPWSTR lpszPath);
extern LPVOID (WINAPI *COMDLG32_PathFindExtensionA)(LPCVOID lpszPath);
extern BOOL (WINAPI *COMDLG32_PathAddExtensionA)(LPSTR pszPath,LPCSTR pszExtension);
extern BOOL WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType);
......
......@@ -40,18 +40,27 @@ BOOL (WINAPI *COMDLG32_PIDL_ILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST);
BOOL (WINAPI *COMDLG32_SHGetPathFromIDListA) (LPCITEMIDLIST,LPSTR);
HRESULT (WINAPI *COMDLG32_SHGetSpecialFolderLocation)(HWND,INT,LPITEMIDLIST *);
DWORD (WINAPI *COMDLG32_SHGetDesktopFolder)(IShellFolder **);
DWORD (WINAPI *COMDLG32_SHGetFileInfoA)(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT);
DWORD (WINAPI *COMDLG32_SHGetFileInfoA)(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT);
LPVOID (WINAPI *COMDLG32_SHAlloc)(DWORD);
DWORD (WINAPI *COMDLG32_SHFree)(LPVOID);
HRESULT (WINAPI *COMDLG32_SHGetDataFromIDListA)(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID dest, int len);
HRESULT (WINAPI *COMDLG32_StrRetToBufA)(LPSTRRET,LPITEMIDLIST,LPSTR,DWORD);
HRESULT (WINAPI *COMDLG32_StrRetToBufW)(LPSTRRET,LPITEMIDLIST,LPWSTR,DWORD);
BOOL (WINAPI *COMDLG32_SHGetSpecialFolderPathA)(HWND hwndOwner,LPSTR szPath,DWORD csidl,BOOL bCreate);
/* PATH */
BOOL (WINAPI *COMDLG32_PathIsRootA)(LPCSTR x);
LPCSTR (WINAPI *COMDLG32_PathFindFilenameA)(LPCSTR path);
LPSTR (WINAPI *COMDLG32_PathFindFileNameA)(LPCSTR path);
DWORD (WINAPI *COMDLG32_PathRemoveFileSpecA)(LPSTR fn);
BOOL (WINAPI *COMDLG32_PathMatchSpecW)(LPCWSTR x, LPCWSTR y);
LPSTR (WINAPI *COMDLG32_PathAddBackslashA)(LPSTR path);
BOOL (WINAPI *COMDLG32_PathCanonicalizeA)(LPSTR pszBuf, LPCSTR pszPath);
int (WINAPI *COMDLG32_PathGetDriveNumberA)(LPCSTR lpszPath);
BOOL (WINAPI *COMDLG32_PathIsRelativeA) (LPCSTR lpszPath);
LPSTR (WINAPI *COMDLG32_PathFindNextComponentA)(LPCSTR pszPath);
LPWSTR (WINAPI *COMDLG32_PathAddBackslashW)(LPWSTR lpszPath);
LPVOID (WINAPI *COMDLG32_PathFindExtensionA)(LPCVOID lpszPath);
BOOL (WINAPI *COMDLG32_PathAddExtensionA)(LPSTR pszPath,LPCSTR pszExtension);
/***********************************************************************
* COMDLG32_DllEntryPoint (COMDLG32.entry)
......@@ -95,9 +104,9 @@ BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Res
COMDLG32_TlsIndex = 0xffffffff;
COMCTL32_hInstance = LoadLibraryA("COMCTL32.DLL");
SHELL32_hInstance = LoadLibraryA("SHELL32.DLL");
SHLWAPI_hInstance = LoadLibraryA("SHLWAPI.DLL");
COMCTL32_hInstance = GetModuleHandleA("COMCTL32.DLL");
SHELL32_hInstance = GetModuleHandleA("SHELL32.DLL");
SHLWAPI_hInstance = GetModuleHandleA("SHLWAPI.DLL");
if (!COMCTL32_hInstance || !SHELL32_hInstance || !SHLWAPI_hInstance)
{
......@@ -124,6 +133,10 @@ BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Res
COMDLG32_SHGetPathFromIDListA = (void*)GetProcAddress(SHELL32_hInstance,"SHGetPathFromIDListA");
COMDLG32_SHGetDesktopFolder = (void*)GetProcAddress(SHELL32_hInstance,"SHGetDesktopFolder");
COMDLG32_SHGetFileInfoA = (void*)GetProcAddress(SHELL32_hInstance,"SHGetFileInfoA");
COMDLG32_SHGetDataFromIDListA = (void*)GetProcAddress(SHELL32_hInstance,"SHGetDataFromIDListA");
/* FIXME: we cant import SHGetSpecialFolderPathA from all versions of shell32 */
COMDLG32_SHGetSpecialFolderPathA = (void*)GetProcAddress(SHELL32_hInstance,"SHGetSpecialFolderPathA");
/* ### WARINIG ###
We can't do a GetProcAddress to link to StrRetToBuf[A|W] sine not all
......@@ -136,8 +149,15 @@ BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Res
COMDLG32_PathMatchSpecW = (void*)GetProcAddress(SHLWAPI_hInstance,"PathMatchSpecW");
COMDLG32_PathIsRootA = (void*)GetProcAddress(SHLWAPI_hInstance,"PathIsRootA");
COMDLG32_PathRemoveFileSpecA = (void*)GetProcAddress(SHLWAPI_hInstance,"PathRemoveFileSpecA");
COMDLG32_PathFindFilenameA = (void*)GetProcAddress(SHLWAPI_hInstance,"PathFindFileNameA");
COMDLG32_PathFindFileNameA = (void*)GetProcAddress(SHLWAPI_hInstance,"PathFindFileNameA");
COMDLG32_PathAddBackslashA = (void*)GetProcAddress(SHLWAPI_hInstance,"PathAddBackslashA");
COMDLG32_PathCanonicalizeA = (void*)GetProcAddress(SHLWAPI_hInstance,"PathCanonicalizeA");
COMDLG32_PathGetDriveNumberA = (void*)GetProcAddress(SHLWAPI_hInstance,"PathGetDriveNumberA");
COMDLG32_PathIsRelativeA = (void*)GetProcAddress(SHLWAPI_hInstance,"PathIsRelativeA");
COMDLG32_PathFindNextComponentA = (void*)GetProcAddress(SHLWAPI_hInstance,"PathFindNextComponentA");
COMDLG32_PathAddBackslashW = (void*)GetProcAddress(SHLWAPI_hInstance,"PathAddBackslashW");
COMDLG32_PathFindExtensionA = (void*)GetProcAddress(SHLWAPI_hInstance,"PathFindExtensionA");
COMDLG32_PathAddExtensionA = (void*)GetProcAddress(SHLWAPI_hInstance,"PathAddExtensionA");
break;
case DLL_PROCESS_DETACH:
......@@ -151,9 +171,6 @@ BOOL WINAPI COMDLG32_DllEntryPoint(HINSTANCE hInstance, DWORD Reason, LPVOID Res
FreeLibrary16(COMDLG32_hInstance16);
}
FreeLibrary(COMCTL32_hInstance);
FreeLibrary(SHELL32_hInstance);
FreeLibrary(SHLWAPI_hInstance);
break;
}
return TRUE;
......
......@@ -314,6 +314,11 @@ STRINGTABLE DISCARDABLE
IDS_FILENOTFOUND "File not found"
IDS_VERIFYFILE "Please verify if the correct file name was given"
IDS_CREATEFILE "File does not exist\nDo you want to create file"
IDL_OVERWRITEFILE "File does already exist.\nDo you want to replace it?"
IDS_INVALID_FILENAME_TITLE "Invalid character(s) in path"
IDS_INVALID_FILENAME "A filename cannot contain any of the following characters: \n / : < > |"
IDS_PATHNOTEXISTING "Path does not exist"
IDS_FILENOTEXISTING "File does not exist"
}
STRINGTABLE DISCARDABLE
......
......@@ -5,7 +5,9 @@ rsrc comdlg32
import winspool.drv
import shell32.dll
import shlwapi.dll
import comctl32.dll
import user32.dll
import winspool.drv
0 stub ArrowBtnWndProc
......@@ -33,3 +35,5 @@ import winspool.drv
22 stub dwLBSubclass
23 stub dwOKSubclass
@ stdcall PrintDlgExA(ptr)PrintDlgExA
@ stdcall PrintDlgExW(ptr)PrintDlgExW
......@@ -46,6 +46,7 @@ typedef struct
IShellBrowser *FOIShellBrowser;
IShellFolder *FOIShellFolder;
IShellView *FOIShellView;
IDataObject *FOIDataObject;
} Shell;
struct {
......@@ -87,6 +88,11 @@ typedef struct
#define IDS_CREATEFILE 116
#define IDS_CREATEFOLDER_DENIED 117
#define IDS_FILEOPEN_CAPTION 118
#define IDL_OVERWRITEFILE 119
#define IDS_INVALID_FILENAME_TITLE 120
#define IDS_INVALID_FILENAME 121
#define IDS_PATHNOTEXISTING 122
#define IDS_FILENOTEXISTING 123
/* File Dialog Tooltips string IDs */
......@@ -212,9 +218,14 @@ HRESULT WINAPI IShellBrowserImpl_ICommDlgBrowser_IncludeObject(ICommDlgBrowser *
LPCITEMIDLIST pidl);
LPITEMIDLIST GetPidlFromDataObject ( IDataObject *doSelected, UINT nPidlIndex);
UINT GetNumSelected(IDataObject *doSelected);
LPITEMIDLIST GetSelectedPidl(IShellView *ppshv);
BOOL EnumSelectedPidls(IShellView *ppshv, UINT nPidlIndex, LPITEMIDLIST *pidlSelected);
UINT GetNumSelected(IShellView *ppshv);
/* pidl handling */
BOOL IsPidlFolder (LPSHELLFOLDER psf, LPITEMIDLIST pidl);
/* Functions used by the EDIT box */
void FILEDLG95_FILENAME_FillFromSelection (HWND hwnd);
int FILEDLG95_FILENAME_GetFileNames (HWND hwnd, LPSTR * lpstrFileList, UINT * sizeUsed);
#endif /*SHBROWSER_H*/
......@@ -424,6 +424,7 @@ static void PRINTDLG_UpdatePrinterInfoTexts(HWND hDlg, LPPRINTER_INFO_2A pi)
return;
}
/*******************************************************************
*
* PRINTDLG_ChangePrinter
......@@ -1195,3 +1196,19 @@ BOOL16 WINAPI PrintDlg16( LPPRINTDLG16 lpPrint )
return ret;
}
/***********************************************************************
* PrintDlgExA
*/
HRESULT WINAPI PrintDlgExA(/*LPPRINTDLGEXA*/ LPVOID lpPrintDlgExA)
{
FIXME("stub\n");
return E_NOTIMPL;
}
/***********************************************************************
* PrintDlgExW
*/
HRESULT WINAPI PrintDlgExW(/*LPPRINTDLGEXW*/ LPVOID lpPrintDlgExW)
{
FIXME("stub\n");
return E_NOTIMPL;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment