]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/missing.h
fix for [ 1052989 ] TextCtrl.SetBackgroundColour(wx.NullColour) bug
[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 // ----------------------------------------------------------------------------
189 // Toolbar define value missing
190 // ----------------------------------------------------------------------------
191 #if !defined(CCS_VERT)
192 #define CCS_VERT 0x00000080L
193 #endif
194
195 // ----------------------------------------------------------------------------
196 // MS HTML Help
197 // ----------------------------------------------------------------------------
198
199 // instead of including htmlhelp.h, duplicate the things from it we need here:
200
201 enum
202 {
203 HH_DISPLAY_TOPIC,
204 HH_DISPLAY_TOC,
205 HH_DISPLAY_INDEX,
206 HH_DISPLAY_SEARCH,
207 HH_SET_WIN_TYPE,
208 HH_GET_WIN_TYPE,
209 HH_GET_WIN_HANDLE,
210 HH_ENUM_INFO_TYPE,
211 HH_SET_INFO_TYPE,
212 HH_SYNC,
213 HH_RESERVED1,
214 HH_RESERVED2,
215 HH_RESERVED3,
216 HH_KEYWORD_LOOKUP,
217 HH_DISPLAY_TEXT_POPUP,
218 HH_HELP_CONTEXT,
219 HH_TP_HELP_CONTEXTMENU,
220 HH_TP_HELP_WM_HELP,
221 HH_CLOSE_ALL,
222 HH_ALINK_LOOKUP,
223 HH_GET_LAST_ERROR,
224 HH_ENUM_CATEGORY,
225 HH_ENUM_CATEGORY_IT,
226 HH_RESET_IT_FILTER,
227 HH_SET_INCLUSIVE_FILTER,
228 HH_SET_EXCLUSIVE_FILTER
229 };
230
231 struct HH_POPUP
232 {
233 int cbStruct;
234 HINSTANCE hinst;
235 UINT idString;
236 LPCTSTR pszText;
237 POINT pt;
238 COLORREF clrForeground;
239 COLORREF clrBackground;
240 RECT rcMargins;
241 LPCTSTR pszFont;
242 };
243
244 struct HH_AKLINK
245 {
246 int cbStruct;
247 BOOL fReserved;
248 LPCTSTR pszKeywords;
249 LPCTSTR pszUrl;
250 LPCTSTR pszMsgText;
251 LPCTSTR pszMsgTitle;
252 LPCTSTR pszWindow;
253 BOOL fIndexOnFail;
254 };
255
256 // ----------------------------------------------------------------------------
257 // SHGetFileInfo-related things
258 // ----------------------------------------------------------------------------
259
260 #ifndef SHGetFileInfo
261 #ifdef UNICODE
262 #define SHGetFileInfo SHGetFileInfoW
263 #else
264 #define SHGetFileInfo SHGetFileInfoA
265 #endif
266 #endif
267
268 #ifndef SHGFI_ATTRIBUTES
269 #define SHGFI_ATTRIBUTES 2048
270 #endif
271
272 #ifndef SFGAO_READONLY
273 #define SFGAO_READONLY 0x00040000L
274 #endif
275
276 #ifndef SFGAO_REMOVABLE
277 #define SFGAO_REMOVABLE 0x02000000L
278 #endif
279
280 #ifndef SHGFI_DISPLAYNAME
281 #define SHGFI_DISPLAYNAME 512
282 #endif
283
284 #ifndef SHGFI_ICON
285 #define SHGFI_ICON 256
286 #endif
287
288 #ifndef SHGFI_SMALLICON
289 #define SHGFI_SMALLICON 1
290 #endif
291
292 #ifndef SHGFI_SHELLICONSIZE
293 #define SHGFI_SHELLICONSIZE 4
294 #endif
295
296 #ifndef SHGFI_OPENICON
297 #define SHGFI_OPENICON 2
298 #endif
299
300 // ----------------------------------------------------------------------------
301 // Rich text control
302 // ----------------------------------------------------------------------------
303
304 #if wxUSE_RICHEDIT && defined(MAX_TAB_STOPS)
305
306 // old mingw32 doesn't define this
307 #ifndef CFM_CHARSET
308 #define CFM_CHARSET 0x08000000
309 #endif // CFM_CHARSET
310
311 #ifndef CFM_BACKCOLOR
312 #define CFM_BACKCOLOR 0x04000000
313 #endif
314
315 // cygwin does not have these defined for richedit
316 #ifndef ENM_LINK
317 #define ENM_LINK 0x04000000
318 #endif
319
320 #ifndef EM_AUTOURLDETECT
321 #define EM_AUTOURLDETECT (WM_USER + 91)
322 #endif
323
324 #ifndef EN_LINK
325 #define EN_LINK 0x070b
326
327 typedef struct _enlink
328 {
329 NMHDR nmhdr;
330 UINT msg;
331 WPARAM wParam;
332 LPARAM lParam;
333 CHARRANGE chrg;
334 } ENLINK;
335 #endif // ENLINK
336
337 #ifndef SF_UNICODE
338 #define SF_UNICODE 0x0010
339 #endif
340
341 // Watcom C++ doesn't define this
342 #ifndef SCF_ALL
343 #define SCF_ALL 0x0004
344 #endif
345
346 #ifndef PFA_JUSTIFY
347 #define PFA_JUSTIFY 4
348
349 typedef struct _paraformat2 {
350 UINT cbSize;
351 DWORD dwMask;
352 WORD wNumbering;
353 WORD wEffects;
354 LONG dxStartIndent;
355 LONG dxRightIndent;
356 LONG dxOffset;
357 WORD wAlignment;
358 SHORT cTabCount;
359 LONG rgxTabs[MAX_TAB_STOPS];
360 LONG dySpaceBefore;
361 LONG dySpaceAfter;
362 LONG dyLineSpacing;
363 SHORT sStype;
364 BYTE bLineSpacingRule;
365 BYTE bOutlineLevel;
366 WORD wShadingWeight;
367 WORD wShadingStyle;
368 WORD wNumberingStart;
369 WORD wNumberingStyle;
370 WORD wNumberingTab;
371 WORD wBorderSpace;
372 WORD wBorderWidth;
373 WORD wBorders;
374 } PARAFORMAT2;
375 #define wxEffects wReserved
376
377 #endif
378
379 #endif // wxUSE_RICHEDIT
380
381 // ----------------------------------------------------------------------------
382 // ToolBar
383 // ----------------------------------------------------------------------------
384
385 #if wxUSE_TOOLBAR
386
387 #if !defined(TBIF_SIZE)
388
389 #define TBIF_SIZE 64
390 #define TB_SETBUTTONINFO (WM_USER+66)
391
392 typedef struct {
393 UINT cbSize;
394 DWORD dwMask;
395 int idCommand;
396 int iImage;
397 BYTE fsState;
398 BYTE fsStyle;
399 WORD cx;
400 DWORD lParam;
401 LPTSTR pszText;
402 int cchText;
403 } TBBUTTONINFO, *LPTBBUTTONINFO;
404
405 #endif // !defined(TBIF_SIZE)
406
407 #endif // wxUSE_TOOLBAR
408
409 // ----------------------------------------------------------------------------
410 // Tree control
411 // ----------------------------------------------------------------------------
412
413 #ifndef TVIS_FOCUSED
414 #define TVIS_FOCUSED 0x0001
415 #endif
416
417 #ifndef TV_FIRST
418 #define TV_FIRST 0x1100
419 #endif
420
421 #ifndef TVS_CHECKBOXES
422 #define TVS_CHECKBOXES 0x0100
423 #endif
424
425 #ifndef TVS_FULLROWSELECT
426 #define TVS_FULLROWSELECT 0x1000
427 #endif
428
429 #ifndef TVM_SETBKCOLOR
430 #define TVM_SETBKCOLOR (TV_FIRST + 29)
431 #define TVM_SETTEXTCOLOR (TV_FIRST + 30)
432 #endif
433
434 #ifndef TVS_INFOTIP
435 #define TVS_INFOTIP 2048
436 #endif
437
438 #ifndef TVN_GETINFOTIPA
439 #define TVN_GETINFOTIPA (TVN_FIRST-13)
440 #define TVN_GETINFOTIPW (TVN_FIRST-14)
441 #endif
442
443 #ifndef TVN_GETINFOTIP
444 #ifdef UNICODE
445 #define TVN_GETINFOTIP TVN_GETINFOTIPW
446 #else
447 #define TVN_GETINFOTIP TVN_GETINFOTIPA
448 #endif
449 #endif
450
451 #if !defined(NMTVGETINFOTIP) && defined(TVN_FIRST)
452 // NB: Check for TVN_FIRST is done so that this code is not included if
453 // <commctrl.h> (which defined HTREEITEM) wasn't included before.
454 struct NMTVGETINFOTIPA
455 {
456 NMHDR hdr;
457 LPSTR pszText;
458 int cchTextMax;
459 HTREEITEM hItem;
460 LPARAM lParam;
461 };
462 struct NMTVGETINFOTIPW
463 {
464 NMHDR hdr;
465 LPWSTR pszText;
466 int cchTextMax;
467 HTREEITEM hItem;
468 LPARAM lParam;
469 };
470 #ifdef UNICODE
471 #define NMTVGETINFOTIP NMTVGETINFOTIPW
472 #else
473 #define NMTVGETINFOTIP NMTVGETINFOTIPA
474 #endif
475 #endif
476
477 // ----------------------------------------------------------------------------
478 // Misc stuff
479 // ----------------------------------------------------------------------------
480
481 #ifndef CCM_SETUNICODEFORMAT
482 #define CCM_SETUNICODEFORMAT 8197
483 #endif
484
485 #ifndef QS_ALLPOSTMESSAGE
486 #define QS_ALLPOSTMESSAGE 0x0100
487 #endif
488
489 #ifndef WS_EX_CLIENTEDGE
490 #define WS_EX_CLIENTEDGE 0x00000200L
491 #endif
492
493 #ifndef ENDSESSION_LOGOFF
494 #define ENDSESSION_LOGOFF 0x80000000
495 #endif
496
497 #ifndef HANGUL_CHARSET
498 #define HANGUL_CHARSET 129
499 #endif
500
501 #ifndef TME_HOVER
502 #define TME_HOVER 1
503 #endif
504
505 #ifndef TME_LEAVE
506 #define TME_LEAVE 2
507 #endif
508
509 #ifndef TME_QUERY
510 #define TME_QUERY 0x40000000
511 #endif
512
513 #ifndef TME_CANCEL
514 #define TME_CANCEL 0x80000000
515 #endif
516
517 #ifndef HOVER_DEFAULT
518 #define HOVER_DEFAULT 0xFFFFFFFF
519 #endif
520
521 #ifdef __DMC__
522
523 typedef struct tagTRACKMOUSEEVENT {
524 DWORD cbSize;
525 DWORD dwFlags;
526 HWND hwndTrack;
527 DWORD dwHoverTime;
528 } TRACKMOUSEEVENT, *LPTRACKMOUSEEVENT;
529
530 WINCOMMCTRLAPI BOOL WINAPI _TrackMouseEvent(LPTRACKMOUSEEVENT lpEventTrack);
531
532 #endif
533
534 // This didn't appear in mingw until 2.95.2
535 #ifndef SIF_TRACKPOS
536 #define SIF_TRACKPOS 16
537 #endif
538
539 #if wxUSE_MOUSEWHEEL
540 #ifndef WM_MOUSEWHEEL
541 #define WM_MOUSEWHEEL 0x020A
542 #endif
543 #ifndef WHEEL_DELTA
544 #define WHEEL_DELTA 120
545 #endif
546 #ifndef SPI_GETWHEELSCROLLLINES
547 #define SPI_GETWHEELSCROLLLINES 104
548 #endif
549 #endif // wxUSE_MOUSEWHEEL
550
551 #ifndef VK_OEM_1
552 #define VK_OEM_1 0xBA
553 #define VK_OEM_2 0xBF
554 #define VK_OEM_3 0xC0
555 #define VK_OEM_4 0xDB
556 #define VK_OEM_5 0xDC
557 #define VK_OEM_6 0xDD
558 #define VK_OEM_7 0xDE
559 #endif
560
561 #ifndef VK_OEM_COMMA
562 #define VK_OEM_PLUS 0xBB
563 #define VK_OEM_COMMA 0xBC
564 #define VK_OEM_MINUS 0xBD
565 #define VK_OEM_PERIOD 0xBE
566 #endif
567
568 #ifndef WM_UPDATEUISTATE
569 #define WM_UPDATEUISTATE 0x128
570 #endif
571
572 #ifndef UIS_INITIALIZE
573 #define UIS_INITIALIZE 3
574 #endif
575
576 #ifndef UISF_HIDEFOCUS
577 #define UISF_HIDEFOCUS 1
578 #endif
579
580 #ifndef UISF_HIDEACCEL
581 #define UISF_HIDEACCEL 2
582 #endif
583
584 #ifndef WC_NO_BEST_FIT_CHARS
585 #define WC_NO_BEST_FIT_CHARS 0x400
586 #endif
587
588 #ifndef OFN_EXPLORER
589 #define OFN_EXPLORER 0x00080000
590 #endif
591
592 #ifndef OFN_ENABLESIZING
593 #define OFN_ENABLESIZING 0x00800000
594 #endif
595
596 // ------------------ For Flashing Window -------------
597 #if (defined(__BORLANDC__) && (__BORLANDC__ < 550))
598 typedef struct {
599 UINT cbSize;
600 HWND hwnd;
601 DWORD dwFlags;
602 UINT uCount;
603 DWORD dwTimeout;
604 } FLASHWINFO, *PFLASHWINFO;
605 #endif
606
607 // In addition, include stuff not defined in WinCE
608 #ifdef __WXWINCE__
609 #include "wx/msw/wince/missing.h"
610 #endif
611
612 #endif
613 // _WX_MISSING_H_