--- mstools/h/shellapi.h 2018/08/09 18:20:28 1.1 +++ mstools/h/shellapi.h 2018/08/09 18:23:00 1.1.1.3 @@ -1,3 +1,10 @@ +#ifndef _INC_SHELLAPI +#define _INC_SHELLAPI + +#ifdef __cplusplus +extern "C" { +#endif + /* * shell.h * @@ -11,25 +18,70 @@ /* API exports from the library */ -WORD APIENTRY DragQueryFile(HANDLE,WORD,LPSTR,WORD); -BOOL APIENTRY DragQueryPoint(HANDLE,LPPOINT); -VOID APIENTRY DragFinish(HANDLE); +DECLARE_HANDLE(HDROP); + +UINT APIENTRY DragQueryFileW(HDROP,UINT,LPWSTR,UINT); +UINT APIENTRY DragQueryFileA(HDROP,UINT,LPSTR,UINT); + +#ifdef UNICODE +#define DragQueryFile DragQueryFileW +#else +#define DragQueryFile DragQueryFileA +#endif + +BOOL APIENTRY DragQueryPoint(HDROP,LPPOINT); +VOID APIENTRY DragFinish(HDROP); + VOID APIENTRY DragAcceptFiles(HWND,BOOL); -HICON APIENTRY ExtractIcon(HANDLE hInst, LPSTR lpszExeFileName, WORD nIconIndex); +HICON APIENTRY ExtractIconW(HINSTANCE hInst, LPCWSTR lpszExeFileName, UINT nIconIndex); +HICON APIENTRY ExtractIconA(HINSTANCE hInst, LPCSTR lpszExeFileName, UINT nIconIndex); + +#ifdef UNICODE +#define ExtractIcon ExtractIconW +#else +#define ExtractIcon ExtractIconA +#endif /* error values for ShellExecute() beyond the regular WinExec() codes */ -#define SE_ERR_SHARE 26 +#define SE_ERR_SHARE 26 #define SE_ERR_ASSOCINCOMPLETE 27 -#define SE_ERR_DDETIMEOUT 28 -#define SE_ERR_DDEFAIL 29 -#define SE_ERR_DDEBUSY 30 -#define SE_ERR_NOASSOC 31 - -HANDLE APIENTRY ShellExecute(HWND hwnd, LPSTR lpOperation, LPSTR lpFile, LPSTR lpParameters, LPSTR lpDirectory, WORD nShowCmd); -HANDLE APIENTRY FindExecutable(LPSTR lpFile, LPSTR lpDirectory, LPSTR lpResult); - -INT APIENTRY ShellAbout(HWND hWnd, LPSTR szApp, LPSTR szOtherStuff, HICON hIcon); /* ;Internal */ -HICON APIENTRY DuplicateIcon(HANDLE hInst, HICON hIcon); /* ;Internal */ -HICON APIENTRY ExtractAssociatedIcon(HANDLE hInst, LPSTR lpIconPath, LPWORD lpiIcon); /* ;Internal */ +#define SE_ERR_DDETIMEOUT 28 +#define SE_ERR_DDEFAIL 29 +#define SE_ERR_DDEBUSY 30 +#define SE_ERR_NOASSOC 31 + +HINSTANCE APIENTRY ShellExecuteA(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPSTR lpParameters, LPCSTR lpDirectory, INT nShowCmd); +HINSTANCE APIENTRY ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, LPWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd); + +HINSTANCE APIENTRY FindExecutableA(LPCSTR lpFile, LPCSTR lpDirectory, LPSTR lpResult); +HINSTANCE APIENTRY FindExecutableW(LPCWSTR lpFile, LPCWSTR lpDirectory, LPWSTR lpResult); + +INT APIENTRY ShellAboutA(HWND hWnd, LPCSTR szApp, LPCSTR szOtherStuff, HICON hIcon); +INT APIENTRY ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon); + +#ifndef UNICODE +#define ShellExecute ShellExecuteA +#define FindExecutable FindExecutableA +#define ShellAbout ShellAboutA +#else +#define ShellExecute ShellExecuteW +#define FindExecutable FindExecutableW +#define ShellAbout ShellAboutW +#endif + +HICON APIENTRY DuplicateIcon(HINSTANCE hInst, HICON hIcon); /* ;Internal */ +HICON APIENTRY ExtractAssociatedIconA(HINSTANCE hInst, LPSTR lpIconPath, LPWORD lpiIcon); /* ;Internal */ +HICON APIENTRY ExtractAssociatedIconW(HINSTANCE hInst, LPWSTR lpIconPath, LPWORD lpiIcon); /* ;Internal */ + +#ifndef UNICODE +#define ExtractAssociatedIcon ExtractAssociatedIconA +#else +#define ExtractAssociatedIcon ExtractAssociatedIconW +#endif + +#ifdef __cplusplus +} +#endif +#endif // _INC_SHELLAPI