source: trunk/src/user32/controls/controls.h@ 8543

Last change on this file since 8543 was 8543, checked in by sandervl, 23 years ago

seperate odin control dll with latest wine controls added (not activate & not finished)

File size: 5.5 KB
Line 
1/* $Id: controls.h,v 1.1 2002-06-02 10:09:28 sandervl Exp $ */
2/*
3 * Win32 common controls
4 *
5 * Copyright (c) 1999 Christoph Bratschi
6 *
7 */
8
9#ifndef __CONTROLS_H
10#define __CONTROLS_H
11
12#include <win\win.h>
13#include <heapstring.h>
14
15#define GetInfoPtr(hwnd) (GetWindowLongA(hwnd,0))
16#define SetInfoPtr(hwnd,data) \
17 SetWindowLongA(hwnd,0,data)
18
19void CONTROLS_Register();
20void CONTROLS_Unregister();
21
22BOOL BUTTON_Register();
23BOOL BUTTON_Unregister();
24BOOL COMBO_Register();
25BOOL COMBO_Unregister();
26BOOL EDIT_Register();
27BOOL EDIT_Unregister();
28BOOL LISTBOX_Register();
29BOOL LISTBOX_Unregister();
30BOOL COMBOLBOX_Register();
31BOOL COMBOLBOX_Unregister();
32BOOL COMBOBOX_Register();
33BOOL COMBOBOX_Unregister();
34BOOL SCROLLBAR_Register();
35BOOL SCROLLBAR_Unregister();
36BOOL STATIC_Register();
37BOOL STATIC_Unregister();
38
39#define BUTTON_CONTROL 0
40#define STATIC_CONTROL 1
41#define SCROLLBAR_CONTROL 2
42#define LISTBOX_CONTROL 3
43#define COMBOLBOX_CONTROL 4
44#define COMBOBOX_CONTROL 5
45#define EDIT_CONTROL 6
46#define MDICLIENT_CONTROL 7
47#define DIALOG_CONTROL 8
48#define DESKTOP_CONTROL 9
49#define WINSWITCH_CONTROL 10
50#define ICONTITLE_CONTROL 11
51#define POPUPMENU_CONTROL 12
52#define MAX_CONTROLS 13
53
54/* desktop */
55extern BOOL DESKTOP_SetPattern( LPCSTR pattern );
56
57/* icon title */
58extern HWND ICONTITLE_Create( HWND hwnd );
59
60/* menu controls */
61extern BOOL MENU_Init(void);
62extern BOOL MENU_IsMenuActive(void);
63extern HMENU MENU_GetSysMenu(HWND hWndOwner, HMENU hSysPopup);
64extern UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
65 INT orgX, INT orgY );
66extern void MENU_TrackMouseMenuBar( HWND hwnd, INT ht, POINT pt );
67extern void MENU_TrackKbdMenuBar( HWND hwnd, UINT wParam, INT vkey );
68extern UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect,
69 HWND hwnd, BOOL suppress_draw );
70extern UINT MENU_FindSubMenu( HMENU *hmenu, HMENU hSubTarget );
71
72/* scrollbar */
73extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, BOOL arrows, BOOL interior );
74extern void SCROLL_TrackScrollBar( HWND hwnd, INT scrollbar, POINT pt );
75extern INT SCROLL_SetNCSbState( HWND hwnd, int vMin, int vMax, int vPos,
76 int hMin, int hMax, int hPos );
77
78/* combo box */
79
80#define ID_CB_LISTBOX 1000
81#define ID_CB_EDIT 1001
82
83/* internal flags */
84#define CBF_DROPPED 0x0001
85#define CBF_BUTTONDOWN 0x0002
86#define CBF_NOROLLUP 0x0004
87#define CBF_MEASUREITEM 0x0008
88#define CBF_FOCUSED 0x0010
89#define CBF_CAPTURE 0x0020
90#define CBF_EDIT 0x0040
91#define CBF_NORESIZE 0x0080
92#define CBF_NOTIFY 0x0100
93#define CBF_NOREDRAW 0x0200
94#define CBF_SELCHANGE 0x0400
95#define CBF_NOEDITNOTIFY 0x1000
96#define CBF_NOLBSELECT 0x2000 /* do not change current selection */
97#define CBF_EUI 0x8000
98
99/* combo state struct */
100typedef struct
101{
102 HWND self;
103 HWND owner;
104 UINT dwStyle;
105 HWND hWndEdit;
106 HWND hWndLBox;
107 UINT wState;
108 HFONT hFont;
109 RECT textRect;
110 RECT buttonRect;
111 RECT droppedRect;
112 INT droppedIndex;
113 INT fixedOwnerDrawHeight;
114 INT droppedWidth; /* last two are not used unless set */
115 INT editHeight; /* explicitly */
116} HEADCOMBO,*LPHEADCOMBO;
117
118/* Note, that CBS_DROPDOWNLIST style is actually (CBS_SIMPLE | CBS_DROPDOWN) */
119#define CB_GETTYPE( lphc ) ((lphc)->dwStyle & (CBS_DROPDOWNLIST))
120
121extern BOOL COMBO_FlipListbox( LPHEADCOMBO, BOOL, BOOL );
122
123/* Dialog info structure */
124typedef struct
125{
126 HWND hwndFocus; /* Current control with focus */
127 HFONT hUserFont; /* Dialog font */
128 HMENU hMenu; /* Dialog menu */
129 UINT xBaseUnit; /* Dialog units (depends on the font) */
130 UINT yBaseUnit;
131 INT idResult; /* EndDialog() result / default pushbutton ID */
132 UINT flags; /* EndDialog() called for this dialog */
133 HGLOBAL16 hDialogHeap;
134} DIALOGINFO;
135
136#define DF_END 0x0001
137#define DF_OWNERENABLED 0x0002
138
139/* offset of DIALOGINFO ptr in dialog extra bytes */
140#define DWL_WINE_DIALOGINFO (DWL_USER+sizeof(ULONG_PTR))
141
142#define DIALOG_get_info( hwnd ) \
143 (DIALOGINFO *)GetWindowLongW( hwnd, DWL_WINE_DIALOGINFO )
144
145extern BOOL DIALOG_Init(void);
146
147/* Wine look */
148
149typedef enum
150{
151 WIN31_LOOK,
152 WIN95_LOOK,
153 WIN98_LOOK
154} WINE_LOOK;
155
156extern WINE_LOOK TWEAK_WineLook;
157
158#define WND_OTHER_PROCESS 0
159
160HWND WIN_GetFullHandle( HWND hwnd );
161int WIN_SuspendWndsLock( void );
162void WIN_RestoreWndsLock(int ipreviousLock);
163HWND *WIN_ListParents( HWND hwnd );
164HWND *WIN_ListChildren( HWND hwnd );
165WND *WIN_GetPtr( HWND hwnd );
166WND* WIN_FindWndPtr( HWND hwnd );
167void WIN_ReleaseWndPtr(WND *wndPtr);
168void WIN_ReleasePtr( WND *ptr );
169LONG WIN_SetStyle( HWND hwnd, LONG style );
170LONG WIN_SetExStyle( HWND hwnd, LONG style );
171void WIN_SetOwner( HWND hwnd, HWND owner );
172
173
174/* syscolor.c */
175extern HPEN SYSCOLOR_GetPen( INT index );
176
177extern const char *SPY_GetMsgName( UINT msg, HWND hWnd );
178
179/* GetAncestor() constants */
180#define GA_PARENT 1
181#define GA_ROOT 2
182#define GA_ROOTOWNER 3
183
184HWND WINAPI GetAncestor(HWND,UINT);
185
186
187HMENU WIN32API getSysMenu(HWND hwnd);
188void GetWindowRectParent(HWND hwnd, RECT *pRect);
189VOID setSysMenu(HWND hwnd,HMENU hMenu);
190
191
192extern LONG NC_HandleNCHitTest( HWND hwnd, POINT pt );
193
194
195#endif // __CONTROLS_H
Note: See TracBrowser for help on using the repository browser.