1 #ifndef _WDL_WIN32_UTF8_H_
2 #define _WDL_WIN32_UTF8_H_
8 #if defined(_WIN32) && !defined(WDL_NO_SUPPORT_UTF8)
10 #ifndef WDL_WIN32_UTF8_IMPL
11 #define WDL_WIN32_UTF8_IMPL
12 #define WDL_WIN32_UTF8_IMPL_NOTSTATIC
19 WDL_WIN32_UTF8_IMPL BOOL
SetWindowTextUTF8(HWND hwnd
, LPCTSTR str
);
20 WDL_WIN32_UTF8_IMPL BOOL
SetDlgItemTextUTF8(HWND hDlg
, int nIDDlgItem
, LPCTSTR lpString
);
21 WDL_WIN32_UTF8_IMPL
int GetWindowTextUTF8(HWND hWnd
, LPTSTR lpString
, int nMaxCount
);
22 WDL_WIN32_UTF8_IMPL UINT
GetDlgItemTextUTF8(HWND hDlg
, int nIDDlgItem
, LPTSTR lpString
, int nMaxCount
);
23 WDL_WIN32_UTF8_IMPL
int MessageBoxUTF8(HWND hwnd
, LPCTSTR lpText
, LPCTSTR lpCaption
, UINT fl
);
25 WDL_WIN32_UTF8_IMPL BOOL
CreateDirectoryUTF8(LPCTSTR path
, LPSECURITY_ATTRIBUTES attr
);
26 WDL_WIN32_UTF8_IMPL BOOL
DeleteFileUTF8(LPCTSTR path
);
27 WDL_WIN32_UTF8_IMPL BOOL
MoveFileUTF8(LPCTSTR existfn
, LPCTSTR newfn
);
28 WDL_WIN32_UTF8_IMPL BOOL
CopyFileUTF8(LPCTSTR existfn
, LPCTSTR newfn
, BOOL fie
);
29 WDL_WIN32_UTF8_IMPL DWORD
GetCurrentDirectoryUTF8(DWORD nBufferLength
, LPTSTR lpBuffer
);
30 WDL_WIN32_UTF8_IMPL BOOL
SetCurrentDirectoryUTF8(LPCTSTR path
);
31 WDL_WIN32_UTF8_IMPL BOOL
RemoveDirectoryUTF8(LPCTSTR path
);
32 WDL_WIN32_UTF8_IMPL HINSTANCE
LoadLibraryUTF8(LPCTSTR path
);
34 WDL_WIN32_UTF8_IMPL HANDLE
CreateFileUTF8(LPCTSTR lpFileName
,DWORD dwDesiredAccess
,DWORD dwShareMode
,LPSECURITY_ATTRIBUTES lpSecurityAttributes
,DWORD dwCreationDisposition
,DWORD dwFlagsAndAttributes
,HANDLE hTemplateFile
);
36 WDL_WIN32_UTF8_IMPL
int DragQueryFileUTF8(HDROP hDrop
, int idx
, char *buf
, int bufsz
);
38 WDL_WIN32_UTF8_IMPL
int DrawTextUTF8(HDC hdc
, LPCTSTR str
, int nc
, LPRECT lpRect
, UINT format
);
40 WDL_WIN32_UTF8_IMPL BOOL
GetOpenFileNameUTF8(LPOPENFILENAME lpofn
);
41 WDL_WIN32_UTF8_IMPL BOOL
GetSaveFileNameUTF8(LPOPENFILENAME lpofn
);
44 WDL_WIN32_UTF8_IMPL HINSTANCE
ShellExecuteUTF8(HWND hwnd
, LPCTSTR lpOp
, LPCTSTR lpFile
, LPCTSTR lpParm
, LPCTSTR lpDir
, INT nShowCmd
);
46 WDL_WIN32_UTF8_IMPL BOOL
InsertMenuUTF8(HMENU hMenu
, UINT uPosition
, UINT uFlags
, UINT_PTR uIDNewItem
, LPCTSTR str
);
47 WDL_WIN32_UTF8_IMPL BOOL
InsertMenuItemUTF8( HMENU hMenu
,UINT uItem
, BOOL fByPosition
, LPMENUITEMINFO lpmii
);
48 WDL_WIN32_UTF8_IMPL BOOL
SetMenuItemInfoUTF8(HMENU hMenu
, UINT uItem
, BOOL fByPosition
,LPMENUITEMINFO lpmii
);
49 WDL_WIN32_UTF8_IMPL BOOL
GetMenuItemInfoUTF8(HMENU hMenu
, UINT uItem
,BOOL fByPosition
,LPMENUITEMINFO lpmii
);
51 WDL_WIN32_UTF8_IMPL
int statUTF8(const char *filename
, struct stat
*buffer
);
52 WDL_WIN32_UTF8_IMPL
FILE *fopenUTF8(const char *filename
, const char *mode
);
55 WDL_WIN32_UTF8_IMPL WCHAR
*WDL_UTF8ToWC(const char *buf
, BOOL doublenull
, int minsize
, DWORD
*sizeout
);
57 WDL_WIN32_UTF8_IMPL BOOL
WDL_HasUTF8(const char *_str
);
59 WDL_WIN32_UTF8_IMPL
void WDL_UTF8_HookComboBox(HWND h
);
60 WDL_WIN32_UTF8_IMPL
void WDL_UTF8_HookListView(HWND h
);
61 WDL_WIN32_UTF8_IMPL
void WDL_UTF8_HookListBox(HWND h
);
62 WDL_WIN32_UTF8_IMPL
void WDL_UTF8_HookTreeView(HWND h
);
63 WDL_WIN32_UTF8_IMPL
void WDL_UTF8_HookTabCtrl(HWND h
);
65 WDL_WIN32_UTF8_IMPL LPSTR
GetCommandParametersUTF8();
66 WDL_WIN32_UTF8_IMPL
void WDL_UTF8_ListViewConvertDispInfoToW(void *di
); //NMLVDISPINFO
71 #define SetWindowText SetWindowTextUTF8
76 #define SetDlgItemText SetDlgItemTextUTF8
82 #define GetWindowText GetWindowTextUTF8
87 #define GetDlgItemText GetDlgItemTextUTF8
92 #define MessageBox MessageBoxUTF8
97 #define DragQueryFile DragQueryFileUTF8
99 #ifdef GetOpenFileName
100 #undef GetOpenFileName
102 #define GetOpenFileName GetOpenFileNameUTF8
104 #ifdef GetSaveFileName
105 #undef GetSaveFileName
107 #define GetSaveFileName GetSaveFileNameUTF8
112 #define ShellExecute ShellExecuteUTF8
115 #ifdef CreateDirectory
116 #undef CreateDirectory
118 #define CreateDirectory CreateDirectoryUTF8
123 #define DeleteFile DeleteFileUTF8
128 #define MoveFile MoveFileUTF8
133 #define CopyFile CopyFileUTF8
135 #ifdef GetCurrentDirectory
136 #undef GetCurrentDirectory
138 #define GetCurrentDirectory GetCurrentDirectoryUTF8
140 #ifdef SetCurrentDirectory
141 #undef SetCurrentDirectory
143 #define SetCurrentDirectory SetCurrentDirectoryUTF8
146 #ifdef RemoveDirectory
147 #undef RemoveDirectory
149 #define RemoveDirectory RemoveDirectoryUTF8
155 #define CreateFile CreateFileUTF8
161 #define InsertMenu InsertMenuUTF8
163 #ifdef InsertMenuItem
164 #undef InsertMenuItem
166 #define InsertMenuItem InsertMenuItemUTF8
168 #ifdef SetMenuItemInfo
169 #undef SetMenuItemInfo
171 #define SetMenuItemInfo SetMenuItemInfoUTF8
173 #ifdef GetMenuItemInfo
174 #undef GetMenuItemInfo
176 #define GetMenuItemInfo GetMenuItemInfoUTF8
181 #define LoadLibrary LoadLibraryUTF8
185 // compat defines for when UTF disabled
186 #define DrawTextUTF8 DrawText
187 #define statUTF8 stat
188 #define fopenUTF8 fopen
189 #define WDL_UTF8_HookComboBox(x)
190 #define WDL_UTF8_HookListView(x)
191 #define WDL_UTF8_HookListBox(x)
192 #define WDL_UTF8_HookTreeView(x)
193 #define WDL_UTF8_HookTabCtrl(x)
194 #define WDL_UTF8_ListViewConvertDispInfoToW(x)