]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/missing.h
adding missing closing bracket
[wxWidgets.git] / include / wx / msw / missing.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/missing.h
3 // Purpose: Declarations for parts of the Win32 SDK that are missing in
4 // the versions that come with some compilers
5 // Created: 2002/04/23
6 // RCS-ID: $Id$
7 // Copyright: (c) 2002 Mattia Barbon
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_MISSING_H_
12 #define _WX_MISSING_H_
13
14 // ----------------------------------------------------------------------------
15 // ListView common control
16 // ----------------------------------------------------------------------------
17
18 #ifndef LVHT_ONITEM
19 #define LVHT_ONITEM \
20 (LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMSTATEICON)
21 #endif
22
23 #ifndef LVM_SETEXTENDEDLISTVIEWSTYLE
24 #define LVM_SETEXTENDEDLISTVIEWSTYLE (0x1000 + 54)
25 #endif
26
27 #ifndef LVS_EX_FULLROWSELECT
28 #define LVS_EX_FULLROWSELECT 0x00000020
29 #endif
30
31 #ifndef LVS_OWNERDATA
32 #define LVS_OWNERDATA 0x1000
33 #endif
34
35 #ifndef LVM_FIRST
36 #define LVM_FIRST 0x1000
37 #endif
38
39 #ifndef HDM_FIRST
40 #define HDM_FIRST 0x1200
41 #endif
42
43 #ifndef LVCFMT_JUSTIFYMASK
44 #define LVCFMT_JUSTIFYMASK 0x0003
45 #endif
46
47 #ifndef LVSICF_NOSCROLL
48 #define LVSICF_NOINVALIDATEALL 0x0001
49 #define LVSICF_NOSCROLL 0x0002
50 #endif
51
52 // mingw32/cygwin don't have declarations for comctl32.dll 4.70+ stuff
53 #ifndef NM_CACHEHINT
54 typedef struct tagNMLVCACHEHINT
55 {
56 NMHDR hdr;
57 int iFrom;
58 int iTo;
59 } NMLVCACHEHINT;
60
61 #define NM_CACHEHINT NMLVCACHEHINT
62 #endif
63
64 #ifndef LVN_ODCACHEHINT
65 #define LVN_ODCACHEHINT (-113)
66 #endif
67
68 #ifndef ListView_GetHeader
69 #define ListView_GetHeader(w) (HWND)SendMessage((w),LVM_GETHEADER,0,0)
70 #endif
71
72 #ifndef LVM_GETHEADER
73 #define LVM_GETHEADER (LVM_FIRST+31)
74 #endif
75
76 #ifndef Header_GetItemRect
77 #define Header_GetItemRect(w,i,r) \
78 (BOOL)SendMessage((w),HDM_GETITEMRECT,(WPARAM)(i),(LPARAM)(r))
79 #endif
80
81 #ifndef HDM_GETITEMRECT
82 #define HDM_GETITEMRECT (HDM_FIRST+7)
83 #endif
84
85 #ifndef LVCF_IMAGE
86 #define LVCF_IMAGE 0x0010
87 #endif
88
89 #ifndef LVCFMT_BITMAP_ON_RIGHT
90 #define LVCFMT_BITMAP_ON_RIGHT 0x1000
91 #endif
92
93 #if defined(__GNUWIN32__) && !defined(LV_ITEM) \
94 && !wxCHECK_W32API_VERSION( 0, 5 )
95 typedef struct _LVITEMW {
96 UINT mask;
97 int iItem;
98 int iSubItem;
99 UINT state;
100 UINT stateMask;
101 LPWSTR pszText;
102 int cchTextMax;
103 int iImage;
104 LPARAM lParam;
105 #if (_WIN32_IE >= 0x0300)
106 int iIndent;
107 #endif
108 } LV_ITEMW;
109
110 typedef struct tagLVITEMA
111 {
112 UINT mask;
113 int iItem;
114 int iSubItem;
115 UINT state;
116 UINT stateMask;
117 LPSTR pszText;
118 int cchTextMax;
119 int iImage;
120 LPARAM lParam;
121 #if (_WIN32_IE >= 0x0300)
122 int iIndent;
123 #endif
124 } LV_ITEMA;
125
126 #define LV_ITEM LV_ITEMA;
127 #endif
128
129 #ifndef ListView_GetColumnWidth
130 #define ListView_GetColumnWidth(hwnd, iCol) \
131 (int)SNDMSG((hwnd), LVM_GETCOLUMNWIDTH, (WPARAM)(int)(iCol), 0)
132 #endif
133
134 #ifndef ListView_SetColumnWidth
135 #define ListView_SetColumnWidth(hwnd, iCol, cx) \
136 (BOOL)SNDMSG((hwnd), LVM_SETCOLUMNWIDTH, (WPARAM)(int)(iCol), MAKELPARAM((cx), 0))
137 #endif
138
139 #ifndef ListView_GetTextColor
140 #define ListView_GetTextColor(hwnd) \
141 (COLORREF)SNDMSG((hwnd), LVM_GETTEXTCOLOR, 0, 0L)
142 #endif
143
144 #ifndef ListView_FindItem
145 #define ListView_FindItem(hwnd, iStart, plvfi) \
146 (int)SNDMSG((hwnd), LVM_FINDITEM, (WPARAM)(int)(iStart), (LPARAM)(const LV_FINDINFO FAR*)(plvfi))
147 #endif
148
149 #if defined(__GNUWIN32__) && !wxCHECK_W32API_VERSION( 0, 5 )
150 #ifndef LV_DISPINFOA
151 typedef struct tagNMLVDISPINFOA {
152 NMHDR hdr;
153 LV_ITEMA item;
154 } NMLVDISPINFOA, FAR *LPNMLVDISPINFOA;
155 #define _LV_DISPINFOA tagNMLVDISPINFOA
156 #define LV_DISPINFOA NMLVDISPINFOA
157 #endif
158 #ifndef LV_DISPINFOW
159 typedef struct tagNMLVDISPINFOW {
160 NMHDR hdr;
161 LV_ITEMW item;
162 } NMLVDISPINFOW, FAR *LPNMLVDISPINFOW;
163 #define _LV_DISPINFOW tagNMLVDISPINFOW
164 #define LV_DISPINFOW NMLVDISPINFOW
165 #endif
166 #endif
167
168 #if ((defined(__WATCOMC__) && __WATCOMC__ >= 1200) || defined(__GNUWIN32__) || defined (__MINGW32__) || defined(__DIGITALMARS__) || defined (__BORLANDC__)) && !defined(HDN_GETDISPINFOW)
169 #define HDN_GETDISPINFOW (HDN_FIRST-29)
170 #if !wxCHECK_W32API_VERSION(2, 2)
171 typedef struct {
172 NMHDR hdr;
173 int iItem;
174 UINT mask;
175 LPWSTR pszText;
176 int cchTextMax;
177 int iImage;
178 LPARAM lParam;
179 } NMHDDISPINFOW, *LPNMHDDISPINFOW;
180 #endif
181 #endif
182
183 #ifndef LVM_SETUNICODEFORMAT
184 #define LVM_SETUNICODEFORMAT 0x2005
185 #endif
186
187 // ----------------------------------------------------------------------------
188 // Toolbar define value missing
189 // ----------------------------------------------------------------------------
190 #if !defined(CCS_VERT)
191 #define CCS_VERT 0x00000080L
192 #endif
193
194 // ----------------------------------------------------------------------------
195 // MS HTML Help
196 // ----------------------------------------------------------------------------
197
198 // instead of including htmlhelp.h, duplicate the things from it we need here:
199
200 enum
201 {
202 HH_DISPLAY_TOPIC,
203 HH_DISPLAY_TOC,
204 HH_DISPLAY_INDEX,
205 HH_DISPLAY_SEARCH,
206 HH_SET_WIN_TYPE,
207 HH_GET_WIN_TYPE,
208 HH_GET_WIN_HANDLE,
209 HH_ENUM_INFO_TYPE,
210 HH_SET_INFO_TYPE,
211 HH_SYNC,
212 HH_RESERVED1,
213 HH_RESERVED2,
214 HH_RESERVED3,
215 HH_KEYWORD_LOOKUP,
216 HH_DISPLAY_TEXT_POPUP,
217 HH_HELP_CONTEXT,
218 HH_TP_HELP_CONTEXTMENU,
219 HH_TP_HELP_WM_HELP,
220 HH_CLOSE_ALL,
221 HH_ALINK_LOOKUP,
222 HH_GET_LAST_ERROR,
223 HH_ENUM_CATEGORY,
224 HH_ENUM_CATEGORY_IT,
225 HH_RESET_IT_FILTER,
226 HH_SET_INCLUSIVE_FILTER,
227 HH_SET_EXCLUSIVE_FILTER
228 };
229
230 struct HH_POPUP
231 {
232 int cbStruct;
233 HINSTANCE hinst;
234 UINT idString;
235 LPCTSTR pszText;
236 POINT pt;
237 COLORREF clrForeground;
238 COLORREF clrBackground;
239 RECT rcMargins;
240 LPCTSTR pszFont;
241 };
242
243 struct HH_AKLINK
244 {
245 int cbStruct;
246 BOOL fReserved;
247 LPCTSTR pszKeywords;
248 LPCTSTR pszUrl;
249 LPCTSTR pszMsgText;
250 LPCTSTR pszMsgTitle;
251 LPCTSTR pszWindow;
252 BOOL fIndexOnFail;
253 };
254
255 // ----------------------------------------------------------------------------
256 // SHGetFileInfo-related things
257 // ----------------------------------------------------------------------------
258
259 #ifndef SHGetFileInfo
260 #ifdef UNICODE
261 #define SHGetFileInfo SHGetFileInfoW
262 #else
263 #define SHGetFileInfo SHGetFileInfoA
264 #endif
265 #endif
266
267 #ifndef SHGFI_ATTRIBUTES
268 #define SHGFI_ATTRIBUTES 2048
269 #endif
270
271 #ifndef SFGAO_READONLY
272 #define SFGAO_READONLY 0x00040000L
273 #endif
274
275 #ifndef SFGAO_REMOVABLE
276 #define SFGAO_REMOVABLE 0x02000000L
277 #endif
278
279 #ifndef SHGFI_DISPLAYNAME
280 #define SHGFI_DISPLAYNAME 512
281 #endif
282
283 #ifndef SHGFI_ICON
284 #define SHGFI_ICON 256
285 #endif
286
287 #ifndef SHGFI_SMALLICON
288 #define SHGFI_SMALLICON 1
289 #endif
290
291 #ifndef SHGFI_SHELLICONSIZE
292 #define SHGFI_SHELLICONSIZE 4
293 #endif
294
295 #ifndef SHGFI_OPENICON
296 #define SHGFI_OPENICON 2
297 #endif
298
299 // ----------------------------------------------------------------------------
300 // Rich text control
301 // ----------------------------------------------------------------------------
302
303 #if wxUSE_RICHEDIT && defined(MAX_TAB_STOPS)
304
305 // old mingw32 doesn't define this
306 #ifndef CFM_CHARSET
307 #define CFM_CHARSET 0x08000000
308 #endif // CFM_CHARSET
309
310 #ifndef CFM_BACKCOLOR
311 #define CFM_BACKCOLOR 0x04000000
312 #endif
313
314 // cygwin does not have these defined for richedit
315 #ifndef ENM_LINK
316 #define ENM_LINK 0x04000000
317 #endif
318
319 #ifndef EM_AUTOURLDETECT
320 #define EM_AUTOURLDETECT (WM_USER + 91)
321 #endif
322
323 #ifndef EN_LINK
324 #define EN_LINK 0x070b
325
326 typedef struct _enlink
327 {
328 NMHDR nmhdr;
329 UINT msg;
330 WPARAM wParam;
331 LPARAM lParam;
332 CHARRANGE chrg;
333 } ENLINK;
334 #endif // ENLINK
335
336 #ifndef SF_UNICODE
337 #define SF_UNICODE 0x0010
338 #endif
339
340 // Watcom C++ doesn't define this
341 #ifndef SCF_ALL
342 #define SCF_ALL 0x0004
343 #endif
344
345 #ifndef PFA_JUSTIFY
346 #define PFA_JUSTIFY 4
347
348 typedef struct _paraformat2 {
349 UINT cbSize;
350 DWORD dwMask;
351 WORD wNumbering;
352 WORD wEffects;
353 LONG dxStartIndent;
354 LONG dxRightIndent;
355 LONG dxOffset;
356 WORD wAlignment;
357 SHORT cTabCount;
358 LONG rgxTabs[MAX_TAB_STOPS];
359 LONG dySpaceBefore;
360 LONG dySpaceAfter;
361 LONG dyLineSpacing;
362 SHORT sStype;
363 BYTE bLineSpacingRule;
364 BYTE bOutlineLevel;
365 WORD wShadingWeight;
366 WORD wShadingStyle;
367 WORD wNumberingStart;
368 WORD wNumberingStyle;
369 WORD wNumberingTab;
370 WORD wBorderSpace;
371 WORD wBorderWidth;
372 WORD wBorders;
373 } PARAFORMAT2;
374 #define wxEffects wReserved
375
376 #endif
377
378 #endif // wxUSE_RICHEDIT
379
380 // ----------------------------------------------------------------------------
381 // ToolBar
382 // ----------------------------------------------------------------------------
383
384 #if wxUSE_TOOLBAR
385
386 #if !defined(TBIF_SIZE)
387
388 #define TBIF_SIZE 64
389 #define TB_SETBUTTONINFO (WM_USER+66)
390
391 typedef struct {
392 UINT cbSize;
393 DWORD dwMask;
394 int idCommand;
395 int iImage;
396 BYTE fsState;
397 BYTE fsStyle;
398 WORD cx;
399 DWORD lParam;
400 LPTSTR pszText;
401 int cchText;
402 } TBBUTTONINFO, *LPTBBUTTONINFO;
403
404 #endif // !defined(TBIF_SIZE)
405
406 #endif // wxUSE_TOOLBAR
407
408 // ----------------------------------------------------------------------------
409 // Tree control
410 // ----------------------------------------------------------------------------
411
412 #ifndef TVIS_FOCUSED
413 #define TVIS_FOCUSED 0x0001
414 #endif
415
416 #ifndef TV_FIRST
417 #define TV_FIRST 0x1100
418 #endif
419
420 #ifndef TVS_CHECKBOXES
421 #define TVS_CHECKBOXES 0x0100
422 #endif
423
424 #ifndef TVS_FULLROWSELECT
425 #define TVS_FULLROWSELECT 0x1000
426 #endif
427
428 #ifndef TVM_SETBKCOLOR
429 #define TVM_SETBKCOLOR (TV_FIRST + 29)
430 #define TVM_SETTEXTCOLOR (TV_FIRST + 30)
431 #endif
432
433 #ifndef TVS_INFOTIP
434 #define TVS_INFOTIP 2048
435 #endif
436
437 #ifndef TVN_GETINFOTIPA
438 #define TVN_GETINFOTIPA (TVN_FIRST-13)
439 #define TVN_GETINFOTIPW (TVN_FIRST-14)
440 #endif
441
442 #ifndef TVN_GETINFOTIP
443 #ifdef UNICODE
444 #define TVN_GETINFOTIP TVN_GETINFOTIPW
445 #else
446 #define TVN_GETINFOTIP TVN_GETINFOTIPA
447 #endif
448 #endif
449
450 #if !defined(NMTVGETINFOTIP) && defined(TVN_FIRST)
451 // NB: Check for TVN_FIRST is done so that this code is not included if
452 // <commctrl.h> (which defined HTREEITEM) wasn't included before.
453 struct NMTVGETINFOTIPA
454 {
455 NMHDR hdr;
456 LPSTR pszText;
457 int cchTextMax;
458 HTREEITEM hItem;
459 LPARAM lParam;
460 };
461 struct NMTVGETINFOTIPW
462 {
463 NMHDR hdr;
464 LPWSTR pszText;
465 int cchTextMax;
466 HTREEITEM hItem;
467 LPARAM lParam;
468 };
469 #ifdef UNICODE
470 #define NMTVGETINFOTIP NMTVGETINFOTIPW
471 #else
472 #define NMTVGETINFOTIP NMTVGETINFOTIPA
473 #endif
474 #endif
475
476 // ----------------------------------------------------------------------------
477 // Misc stuff
478 // ----------------------------------------------------------------------------
479
480 #ifndef CCM_SETUNICODEFORMAT
481 #define CCM_SETUNICODEFORMAT 8197
482 #endif
483
484 #ifndef QS_ALLPOSTMESSAGE
485 #define QS_ALLPOSTMESSAGE 0x0100
486 #endif
487
488 #ifndef WS_EX_CLIENTEDGE
489 #define WS_EX_CLIENTEDGE 0x00000200L
490 #endif
491
492 #ifndef ENDSESSION_LOGOFF
493 #define ENDSESSION_LOGOFF 0x80000000
494 #endif
495
496 #ifndef HANGUL_CHARSET
497 #define HANGUL_CHARSET 129
498 #endif
499
500 #ifndef TME_HOVER
501 #define TME_HOVER 1
502 #endif
503
504 #ifndef TME_LEAVE
505 #define TME_LEAVE 2
506 #endif
507
508 #ifndef TME_QUERY
509 #define TME_QUERY 0x40000000
510 #endif
511
512 #ifndef TME_CANCEL
513 #define TME_CANCEL 0x80000000
514 #endif
515
516 #ifndef HOVER_DEFAULT
517 #define HOVER_DEFAULT 0xFFFFFFFF
518 #endif
519
520 #ifdef __DMC__
521
522 typedef struct tagTRACKMOUSEEVENT {
523 DWORD cbSize;
524 DWORD dwFlags;
525 HWND hwndTrack;
526 DWORD dwHoverTime;
527 } TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT;
528
529 WINCOMMCTRLAPI BOOL WINAPI _TrackMouseEvent(LPTRACKMOUSEEVENT lpEventTrack);
530
531 #endif
532
533 // This didn't appear in mingw until 2.95.2
534 #ifndef SIF_TRACKPOS
535 #define SIF_TRACKPOS 16
536 #endif
537
538 #if wxUSE_MOUSEWHEEL
539 #ifndef WM_MOUSEWHEEL
540 #define WM_MOUSEWHEEL 0x020A
541 #endif
542 #ifndef WHEEL_DELTA
543 #define WHEEL_DELTA 120
544 #endif
545 #ifndef SPI_GETWHEELSCROLLLINES
546 #define SPI_GETWHEELSCROLLLINES 104
547 #endif
548 #endif // wxUSE_MOUSEWHEEL
549
550 #ifndef VK_OEM_1
551 #define VK_OEM_1 0xBA
552 #define VK_OEM_2 0xBF
553 #define VK_OEM_3 0xC0
554 #define VK_OEM_4 0xDB
555 #define VK_OEM_5 0xDC
556 #define VK_OEM_6 0xDD
557 #define VK_OEM_7 0xDE
558 #endif
559
560 #ifndef VK_OEM_COMMA
561 #define VK_OEM_PLUS 0xBB
562 #define VK_OEM_COMMA 0xBC
563 #define VK_OEM_MINUS 0xBD
564 #define VK_OEM_PERIOD 0xBE
565 #endif
566
567 #ifndef WM_UPDATEUISTATE
568 #define WM_UPDATEUISTATE 0x128
569 #endif
570
571 #ifndef UIS_INITIALIZE
572 #define UIS_INITIALIZE 3
573 #endif
574
575 #ifndef UISF_HIDEFOCUS
576 #define UISF_HIDEFOCUS 1
577 #endif
578
579 #ifndef UISF_HIDEACCEL
580 #define UISF_HIDEACCEL 2
581 #endif
582
583 #ifndef WC_NO_BEST_FIT_CHARS
584 #define WC_NO_BEST_FIT_CHARS 0x400
585 #endif
586
587 // In addition, include stuff not defined in WinCE
588 #ifdef __WXWINCE__
589 #include "wx/msw/wince/missing.h"
590 #endif
591
592 #endif
593 // _WX_MISSING_H_