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