1 module win32.ansi.commdlg;
2
3 // Translated from Microsoft Platform SDK August 2001 Edition
4 // by Y.Tomino (demoonlit@inter7.jp)
5
6 import win32.ansi.winuser;
7 // inline #include <cderr.h>
8 // ----
9
10 // #ifndef _INC_CDERR
11 // #define _INC_CDERR
12
13 // #if _MSC_VER > 1000
14 // #pragma once
15 // #endif
16
17 enum : uint { CDERR_DIALOGFAILURE = 0xFFFF }
18
19 enum : uint { CDERR_GENERALCODES = 0x0000 }
20 enum : uint { CDERR_STRUCTSIZE = 0x0001 }
21 enum : uint { CDERR_INITIALIZATION = 0x0002 }
22 enum : uint { CDERR_NOTEMPLATE = 0x0003 }
23 enum : uint { CDERR_NOHINSTANCE = 0x0004 }
24 enum : uint { CDERR_LOADSTRFAILURE = 0x0005 }
25 enum : uint { CDERR_FINDRESFAILURE = 0x0006 }
26 enum : uint { CDERR_LOADRESFAILURE = 0x0007 }
27 enum : uint { CDERR_LOCKRESFAILURE = 0x0008 }
28 enum : uint { CDERR_MEMALLOCFAILURE = 0x0009 }
29 enum : uint { CDERR_MEMLOCKFAILURE = 0x000A }
30 enum : uint { CDERR_NOHOOK = 0x000B }
31 enum : uint { CDERR_REGISTERMSGFAIL = 0x000C }
32
33 enum : uint { PDERR_PRINTERCODES = 0x1000 }
34 enum : uint { PDERR_SETUPFAILURE = 0x1001 }
35 enum : uint { PDERR_PARSEFAILURE = 0x1002 }
36 enum : uint { PDERR_RETDEFFAILURE = 0x1003 }
37 enum : uint { PDERR_LOADDRVFAILURE = 0x1004 }
38 enum : uint { PDERR_GETDEVMODEFAIL = 0x1005 }
39 enum : uint { PDERR_INITFAILURE = 0x1006 }
40 enum : uint { PDERR_NODEVICES = 0x1007 }
41 enum : uint { PDERR_NODEFAULTPRN = 0x1008 }
42 enum : uint { PDERR_DNDMMISMATCH = 0x1009 }
43 enum : uint { PDERR_CREATEICFAILURE = 0x100A }
44 enum : uint { PDERR_PRINTERNOTFOUND = 0x100B }
45 enum : uint { PDERR_DEFAULTDIFFERENT = 0x100C }
46
47 enum : uint { CFERR_CHOOSEFONTCODES = 0x2000 }
48 enum : uint { CFERR_NOFONTS = 0x2001 }
49 enum : uint { CFERR_MAXLESSTHANMIN = 0x2002 }
50
51 enum : uint { FNERR_FILENAMECODES = 0x3000 }
52 enum : uint { FNERR_SUBCLASSFAILURE = 0x3001 }
53 enum : uint { FNERR_INVALIDFILENAME = 0x3002 }
54 enum : uint { FNERR_BUFFERTOOSMALL = 0x3003 }
55
56 enum : uint { FRERR_FINDREPLACECODES = 0x4000 }
57 enum : uint { FRERR_BUFFERLENGTHZERO = 0x4001 }
58
59 enum : uint { CCERR_CHOOSECOLORCODES = 0x5000 }
60
61 // #endif /* !_INC_CDERR */
62 // ----
63
64 // #ifndef _INC_COMMDLG
65 // #define _INC_COMMDLG
66
67 // #if(WINVER >= 0x0500)
68
69 // #ifdef DEFINE_GUID
70
71 // ...
72
73 // ...
74
75 // #endif
76
77 // #endif /* WINVER >= 0x0500 */
78
79 // #ifndef GUID_DEFS_ONLY
80
81 // #include <prsht.h>
82
83 // #if !defined(_WIN64)
84 align(1):
85 // #endif
86
87 // #ifdef __cplusplus
88 // extern "C" { /* Assume C declarations for C++ */
89 // #endif /* __cplusplus */
90
91 // #ifndef WINCOMMDLGAPI
92 // #if !defined(_COMDLG32_)
93 // #define WINCOMMDLGAPI DECLSPEC_IMPORT
94 // #else
95 // #...
96 // #endif
97 // #endif // WINCOMMDLGAPI
98
99 // #if(WINVER >= 0x0400)
100 // #ifndef SNDMSG
101 // #ifdef __cplusplus
102 // #ifndef _MAC
103 // #define SNDMSG ::SendMessage
104 // #else
105 // #...
106 // #endif
107 // #else /* __cplusplus */
108 // #ifndef _MAC
109 // #...
110 // #else
111 // #...
112 // #endif
113 // #endif /* __cplusplus */
114 // #endif // ifndef SNDMSG
115 // #endif /* WINVER >= 0x0400 */
116
117 // #ifdef _MAC
118 // ...
119 // #endif
120
121 extern(Windows) alias UINT_PTR function(HWND, UINT, WPARAM, LPARAM) LPOFNHOOKPROC;
122
123 // #ifndef CDSIZEOF_STRUCT
124 // #define CDSIZEOF_STRUCT(structname, member) (((int)((LPBYTE)(&((structname*)0)->member) - ((LPBYTE)((structname*)0)))) + sizeof(((structname*)0)->member))
125 // #endif
126
127 // #ifndef DUMMYUNIONNAME
128 // #ifdef NONAMELESSUNION
129 // #...
130 // #endif // NONAMELESSUNION
131 // #endif // DUMMYUNIONNAME
132
133 struct tagOFN_NT4A {
134 DWORD lStructSize;
135 HWND hwndOwner;
136 HINSTANCE hInstance;
137 LPCSTR lpstrFilter;
138 LPSTR lpstrCustomFilter;
139 DWORD nMaxCustFilter;
140 DWORD nFilterIndex;
141 LPSTR lpstrFile;
142 DWORD nMaxFile;
143 LPSTR lpstrFileTitle;
144 DWORD nMaxFileTitle;
145 LPCSTR lpstrInitialDir;
146 LPCSTR lpstrTitle;
147 DWORD Flags;
148 WORD nFileOffset;
149 WORD nFileExtension;
150 LPCSTR lpstrDefExt;
151 LPARAM lCustData;
152 LPOFNHOOKPROC lpfnHook;
153 LPCSTR lpTemplateName;
154 }
155 alias tagOFN_NT4A OPENFILENAME_NT4A;
156 alias tagOFN_NT4A* LPOPENFILENAME_NT4A;
157
158 struct tagOFN_NT4W {
159 DWORD lStructSize;
160 HWND hwndOwner;
161 HINSTANCE hInstance;
162 LPCWSTR lpstrFilter;
163 LPWSTR lpstrCustomFilter;
164 DWORD nMaxCustFilter;
165 DWORD nFilterIndex;
166 LPWSTR lpstrFile;
167 DWORD nMaxFile;
168 LPWSTR lpstrFileTitle;
169 DWORD nMaxFileTitle;
170 LPCWSTR lpstrInitialDir;
171 LPCWSTR lpstrTitle;
172 DWORD Flags;
173 WORD nFileOffset;
174 WORD nFileExtension;
175 LPCWSTR lpstrDefExt;
176 LPARAM lCustData;
177 LPOFNHOOKPROC lpfnHook;
178 LPCWSTR lpTemplateName;
179 }
180 alias tagOFN_NT4W OPENFILENAME_NT4W;
181 alias tagOFN_NT4W* LPOPENFILENAME_NT4W;
182
183 // #ifdef UNICODE
184 // ...
185 // #else
186 alias OPENFILENAME_NT4A OPENFILENAME_NT4;
187 alias LPOPENFILENAME_NT4A LPOPENFILENAME_NT4;
188 // #endif // UNICODE
189
190 struct tagOFNA {
191 DWORD lStructSize;
192 HWND hwndOwner;
193 HINSTANCE hInstance;
194 LPCSTR lpstrFilter;
195 LPSTR lpstrCustomFilter;
196 DWORD nMaxCustFilter;
197 DWORD nFilterIndex;
198 LPSTR lpstrFile;
199 DWORD nMaxFile;
200 LPSTR lpstrFileTitle;
201 DWORD nMaxFileTitle;
202 LPCSTR lpstrInitialDir;
203 LPCSTR lpstrTitle;
204 DWORD Flags;
205 WORD nFileOffset;
206 WORD nFileExtension;
207 LPCSTR lpstrDefExt;
208 LPARAM lCustData;
209 LPOFNHOOKPROC lpfnHook;
210 LPCSTR lpTemplateName;
211 // #ifdef _MAC
212 // ...
213 // #endif
214 // #if (_WIN32_WINNT >= 0x0500)
215 void * pvReserved;
216 DWORD dwReserved;
217 DWORD FlagsEx;
218 // #endif // (_WIN32_WINNT >= 0x0500)
219 }
220 alias tagOFNA OPENFILENAMEA;
221 alias tagOFNA* LPOPENFILENAMEA;
222
223 struct tagOFNW {
224 DWORD lStructSize;
225 HWND hwndOwner;
226 HINSTANCE hInstance;
227 LPCWSTR lpstrFilter;
228 LPWSTR lpstrCustomFilter;
229 DWORD nMaxCustFilter;
230 DWORD nFilterIndex;
231 LPWSTR lpstrFile;
232 DWORD nMaxFile;
233 LPWSTR lpstrFileTitle;
234 DWORD nMaxFileTitle;
235 LPCWSTR lpstrInitialDir;
236 LPCWSTR lpstrTitle;
237 DWORD Flags;
238 WORD nFileOffset;
239 WORD nFileExtension;
240 LPCWSTR lpstrDefExt;
241 LPARAM lCustData;
242 LPOFNHOOKPROC lpfnHook;
243 LPCWSTR lpTemplateName;
244 // #ifdef _MAC
245 // ...
246 // #endif
247 // #if (_WIN32_WINNT >= 0x0500)
248 void * pvReserved;
249 DWORD dwReserved;
250 DWORD FlagsEx;
251 // #endif // (_WIN32_WINNT >= 0x0500)
252 }
253 alias tagOFNW OPENFILENAMEW;
254 alias tagOFNW* LPOPENFILENAMEW;
255
256 // #ifdef UNICODE
257 // ...
258 // #else
259 alias OPENFILENAMEA OPENFILENAME;
260 alias LPOPENFILENAMEA LPOPENFILENAME;
261 // #endif // UNICODE
262
263 // #if (_WIN32_WINNT >= 0x0500)
264 // #define OPENFILENAME_SIZE_VERSION_400A CDSIZEOF_STRUCT(OPENFILENAMEA,lpTemplateName)
265 // #define OPENFILENAME_SIZE_VERSION_400W CDSIZEOF_STRUCT(OPENFILENAMEW,lpTemplateName)
266 // #ifdef UNICODE
267 // #...
268 // #else
269 // #define OPENFILENAME_SIZE_VERSION_400 OPENFILENAME_SIZE_VERSION_400A
270 // #endif // !UNICODE
271 // #endif // (_WIN32_WINNT >= 0x0500)
272
273 extern(Windows) export BOOL GetOpenFileNameA(LPOPENFILENAMEA);
274 extern(Windows) export BOOL GetOpenFileNameW(LPOPENFILENAMEW);
275 // #ifdef UNICODE
276 // #...
277 // #else
278 alias GetOpenFileNameA GetOpenFileName;
279 // #endif // !UNICODE
280 extern(Windows) export BOOL GetSaveFileNameA(LPOPENFILENAMEA);
281 extern(Windows) export BOOL GetSaveFileNameW(LPOPENFILENAMEW);
282 // #ifdef UNICODE
283 // #...
284 // #else
285 alias GetSaveFileNameA GetSaveFileName;
286 // #endif // !UNICODE
287
288 extern(Windows) export short GetFileTitleA(LPCSTR, LPSTR, WORD);
289 extern(Windows) export short GetFileTitleW(LPCWSTR, LPWSTR, WORD);
290 // #ifdef UNICODE
291 // #...
292 // #else
293 alias GetFileTitleA GetFileTitle;
294 // #endif // !UNICODE
295
296 enum : uint { OFN_READONLY = 0x00000001 }
297 enum : uint { OFN_OVERWRITEPROMPT = 0x00000002 }
298 enum : uint { OFN_HIDEREADONLY = 0x00000004 }
299 enum : uint { OFN_NOCHANGEDIR = 0x00000008 }
300 enum : uint { OFN_SHOWHELP = 0x00000010 }
301 enum : uint { OFN_ENABLEHOOK = 0x00000020 }
302 enum : uint { OFN_ENABLETEMPLATE = 0x00000040 }
303 enum : uint { OFN_ENABLETEMPLATEHANDLE = 0x00000080 }
304 enum : uint { OFN_NOVALIDATE = 0x00000100 }
305 enum : uint { OFN_ALLOWMULTISELECT = 0x00000200 }
306 enum : uint { OFN_EXTENSIONDIFFERENT = 0x00000400 }
307 enum : uint { OFN_PATHMUSTEXIST = 0x00000800 }
308 enum : uint { OFN_FILEMUSTEXIST = 0x00001000 }
309 enum : uint { OFN_CREATEPROMPT = 0x00002000 }
310 enum : uint { OFN_SHAREAWARE = 0x00004000 }
311 enum : uint { OFN_NOREADONLYRETURN = 0x00008000 }
312 enum : uint { OFN_NOTESTFILECREATE = 0x00010000 }
313 enum : uint { OFN_NONETWORKBUTTON = 0x00020000 }
314 enum : uint { OFN_NOLONGNAMES = 0x00040000 }
315 // #if(WINVER >= 0x0400)
316 enum : uint { OFN_EXPLORER = 0x00080000 }
317 enum : uint { OFN_NODEREFERENCELINKS = 0x00100000 }
318 enum : uint { OFN_LONGNAMES = 0x00200000 }
319 enum : uint { OFN_ENABLEINCLUDENOTIFY = 0x00400000 }
320 enum : uint { OFN_ENABLESIZING = 0x00800000 }
321 // #endif /* WINVER >= 0x0400 */
322 // #if (_WIN32_WINNT >= 0x0500)
323 enum : uint { OFN_DONTADDTORECENT = 0x02000000 }
324 enum : uint { OFN_FORCESHOWHIDDEN = 0x10000000 }
325 // #endif // (_WIN32_WINNT >= 0x0500)
326
327 // #if (_WIN32_WINNT >= 0x0500)
328 enum : uint { OFN_EX_NOPLACESBAR = 0x00000001 }
329 // #endif // (_WIN32_WINNT >= 0x0500)
330
331 enum : uint { OFN_SHAREFALLTHROUGH = 2 }
332 enum : uint { OFN_SHARENOWARN = 1 }
333 enum : uint { OFN_SHAREWARN = 0 }
334
335 extern(Windows) alias UINT_PTR function(HWND, UINT, WPARAM, LPARAM) LPCCHOOKPROC;
336
337 // #if(WINVER >= 0x0400)
338
339 struct _OFNOTIFYA {
340 NMHDR hdr;
341 LPOPENFILENAMEA lpOFN;
342 LPSTR pszFile;
343 }
344 alias _OFNOTIFYA OFNOTIFYA;
345 alias _OFNOTIFYA* LPOFNOTIFYA;
346
347 struct _OFNOTIFYW {
348 NMHDR hdr;
349 LPOPENFILENAMEW lpOFN;
350 LPWSTR pszFile;
351 }
352 alias _OFNOTIFYW OFNOTIFYW;
353 alias _OFNOTIFYW* LPOFNOTIFYW;
354
355 // #ifdef UNICODE
356 // ...
357 // #else
358 alias OFNOTIFYA OFNOTIFY;
359 alias LPOFNOTIFYA LPOFNOTIFY;
360 // #endif // UNICODE
361
362 struct _OFNOTIFYEXA {
363 NMHDR hdr;
364 LPOPENFILENAMEA lpOFN;
365 LPVOID psf;
366 LPVOID pidl;
367 }
368 alias _OFNOTIFYEXA OFNOTIFYEXA;
369 alias _OFNOTIFYEXA* LPOFNOTIFYEXA;
370
371 struct _OFNOTIFYEXW {
372 NMHDR hdr;
373 LPOPENFILENAMEW lpOFN;
374 LPVOID psf;
375 LPVOID pidl;
376 }
377 alias _OFNOTIFYEXW OFNOTIFYEXW;
378 alias _OFNOTIFYEXW* LPOFNOTIFYEXW;
379
380 // #ifdef UNICODE
381 // ...
382 // #else
383 alias OFNOTIFYEXA OFNOTIFYEX;
384 alias LPOFNOTIFYEXA LPOFNOTIFYEX;
385 // #endif // UNICODE
386
387 enum : uint { CDN_FIRST = 0U-601U }
388 enum : uint { CDN_LAST = 0U-699U }
389
390 enum : uint { CDN_INITDONE = CDN_FIRST - 0x0000 }
391 enum : uint { CDN_SELCHANGE = CDN_FIRST - 0x0001 }
392 enum : uint { CDN_FOLDERCHANGE = CDN_FIRST - 0x0002 }
393 enum : uint { CDN_SHAREVIOLATION = CDN_FIRST - 0x0003 }
394 enum : uint { CDN_HELP = CDN_FIRST - 0x0004 }
395 enum : uint { CDN_FILEOK = CDN_FIRST - 0x0005 }
396 enum : uint { CDN_TYPECHANGE = CDN_FIRST - 0x0006 }
397 enum : uint { CDN_INCLUDEITEM = CDN_FIRST - 0x0007 }
398
399 enum : uint { CDM_FIRST = WM_USER + 100 }
400 enum : uint { CDM_LAST = WM_USER + 200 }
401
402 enum : uint { CDM_GETSPEC = CDM_FIRST + 0x0000 }
403 // #define CommDlg_OpenSave_GetSpecA(_hdlg, _psz, _cbmax) (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
404 // #define CommDlg_OpenSave_GetSpecW(_hdlg, _psz, _cbmax) (int)SNDMSG(_hdlg, CDM_GETSPEC, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
405 // #ifdef UNICODE
406 // #...
407 // #else
408 // #define CommDlg_OpenSave_GetSpec CommDlg_OpenSave_GetSpecA
409 // #endif // !UNICODE
410
411 enum : uint { CDM_GETFILEPATH = CDM_FIRST + 0x0001 }
412 // #define CommDlg_OpenSave_GetFilePathA(_hdlg, _psz, _cbmax) (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
413 // #define CommDlg_OpenSave_GetFilePathW(_hdlg, _psz, _cbmax) (int)SNDMSG(_hdlg, CDM_GETFILEPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
414 // #ifdef UNICODE
415 // #...
416 // #else
417 // #define CommDlg_OpenSave_GetFilePath CommDlg_OpenSave_GetFilePathA
418 // #endif // !UNICODE
419
420 enum : uint { CDM_GETFOLDERPATH = CDM_FIRST + 0x0002 }
421 // #define CommDlg_OpenSave_GetFolderPathA(_hdlg, _psz, _cbmax) (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPSTR)_psz)
422 // #define CommDlg_OpenSave_GetFolderPathW(_hdlg, _psz, _cbmax) (int)SNDMSG(_hdlg, CDM_GETFOLDERPATH, (WPARAM)_cbmax, (LPARAM)(LPWSTR)_psz)
423 // #ifdef UNICODE
424 // #...
425 // #else
426 // #define CommDlg_OpenSave_GetFolderPath CommDlg_OpenSave_GetFolderPathA
427 // #endif // !UNICODE
428
429 enum : uint { CDM_GETFOLDERIDLIST = CDM_FIRST + 0x0003 }
430 // #define CommDlg_OpenSave_GetFolderIDList(_hdlg, _pidl, _cbmax) (int)SNDMSG(_hdlg, CDM_GETFOLDERIDLIST, (WPARAM)_cbmax, (LPARAM)(LPVOID)_pidl)
431
432 enum : uint { CDM_SETCONTROLTEXT = CDM_FIRST + 0x0004 }
433 // #define CommDlg_OpenSave_SetControlText(_hdlg, _id, _text) (void)SNDMSG(_hdlg, CDM_SETCONTROLTEXT, (WPARAM)_id, (LPARAM)(LPSTR)_text)
434
435 enum : uint { CDM_HIDECONTROL = CDM_FIRST + 0x0005 }
436 // #define CommDlg_OpenSave_HideControl(_hdlg, _id) (void)SNDMSG(_hdlg, CDM_HIDECONTROL, (WPARAM)_id, 0)
437
438 enum : uint { CDM_SETDEFEXT = CDM_FIRST + 0x0006 }
439 // #define CommDlg_OpenSave_SetDefExt(_hdlg, _pszext) (void)SNDMSG(_hdlg, CDM_SETDEFEXT, 0, (LPARAM)(LPSTR)_pszext)
440 // #endif /* WINVER >= 0x0400 */
441
442 // #ifndef _MAC
443 struct tagCHOOSECOLORA {
444 DWORD lStructSize;
445 HWND hwndOwner;
446 HWND hInstance;
447 COLORREF rgbResult;
448 COLORREF * lpCustColors;
449 DWORD Flags;
450 LPARAM lCustData;
451 LPCCHOOKPROC lpfnHook;
452 LPCSTR lpTemplateName;
453 }
454 alias tagCHOOSECOLORA CHOOSECOLORA;
455 alias tagCHOOSECOLORA* LPCHOOSECOLORA;
456
457 struct tagCHOOSECOLORW {
458 DWORD lStructSize;
459 HWND hwndOwner;
460 HWND hInstance;
461 COLORREF rgbResult;
462 COLORREF * lpCustColors;
463 DWORD Flags;
464 LPARAM lCustData;
465 LPCCHOOKPROC lpfnHook;
466 LPCWSTR lpTemplateName;
467 }
468 alias tagCHOOSECOLORW CHOOSECOLORW;
469 alias tagCHOOSECOLORW* LPCHOOSECOLORW;
470
471 // #ifdef UNICODE
472 // ...
473 // #else
474 alias CHOOSECOLORA CHOOSECOLOR;
475 alias LPCHOOSECOLORA LPCHOOSECOLOR;
476 // #endif // UNICODE
477 // #else
478 // ...
479 // #ifdef UNICODE
480 // ...
481 // #else
482 // ...
483 // #endif // UNICODE
484 // #endif //_MAC
485
486 extern(Windows) export BOOL ChooseColorA(LPCHOOSECOLORA);
487 extern(Windows) export BOOL ChooseColorW(LPCHOOSECOLORW);
488 // #ifdef UNICODE
489 // #...
490 // #else
491 alias ChooseColorA ChooseColor;
492 // #endif // !UNICODE
493
494 enum : uint { CC_RGBINIT = 0x00000001 }
495 enum : uint { CC_FULLOPEN = 0x00000002 }
496 enum : uint { CC_PREVENTFULLOPEN = 0x00000004 }
497 enum : uint { CC_SHOWHELP = 0x00000008 }
498 enum : uint { CC_ENABLEHOOK = 0x00000010 }
499 enum : uint { CC_ENABLETEMPLATE = 0x00000020 }
500 enum : uint { CC_ENABLETEMPLATEHANDLE = 0x00000040 }
501 // #if(WINVER >= 0x0400)
502 enum : uint { CC_SOLIDCOLOR = 0x00000080 }
503 enum : uint { CC_ANYCOLOR = 0x00000100 }
504 // #endif /* WINVER >= 0x0400 */
505
506 extern(Windows) alias UINT_PTR function(HWND, UINT, WPARAM, LPARAM) LPFRHOOKPROC;
507
508 struct tagFINDREPLACEA {
509 DWORD lStructSize;
510 HWND hwndOwner;
511 HINSTANCE hInstance;
512
513 DWORD Flags;
514 LPSTR lpstrFindWhat;
515 LPSTR lpstrReplaceWith;
516 WORD wFindWhatLen;
517 WORD wReplaceWithLen;
518 LPARAM lCustData;
519 LPFRHOOKPROC lpfnHook;
520 LPCSTR lpTemplateName;
521 }
522 alias tagFINDREPLACEA FINDREPLACEA;
523 alias tagFINDREPLACEA* LPFINDREPLACEA;
524
525 struct tagFINDREPLACEW {
526 DWORD lStructSize;
527 HWND hwndOwner;
528 HINSTANCE hInstance;
529
530 DWORD Flags;
531 LPWSTR lpstrFindWhat;
532 LPWSTR lpstrReplaceWith;
533 WORD wFindWhatLen;
534 WORD wReplaceWithLen;
535 LPARAM lCustData;
536 LPFRHOOKPROC lpfnHook;
537 LPCWSTR lpTemplateName;
538 }
539 alias tagFINDREPLACEW FINDREPLACEW;
540 alias tagFINDREPLACEW* LPFINDREPLACEW;
541
542 // #ifdef UNICODE
543 // ...
544 // #else
545 alias FINDREPLACEA FINDREPLACE;
546 alias LPFINDREPLACEA LPFINDREPLACE;
547 // #endif // UNICODE
548
549 enum : uint { FR_DOWN = 0x00000001 }
550 enum : uint { FR_WHOLEWORD = 0x00000002 }
551 enum : uint { FR_MATCHCASE = 0x00000004 }
552 enum : uint { FR_FINDNEXT = 0x00000008 }
553 enum : uint { FR_REPLACE = 0x00000010 }
554 enum : uint { FR_REPLACEALL = 0x00000020 }
555 enum : uint { FR_DIALOGTERM = 0x00000040 }
556 enum : uint { FR_SHOWHELP = 0x00000080 }
557 enum : uint { FR_ENABLEHOOK = 0x00000100 }
558 enum : uint { FR_ENABLETEMPLATE = 0x00000200 }
559 enum : uint { FR_NOUPDOWN = 0x00000400 }
560 enum : uint { FR_NOMATCHCASE = 0x00000800 }
561 enum : uint { FR_NOWHOLEWORD = 0x00001000 }
562 enum : uint { FR_ENABLETEMPLATEHANDLE = 0x00002000 }
563 enum : uint { FR_HIDEUPDOWN = 0x00004000 }
564 enum : uint { FR_HIDEMATCHCASE = 0x00008000 }
565 enum : uint { FR_HIDEWHOLEWORD = 0x00010000 }
566 enum : uint { FR_RAW = 0x00020000 }
567 enum : uint { FR_MATCHDIAC = 0x20000000 }
568 enum : uint { FR_MATCHKASHIDA = 0x40000000 }
569 enum : uint { FR_MATCHALEFHAMZA = 0x80000000 }
570
571 extern(Windows) export HWND FindTextA(LPFINDREPLACEA);
572 extern(Windows) export HWND FindTextW(LPFINDREPLACEW);
573 // #ifdef UNICODE
574 // #...
575 // #else
576 alias FindTextA FindText;
577 // #endif // !UNICODE
578 // #ifndef _MAC
579 extern(Windows) export HWND ReplaceTextA(LPFINDREPLACEA);
580 extern(Windows) export HWND ReplaceTextW(LPFINDREPLACEW);
581 // #ifdef UNICODE
582 // #...
583 // #else
584 alias ReplaceTextA ReplaceText;
585 // #endif // !UNICODE
586 // #else
587 // ...
588 // #ifdef UNICODE
589 // #...
590 // #else
591 // #...
592 // #endif // !UNICODE
593 // #endif
594
595 extern(Windows) alias UINT_PTR function(HWND, UINT, WPARAM, LPARAM) LPCFHOOKPROC;
596
597 struct tagCHOOSEFONTA {
598 DWORD lStructSize;
599 HWND hwndOwner;
600 HDC hDC;
601 LPLOGFONTA lpLogFont;
602 INT iPointSize;
603 DWORD Flags;
604 COLORREF rgbColors;
605 LPARAM lCustData;
606 LPCFHOOKPROC lpfnHook;
607 LPCSTR lpTemplateName;
608 HINSTANCE hInstance;
609
610 LPSTR lpszStyle;
611
612 WORD nFontType;
613
614 WORD ___MISSING_ALIGNMENT__;
615 INT nSizeMin;
616 INT nSizeMax;
617
618 }
619 alias tagCHOOSEFONTA CHOOSEFONTA;
620 alias tagCHOOSEFONTA* LPCHOOSEFONTA;
621
622 struct tagCHOOSEFONTW {
623 DWORD lStructSize;
624 HWND hwndOwner;
625 HDC hDC;
626 LPLOGFONTW lpLogFont;
627 INT iPointSize;
628 DWORD Flags;
629 COLORREF rgbColors;
630 LPARAM lCustData;
631 LPCFHOOKPROC lpfnHook;
632 LPCWSTR lpTemplateName;
633 HINSTANCE hInstance;
634
635 LPWSTR lpszStyle;
636
637 WORD nFontType;
638
639 WORD ___MISSING_ALIGNMENT__;
640 INT nSizeMin;
641 INT nSizeMax;
642
643 }
644 alias tagCHOOSEFONTW CHOOSEFONTW;
645 alias tagCHOOSEFONTW* LPCHOOSEFONTW;
646
647 // #ifdef UNICODE
648 // ...
649 // #else
650 alias CHOOSEFONTA CHOOSEFONT;
651 alias LPCHOOSEFONTA LPCHOOSEFONT;
652 // #endif // UNICODE
653
654 extern(Windows) export BOOL ChooseFontA(LPCHOOSEFONTA);
655 extern(Windows) export BOOL ChooseFontW(LPCHOOSEFONTW);
656 // #ifdef UNICODE
657 // #...
658 // #else
659 alias ChooseFontA ChooseFont;
660 // #endif // !UNICODE
661
662 enum : uint { CF_SCREENFONTS = 0x00000001 }
663 enum : uint { CF_PRINTERFONTS = 0x00000002 }
664 enum : uint { CF_BOTH = CF_SCREENFONTS | CF_PRINTERFONTS }
665 enum : uint { CF_SHOWHELP = 0x00000004 }
666 enum : uint { CF_ENABLEHOOK = 0x00000008 }
667 enum : uint { CF_ENABLETEMPLATE = 0x00000010 }
668 enum : uint { CF_ENABLETEMPLATEHANDLE = 0x00000020 }
669 enum : uint { CF_INITTOLOGFONTSTRUCT = 0x00000040 }
670 enum : uint { CF_USESTYLE = 0x00000080 }
671 enum : uint { CF_EFFECTS = 0x00000100 }
672 enum : uint { CF_APPLY = 0x00000200 }
673 enum : uint { CF_ANSIONLY = 0x00000400 }
674 // #if(WINVER >= 0x0400)
675 alias CF_ANSIONLY CF_SCRIPTSONLY;
676 // #endif /* WINVER >= 0x0400 */
677 enum : uint { CF_NOVECTORFONTS = 0x00000800 }
678 alias CF_NOVECTORFONTS CF_NOOEMFONTS;
679 enum : uint { CF_NOSIMULATIONS = 0x00001000 }
680 enum : uint { CF_LIMITSIZE = 0x00002000 }
681 enum : uint { CF_FIXEDPITCHONLY = 0x00004000 }
682 enum : uint { CF_WYSIWYG = 0x00008000 }
683 enum : uint { CF_FORCEFONTEXIST = 0x00010000 }
684 enum : uint { CF_SCALABLEONLY = 0x00020000 }
685 enum : uint { CF_TTONLY = 0x00040000 }
686 enum : uint { CF_NOFACESEL = 0x00080000 }
687 enum : uint { CF_NOSTYLESEL = 0x00100000 }
688 enum : uint { CF_NOSIZESEL = 0x00200000 }
689 // #if(WINVER >= 0x0400)
690 enum : uint { CF_SELECTSCRIPT = 0x00400000 }
691 enum : uint { CF_NOSCRIPTSEL = 0x00800000 }
692 enum : uint { CF_NOVERTFONTS = 0x01000000 }
693 // #endif /* WINVER >= 0x0400 */
694
695 enum : uint { SIMULATED_FONTTYPE = 0x8000 }
696 enum : uint { PRINTER_FONTTYPE = 0x4000 }
697 enum : uint { SCREEN_FONTTYPE = 0x2000 }
698 enum : uint { BOLD_FONTTYPE = 0x0100 }
699 enum : uint { ITALIC_FONTTYPE = 0x0200 }
700 enum : uint { REGULAR_FONTTYPE = 0x0400 }
701
702 // #ifdef WINNT
703 // #...
704 // #...
705 // #...
706 // #endif
707
708 enum : uint { WM_CHOOSEFONT_GETLOGFONT = WM_USER + 1 }
709 enum : uint { WM_CHOOSEFONT_SETLOGFONT = WM_USER + 101 }
710 enum : uint { WM_CHOOSEFONT_SETFLAGS = WM_USER + 102 }
711
712 const char[] LBSELCHSTRINGA = "commdlg_LBSelChangedNotify";
713 const char[] SHAREVISTRINGA = "commdlg_ShareViolation";
714 const char[] FILEOKSTRINGA = "commdlg_FileNameOK";
715 const char[] COLOROKSTRINGA = "commdlg_ColorOK";
716 const char[] SETRGBSTRINGA = "commdlg_SetRGBColor";
717 const char[] HELPMSGSTRINGA = "commdlg_help";
718 const char[] FINDMSGSTRINGA = "commdlg_FindReplace";
719
720 const wchar[] LBSELCHSTRINGW = "commdlg_LBSelChangedNotify";
721 const wchar[] SHAREVISTRINGW = "commdlg_ShareViolation";
722 const wchar[] FILEOKSTRINGW = "commdlg_FileNameOK";
723 const wchar[] COLOROKSTRINGW = "commdlg_ColorOK";
724 const wchar[] SETRGBSTRINGW = "commdlg_SetRGBColor";
725 const wchar[] HELPMSGSTRINGW = "commdlg_help";
726 const wchar[] FINDMSGSTRINGW = "commdlg_FindReplace";
727
728 // #ifdef UNICODE
729 // #...
730 // #...
731 // #...
732 // #...
733 // #...
734 // #...
735 // #...
736 // #else
737 alias LBSELCHSTRINGA LBSELCHSTRING;
738 alias SHAREVISTRINGA SHAREVISTRING;
739 alias FILEOKSTRINGA FILEOKSTRING;
740 alias COLOROKSTRINGA COLOROKSTRING;
741 alias SETRGBSTRINGA SETRGBSTRING;
742 alias HELPMSGSTRINGA HELPMSGSTRING;
743 alias FINDMSGSTRINGA FINDMSGSTRING;
744 // #endif
745
746 enum { CD_LBSELNOITEMS = -1 }
747 enum : uint { CD_LBSELCHANGE = 0 }
748 enum : uint { CD_LBSELSUB = 1 }
749 enum : uint { CD_LBSELADD = 2 }
750
751 extern(Windows) alias UINT_PTR function(HWND, UINT, WPARAM, LPARAM) LPPRINTHOOKPROC;
752 extern(Windows) alias UINT_PTR function(HWND, UINT, WPARAM, LPARAM) LPSETUPHOOKPROC;
753
754 struct tagPDA {
755 DWORD lStructSize;
756 HWND hwndOwner;
757 HGLOBAL hDevMode;
758 HGLOBAL hDevNames;
759 HDC hDC;
760 DWORD Flags;
761 WORD nFromPage;
762 WORD nToPage;
763 WORD nMinPage;
764 WORD nMaxPage;
765 WORD nCopies;
766 HINSTANCE hInstance;
767 LPARAM lCustData;
768 LPPRINTHOOKPROC lpfnPrintHook;
769 LPSETUPHOOKPROC lpfnSetupHook;
770 LPCSTR lpPrintTemplateName;
771 LPCSTR lpSetupTemplateName;
772 HGLOBAL hPrintTemplate;
773 HGLOBAL hSetupTemplate;
774 }
775 alias tagPDA PRINTDLGA;
776 alias tagPDA* LPPRINTDLGA;
777
778 struct tagPDW {
779 DWORD lStructSize;
780 HWND hwndOwner;
781 HGLOBAL hDevMode;
782 HGLOBAL hDevNames;
783 HDC hDC;
784 DWORD Flags;
785 WORD nFromPage;
786 WORD nToPage;
787 WORD nMinPage;
788 WORD nMaxPage;
789 WORD nCopies;
790 HINSTANCE hInstance;
791 LPARAM lCustData;
792 LPPRINTHOOKPROC lpfnPrintHook;
793 LPSETUPHOOKPROC lpfnSetupHook;
794 LPCWSTR lpPrintTemplateName;
795 LPCWSTR lpSetupTemplateName;
796 HGLOBAL hPrintTemplate;
797 HGLOBAL hSetupTemplate;
798 }
799 alias tagPDW PRINTDLGW;
800 alias tagPDW* LPPRINTDLGW;
801
802 // #ifdef UNICODE
803 // ...
804 // #else
805 alias PRINTDLGA PRINTDLG;
806 alias LPPRINTDLGA LPPRINTDLG;
807 // #endif // UNICODE
808
809 extern(Windows) export BOOL PrintDlgA(LPPRINTDLGA);
810 extern(Windows) export BOOL PrintDlgW(LPPRINTDLGW);
811 // #ifdef UNICODE
812 // #...
813 // #else
814 alias PrintDlgA PrintDlg;
815 // #endif // !UNICODE
816
817 // #if(WINVER >= 0x0500)
818
819 // #ifdef STDMETHOD
820
821 // #...
822 // #...
823
824 // ...
825
826 // ...
827
828 // #...
829 // #...
830
831 // ...
832
833 // ...
834
835 // ...
836
837 // ...
838 // #ifdef UNICODE
839 // ...
840 // #else
841 // ...
842 // #endif // UNICODE
843
844 // ...
845 // #ifdef UNICODE
846 // #...
847 // #else
848 // #...
849 // #endif // !UNICODE
850
851 // #endif
852
853 // #endif /* WINVER >= 0x0500 */
854
855 enum : uint { PD_ALLPAGES = 0x00000000 }
856 enum : uint { PD_SELECTION = 0x00000001 }
857 enum : uint { PD_PAGENUMS = 0x00000002 }
858 enum : uint { PD_NOSELECTION = 0x00000004 }
859 enum : uint { PD_NOPAGENUMS = 0x00000008 }
860 enum : uint { PD_COLLATE = 0x00000010 }
861 enum : uint { PD_PRINTTOFILE = 0x00000020 }
862 enum : uint { PD_PRINTSETUP = 0x00000040 }
863 enum : uint { PD_NOWARNING = 0x00000080 }
864 enum : uint { PD_RETURNDC = 0x00000100 }
865 enum : uint { PD_RETURNIC = 0x00000200 }
866 enum : uint { PD_RETURNDEFAULT = 0x00000400 }
867 enum : uint { PD_SHOWHELP = 0x00000800 }
868 enum : uint { PD_ENABLEPRINTHOOK = 0x00001000 }
869 enum : uint { PD_ENABLESETUPHOOK = 0x00002000 }
870 enum : uint { PD_ENABLEPRINTTEMPLATE = 0x00004000 }
871 enum : uint { PD_ENABLESETUPTEMPLATE = 0x00008000 }
872 enum : uint { PD_ENABLEPRINTTEMPLATEHANDLE = 0x00010000 }
873 enum : uint { PD_ENABLESETUPTEMPLATEHANDLE = 0x00020000 }
874 enum : uint { PD_USEDEVMODECOPIES = 0x00040000 }
875 enum : uint { PD_USEDEVMODECOPIESANDCOLLATE = 0x00040000 }
876 enum : uint { PD_DISABLEPRINTTOFILE = 0x00080000 }
877 enum : uint { PD_HIDEPRINTTOFILE = 0x00100000 }
878 enum : uint { PD_NONETWORKBUTTON = 0x00200000 }
879 // #if(WINVER >= 0x0500)
880 enum : uint { PD_CURRENTPAGE = 0x00400000 }
881 enum : uint { PD_NOCURRENTPAGE = 0x00800000 }
882 enum : uint { PD_EXCLUSIONFLAGS = 0x01000000 }
883 enum : uint { PD_USELARGETEMPLATE = 0x10000000 }
884 // #endif /* WINVER >= 0x0500 */
885
886 // #if(WINVER >= 0x0500)
887
888 enum : uint { PD_EXCL_COPIESANDCOLLATE = DM_COPIES | DM_COLLATE }
889
890 enum : uint { START_PAGE_GENERAL = 0xffffffff }
891
892 enum : uint { PD_RESULT_CANCEL = 0 }
893 enum : uint { PD_RESULT_PRINT = 1 }
894 enum : uint { PD_RESULT_APPLY = 2 }
895
896 // #endif /* WINVER >= 0x0500 */
897
898 struct tagDEVNAMES {
899 WORD wDriverOffset;
900 WORD wDeviceOffset;
901 WORD wOutputOffset;
902 WORD wDefault;
903 }
904 alias tagDEVNAMES DEVNAMES;
905 alias tagDEVNAMES* LPDEVNAMES;
906
907 enum : uint { DN_DEFAULTPRN = 0x0001 }
908
909 extern(Windows) export DWORD CommDlgExtendedError();
910
911 // #if(WINVER >= 0x0400)
912 enum : uint { WM_PSD_PAGESETUPDLG = WM_USER }
913 enum : uint { WM_PSD_FULLPAGERECT = WM_USER+1 }
914 enum : uint { WM_PSD_MINMARGINRECT = WM_USER+2 }
915 enum : uint { WM_PSD_MARGINRECT = WM_USER+3 }
916 enum : uint { WM_PSD_GREEKTEXTRECT = WM_USER+4 }
917 enum : uint { WM_PSD_ENVSTAMPRECT = WM_USER+5 }
918 enum : uint { WM_PSD_YAFULLPAGERECT = WM_USER+6 }
919
920 extern(Windows) alias UINT_PTR function( HWND, UINT, WPARAM, LPARAM ) LPPAGEPAINTHOOK;
921 extern(Windows) alias UINT_PTR function( HWND, UINT, WPARAM, LPARAM ) LPPAGESETUPHOOK;
922
923 struct tagPSDA {
924 DWORD lStructSize;
925 HWND hwndOwner;
926 HGLOBAL hDevMode;
927 HGLOBAL hDevNames;
928 DWORD Flags;
929 POINT ptPaperSize;
930 RECT rtMinMargin;
931 RECT rtMargin;
932 HINSTANCE hInstance;
933 LPARAM lCustData;
934 LPPAGESETUPHOOK lpfnPageSetupHook;
935 LPPAGEPAINTHOOK lpfnPagePaintHook;
936 LPCSTR lpPageSetupTemplateName;
937 HGLOBAL hPageSetupTemplate;
938 }
939 alias tagPSDA PAGESETUPDLGA;
940 alias tagPSDA* LPPAGESETUPDLGA;
941
942 struct tagPSDW {
943 DWORD lStructSize;
944 HWND hwndOwner;
945 HGLOBAL hDevMode;
946 HGLOBAL hDevNames;
947 DWORD Flags;
948 POINT ptPaperSize;
949 RECT rtMinMargin;
950 RECT rtMargin;
951 HINSTANCE hInstance;
952 LPARAM lCustData;
953 LPPAGESETUPHOOK lpfnPageSetupHook;
954 LPPAGEPAINTHOOK lpfnPagePaintHook;
955 LPCWSTR lpPageSetupTemplateName;
956 HGLOBAL hPageSetupTemplate;
957 }
958 alias tagPSDW PAGESETUPDLGW;
959 alias tagPSDW* LPPAGESETUPDLGW;
960
961 // #ifdef UNICODE
962 // ...
963 // #else
964 alias PAGESETUPDLGA PAGESETUPDLG;
965 alias LPPAGESETUPDLGA LPPAGESETUPDLG;
966 // #endif // UNICODE
967
968 extern(Windows) export BOOL PageSetupDlgA( LPPAGESETUPDLGA );
969 extern(Windows) export BOOL PageSetupDlgW( LPPAGESETUPDLGW );
970 // #ifdef UNICODE
971 // #...
972 // #else
973 alias PageSetupDlgA PageSetupDlg;
974 // #endif // !UNICODE
975
976 enum : uint { PSD_DEFAULTMINMARGINS = 0x00000000 }
977 enum : uint { PSD_INWININIINTLMEASURE = 0x00000000 }
978
979 enum : uint { PSD_MINMARGINS = 0x00000001 }
980 enum : uint { PSD_MARGINS = 0x00000002 }
981 enum : uint { PSD_INTHOUSANDTHSOFINCHES = 0x00000004 }
982 enum : uint { PSD_INHUNDREDTHSOFMILLIMETERS = 0x00000008 }
983 enum : uint { PSD_DISABLEMARGINS = 0x00000010 }
984 enum : uint { PSD_DISABLEPRINTER = 0x00000020 }
985 enum : uint { PSD_NOWARNING = 0x00000080 }
986 enum : uint { PSD_DISABLEORIENTATION = 0x00000100 }
987 enum : uint { PSD_RETURNDEFAULT = 0x00000400 }
988 enum : uint { PSD_DISABLEPAPER = 0x00000200 }
989 enum : uint { PSD_SHOWHELP = 0x00000800 }
990 enum : uint { PSD_ENABLEPAGESETUPHOOK = 0x00002000 }
991 enum : uint { PSD_ENABLEPAGESETUPTEMPLATE = 0x00008000 }
992 enum : uint { PSD_ENABLEPAGESETUPTEMPLATEHANDLE = 0x00020000 }
993 enum : uint { PSD_ENABLEPAGEPAINTHOOK = 0x00040000 }
994 enum : uint { PSD_DISABLEPAGEPAINTING = 0x00080000 }
995 enum : uint { PSD_NONETWORKBUTTON = 0x00200000 }
996 // #endif /* WINVER >= 0x0400 */
997
998 // #if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
999 // #if ISOLATION_AWARE_ENABLED
1000
1001 // #if !defined(ISOLATION_AWARE_INLINE)
1002 // #if defined(__cplusplus)
1003 // #...
1004 // #else
1005 // #...
1006 // #endif
1007 // #endif
1008
1009 // ...
1010
1011 // ...
1012 // #if defined(STDMETHOD) && (WINVER >= 0x0500)
1013 // ...
1014 // #endif /* defined(STDMETHOD) && (WINVER >= 0x0500) */
1015 // ...
1016
1017 // #if defined(UNICODE)
1018
1019 // #...
1020 // #...
1021 // #...
1022 // #...
1023 // #...
1024 // #...
1025 // #...
1026 // #...
1027 // #...
1028 // #...
1029
1030 // #else /* UNICODE */
1031
1032 // #...
1033 // #...
1034 // #...
1035 // #...
1036 // #...
1037 // #...
1038 // #...
1039 // #...
1040 // #...
1041 // #...
1042
1043 // #endif /* UNICODE */
1044
1045 // ...
1046
1047 // ...
1048
1049 // ...
1050
1051 // ...
1052
1053 // ...
1054
1055 // ...
1056
1057 // ...
1058
1059 // ...
1060
1061 // ...
1062
1063 // ...
1064
1065 // ...
1066
1067 // ...
1068
1069 // ...
1070
1071 // ...
1072
1073 // ...
1074
1075 // ...
1076
1077 // #if defined(STDMETHOD) && (WINVER >= 0x0500)
1078
1079 // ...
1080
1081 // ...
1082
1083 // ...
1084
1085 // ...
1086
1087 // #endif /* defined(STDMETHOD) && (WINVER >= 0x0500) */
1088
1089 // ...
1090
1091 // ...
1092
1093 // ...
1094
1095 // ...
1096
1097 // #...
1098 // #...
1099 // #...
1100 // #...
1101 // #...
1102 // #...
1103 // #...
1104 // #...
1105 // #...
1106 // #...
1107 // #...
1108 // #...
1109 // #...
1110 // #...
1111 // #...
1112 // #...
1113 // #...
1114 // #...
1115 // #...
1116 // #...
1117 // #...
1118
1119 // #endif /* ISOLATION_AWARE_ENABLED */
1120 // #endif /* RC */
1121
1122 // #ifdef __cplusplus
1123 // }
1124 // #endif /* __cplusplus */
1125
1126 // #if !defined(_WIN64)
1127 align:
1128 // #endif
1129 // #endif /* GUID_DEFS_ONLY */
1130 // #endif /* !_INC_COMMDLG */
1131