1 | /* $Id: CCBase.h,v 1.12 2001-03-31 13:25:25 sandervl Exp $ */
|
---|
2 | /*
|
---|
3 | * COMCTL32 Base Functions and Macros for all Controls
|
---|
4 | *
|
---|
5 | * Copyright 2000 Christoph Bratschi (cbratschi@datacomm.ch)
|
---|
6 | */
|
---|
7 | #ifndef __CCBASE_H
|
---|
8 | #define __CCBASE_H
|
---|
9 |
|
---|
10 | #include <heapstring.h>
|
---|
11 |
|
---|
12 | #define getInfoPtr(hwnd) ((COMCTL32_HEADER*)GetWindowLongA(hwnd,0))
|
---|
13 | #define setInfoPtr(hwnd,infoPtr) (SetWindowLongA(hwnd,0,(DWORD)infoPtr))
|
---|
14 |
|
---|
15 | typedef struct
|
---|
16 | {
|
---|
17 | DWORD dwSize; //whole structure size
|
---|
18 | INT iVersion; //version
|
---|
19 | BOOL fUnicode; //Unicode flag
|
---|
20 | UINT uNotifyFormat; //notify format
|
---|
21 | HWND hwndNotify; //notify window
|
---|
22 | } COMCTL32_HEADER;
|
---|
23 |
|
---|
24 | #ifdef __cplusplus
|
---|
25 | extern "C" {
|
---|
26 | #endif
|
---|
27 |
|
---|
28 | PVOID initControl(HWND hwnd,DWORD dwSize);
|
---|
29 | VOID doneControl(HWND hwnd);
|
---|
30 |
|
---|
31 | LRESULT defComCtl32ProcA(HWND hwnd,UINT Msg,WPARAM wParam,LPARAM lParam);
|
---|
32 | LRESULT defComCtl32ProcW(HWND hwnd,UINT Msg,WPARAM wParam,LPARAM lParam);
|
---|
33 |
|
---|
34 | #ifdef __cplusplus
|
---|
35 | }
|
---|
36 | #endif
|
---|
37 |
|
---|
38 | BOOL isUnicodeNotify(COMCTL32_HEADER *infoPtr);
|
---|
39 | #ifdef __cplusplus
|
---|
40 | BOOL isUnicodeNotify(HWND hwnd);
|
---|
41 | #endif
|
---|
42 |
|
---|
43 | HWND getNotifyWindow(COMCTL32_HEADER *infoPtr);
|
---|
44 |
|
---|
45 | LRESULT sendNotify(HWND hwnd,UINT code);
|
---|
46 | #ifdef __cplusplus
|
---|
47 | LRESULT sendNotify(HWND hwndFrom,HWND hwndTo,UINT code);
|
---|
48 | LRESULT sendNotify(HWND hwnd,UINT code,LPNMHDR nmhdr);
|
---|
49 | LRESULT sendNotify(HWND hwndFrom,HWND hwndTo,UINT code,LPNMHDR nmhdr);
|
---|
50 | #endif
|
---|
51 | LRESULT sendNotifyFormat(HWND hwnd,HWND hwndFrom,LPARAM command);
|
---|
52 | LRESULT sendCommand(HWND hwnd,UINT wNotifyCode);
|
---|
53 | LRESULT sendHScroll(HWND hwnd,UINT wNotifyCode);
|
---|
54 | LRESULT sendVScroll(HWND hwnd,UINT wNotifyCode);
|
---|
55 |
|
---|
56 | HWND createToolTip(HWND hwnd,UINT flags,BOOL addtool);
|
---|
57 | VOID destroyToolTip(HWND hwndToolTip);
|
---|
58 |
|
---|
59 | VOID drawStubControl(HWND hwnd,HDC hdc);
|
---|
60 |
|
---|
61 | #define lstrlenAW(text,unicode) (unicode ? lstrlenW((WCHAR*)text):lstrlenA((CHAR*)text))
|
---|
62 |
|
---|
63 | #define lstrcpyAW(textA,unicodeA,textB,unicodeB) (unicodeA ? (unicodeB ? lstrcpyW((WCHAR*)textA,(WCHAR*)textB):lstrcpyAtoW((WCHAR*)textA,(CHAR*)textB)):(unicodeB ? lstrcpyWtoA((CHAR*)textA,(WCHAR*)textB):lstrcpyA((CHAR*)textA,(CHAR*)textB)))
|
---|
64 |
|
---|
65 | INT lstrcmpAtoW(CHAR *textA,WCHAR *textW);
|
---|
66 | INT lstrcmpAW(WCHAR *textA,BOOL textaunicode,WCHAR *textB,BOOL textbunicode);
|
---|
67 |
|
---|
68 |
|
---|
69 | //read note in CCBase.cpp!!
|
---|
70 | INT lstrcmpniA(CHAR *textA,CHAR *textB,INT len);
|
---|
71 | INT lstrcmpniAtoW(CHAR *textA,WCHAR* textB,INT len);
|
---|
72 | ////INT lstrcmpniW(WCHAR *textA,WCHAR *textB,INT len);
|
---|
73 | INT lstrcmpniAW(WCHAR *textA,BOOL unicodeA,WCHAR *textB,BOOL unicodeB,INT len);
|
---|
74 |
|
---|
75 | CHAR* lstrstrA(CHAR *text,CHAR *subtext);
|
---|
76 | WCHAR* lstrstrW(WCHAR *text,WCHAR *subtext);
|
---|
77 | CHAR* lstrstrAtoW(CHAR *text,WCHAR *subtext);
|
---|
78 | WCHAR* lstrstrWtoA(WCHAR *text,CHAR *subtext);
|
---|
79 | WCHAR* lstrstrAW(WCHAR *text,BOOL textunicode,WCHAR *subtext,BOOL subtextunicode);
|
---|
80 |
|
---|
81 | #define TICKDIFF(start,end) ((end > start) ? (end-start):(0xFFFFFFFF-start+end))
|
---|
82 |
|
---|
83 |
|
---|
84 | #endif
|
---|