]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/msw/missing.h
added ClassRegistrar (wraps Register/UnregisterClass Win32 API calls)
[wxWidgets.git] / include / wx / msw / missing.h
... / ...
CommitLineData
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 )
95typedef 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
110typedef 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
151typedef 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
159typedef 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)
171typedef 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
201enum
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
231struct 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
244struct 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
349typedef 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
392typedef 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 #ifndef _TrackMouseEvent
524 #define _TrackMouseEvent TrackMouseEvent
525 #endif
526
527#endif
528
529// This didn't appear in mingw until 2.95.2
530#ifndef SIF_TRACKPOS
531#define SIF_TRACKPOS 16
532#endif
533
534#if wxUSE_MOUSEWHEEL
535 #ifndef WM_MOUSEWHEEL
536 #define WM_MOUSEWHEEL 0x020A
537 #endif
538 #ifndef WHEEL_DELTA
539 #define WHEEL_DELTA 120
540 #endif
541 #ifndef SPI_GETWHEELSCROLLLINES
542 #define SPI_GETWHEELSCROLLLINES 104
543 #endif
544#endif // wxUSE_MOUSEWHEEL
545
546#ifndef VK_OEM_1
547 #define VK_OEM_1 0xBA
548 #define VK_OEM_2 0xBF
549 #define VK_OEM_3 0xC0
550 #define VK_OEM_4 0xDB
551 #define VK_OEM_5 0xDC
552 #define VK_OEM_6 0xDD
553 #define VK_OEM_7 0xDE
554#endif
555
556#ifndef VK_OEM_COMMA
557 #define VK_OEM_PLUS 0xBB
558 #define VK_OEM_COMMA 0xBC
559 #define VK_OEM_MINUS 0xBD
560 #define VK_OEM_PERIOD 0xBE
561#endif
562
563#ifndef WM_UPDATEUISTATE
564 #define WM_UPDATEUISTATE 0x128
565#endif
566
567#ifndef UIS_INITIALIZE
568 #define UIS_INITIALIZE 3
569#endif
570
571#ifndef UISF_HIDEFOCUS
572 #define UISF_HIDEFOCUS 1
573#endif
574
575#ifndef UISF_HIDEACCEL
576 #define UISF_HIDEACCEL 2
577#endif
578
579#ifndef WC_NO_BEST_FIT_CHARS
580 #define WC_NO_BEST_FIT_CHARS 0x400
581#endif
582
583#ifndef OFN_EXPLORER
584 #define OFN_EXPLORER 0x00080000
585#endif
586
587#ifndef OFN_ENABLESIZING
588 #define OFN_ENABLESIZING 0x00800000
589#endif
590
591// ------------------ For Flashing Window -------------
592#if (defined(__BORLANDC__) && (__BORLANDC__ < 550))
593typedef struct {
594 UINT cbSize;
595 HWND hwnd;
596 DWORD dwFlags;
597 UINT uCount;
598 DWORD dwTimeout;
599} FLASHWINFO, *PFLASHWINFO;
600#endif
601
602// In addition, include stuff not defined in WinCE
603#ifdef __WXWINCE__
604 #include "wx/msw/wince/missing.h"
605#endif
606
607#endif
608 // _WX_MISSING_H_