source: trunk/src/user32/oslibwin.h@ 2257

Last change on this file since 2257 was 2257, checked in by cbratschi, 26 years ago

new mapping functions, fixed 1 pixel and window handle bugs

File size: 10.9 KB
Line 
1/* $Id: oslibwin.h,v 1.31 1999-12-29 22:54:01 cbratschi Exp $ */
2/*
3 * Window API wrappers for OS/2
4 *
5 *
6 * Copyright 1999 Sander van Leeuwen (sandervl@xs4all.nl)
7 * Copyright 1999 Daniela Engert (dani@ngrt.de)
8 *
9 *
10 * Project Odin Software License can be found in LICENSE.TXT
11 *
12 */
13#ifndef __OSLIBWIN_H__
14#define __OSLIBWIN_H__
15#include <oslibgdi.h>
16
17#ifndef WIN_INCLUDED
18typedef struct _SWP /* swp */
19{
20 ULONG fl;
21 LONG cy;
22 LONG cx;
23 LONG y;
24 LONG x;
25 HWND hwndInsertBehind;
26 HWND hwnd;
27 ULONG ulReserved1;
28 ULONG ulReserved2;
29} SWP, *PSWP;
30#endif
31
32#define OSLIB_HWND_DESKTOP 1
33#define OSLIB_HWND_OBJECT 2
34
35BOOL OSLibWinSetParent(HWND hwnd, HWND hwndParent, ULONG fRedraw = TRUE);
36BOOL OSLibWinSetOwner(HWND hwnd, HWND hwndOwner);
37
38
39HWND OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle,
40 char *pszName, HWND Owner, ULONG fBottom,
41 HWND *hwndFrame, ULONG id, BOOL fTaskList);
42
43BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG *dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle, ULONG *borderWidth, ULONG *borderHeight);
44void OSLibSetWindowStyle(HWND hwnd, ULONG dwStyle, BOOL fTaskList);
45
46#define OSLIB_QWL_USER -4
47
48BOOL OSLibWinSetWindowULong(HWND hwnd, ULONG offset, ULONG value);
49ULONG OSLibWinGetWindowULong(HWND hwnd, ULONG offset);
50BOOL OSLibSetWindowID(HWND hwnd, ULONG value);
51
52#define WAOS_WARNING 0
53#define WAOS_NOTE 1
54#define WAOS_ERROR 2
55#define WAOS_CWINALARMS 13 /* count of valid alarms 53304*/
56
57BOOL OSLibWinAlarm(HWND hwndDeskTop,ULONG flStyle);
58ULONG OSLibDosBeep(ULONG freg,ULONG dur);
59HWND OSLibWinQueryFocus(HWND hwndDeskTop);
60
61#define OSLIB_FID_SYSMENU 0x8002
62#define OSLIB_FID_TITLEBAR 0x8003
63#define OSLIB_FID_MINMAX 0x8004
64#define OSLIB_FID_MENU 0x8005
65#define OSLIB_FID_VERTSCROLL 0x8006
66#define OSLIB_FID_HORZSCROLL 0x8007
67#define OSLIB_FID_CLIENT 0x8008
68
69HWND OSLibWinWindowFromID(HWND hwndParent,ULONG id);
70BOOL OSLibWinSetFocus(HWND hwndDeskTop,HWND hwndNewFocus, BOOL activate);
71ULONG OSLibGetWindowHeight(HWND hwnd); //for point transformation
72
73extern ULONG ScreenHeight;
74inline ULONG OSLibQueryScreenHeight(void) { return (ScreenHeight); }
75
76//reserved deleted
77
78#define SVOS_SWAPBUTTON 0
79#define SVOS_DBLCLKTIME 1
80#define SVOS_CXDBLCLK 2
81#define SVOS_CYDBLCLK 3
82#define SVOS_CXSIZEBORDER 4
83#define SVOS_CYSIZEBORDER 5
84#define SVOS_ALARM 6
85#define SVOS_CURSORRATE 9
86#define SVOS_FIRSTSCROLLRATE 10
87#define SVOS_SCROLLRATE 11
88#define SVOS_NUMBEREDLISTS 12
89#define SVOS_WARNINGFREQ 13
90#define SVOS_NOTEFREQ 14
91#define SVOS_ERRORFREQ 15
92#define SVOS_WARNINGDURATION 16
93#define SVOS_NOTEDURATION 17
94#define SVOS_ERRORDURATION 18
95#define SVOS_CXSCREEN 20
96#define SVOS_CYSCREEN 21
97#define SVOS_CXVSCROLL 22
98#define SVOS_CYHSCROLL 23
99#define SVOS_CYVSCROLLARROW 24
100#define SVOS_CXHSCROLLARROW 25
101#define SVOS_CXBORDER 26
102#define SVOS_CYBORDER 27
103#define SVOS_CXDLGFRAME 28
104#define SVOS_CYDLGFRAME 29
105#define SVOS_CYTITLEBAR 30
106#define SVOS_CYVSLIDER 31
107#define SVOS_CXHSLIDER 32
108#define SVOS_CXMINMAXBUTTON 33
109#define SVOS_CYMINMAXBUTTON 34
110#define SVOS_CYMENU 35
111#define SVOS_CXFULLSCREEN 36
112#define SVOS_CYFULLSCREEN 37
113#define SVOS_CXICON 38
114#define SVOS_CYICON 39
115#define SVOS_CXPOINTER 40
116#define SVOS_CYPOINTER 41
117#define SVOS_DEBUG 42
118#define SVOS_CMOUSEBUTTONS 43
119#define SVOS_CPOINTERBUTTONS 43
120#define SVOS_POINTERLEVEL 44
121#define SVOS_CURSORLEVEL 45
122#define SVOS_TRACKRECTLEVEL 46
123#define SVOS_CTIMERS 47
124#define SVOS_MOUSEPRESENT 48
125#define SVOS_CXBYTEALIGN 49
126#define SVOS_CXALIGN 49
127#define SVOS_CYBYTEALIGN 50
128#define SVOS_CYALIGN 50
129
130/* The following value enables any greater value to be set by WinSetSysValue. */
131/* This is to enable the setting of SV_EXTRAKEYBEEP by applications. */
132
133#define SVOS_NOTRESERVED 56
134#define SVOS_EXTRAKEYBEEP 57
135
136/* The following system value controls whether PM controls the keyboard */
137/* lights for light key keystrokes (else applications will) */
138#define SVOS_SETLIGHTS 58
139#define SVOS_INSERTMODE 59
140
141#define SVOS_MENUROLLDOWNDELAY 64
142#define SVOS_MENUROLLUPDELAY 65
143#define SVOS_ALTMNEMONIC 66
144#define SVOS_TASKLISTMOUSEACCESS 67
145#define SVOS_CXICONTEXTWIDTH 68
146#define SVOS_CICONTEXTLINES 69
147#define SVOS_CHORDTIME 70
148#define SVOS_CXCHORD 71
149#define SVOS_CYCHORD 72
150#define SVOS_CXMOTIONSTART 73
151#define SVOS_CYMOTIONSTART 74
152#define SVOS_BEGINDRAG 75
153#define SVOS_ENDDRAG 76
154#define SVOS_SINGLESELECT 77
155#define SVOS_OPEN 78
156#define SVOS_CONTEXTMENU 79
157#define SVOS_CONTEXTHELP 80
158#define SVOS_TEXTEDIT 81
159#define SVOS_BEGINSELECT 82
160#define SVOS_ENDSELECT 83
161#define SVOS_BEGINDRAGKB 84
162#define SVOS_ENDDRAGKB 85
163#define SVOS_SELECTKB 86
164#define SVOS_OPENKB 87
165#define SVOS_CONTEXTMENUKB 88
166#define SVOS_CONTEXTHELPKB 89
167#define SVOS_TEXTEDITKB 90
168#define SVOS_BEGINSELECTKB 91
169#define SVOS_ENDSELECTKB 92
170#define SVOS_ANIMATION 93
171#define SVOS_ANIMATIONSPEED 94
172#define SVOS_MONOICONS 95
173#define SVOS_KBDALTERED 96
174#define SVOS_PRINTSCREEN 97
175#define SVOS_LOCKSTARTINPUT 98
176#define SVOS_CSYSVALUES 108
177
178LONG OSLibWinQuerySysValue(HWND hwndDeskTop,LONG iSysValue);
179ULONG OSLibWinQueryDlgItemText(HWND hwndDlg,ULONG idItem,LONG cchBufferMax,char* pchBuffer);
180BOOL OSLibWinSetDlgItemText(HWND hwndDlg,ULONG idItem,char* pszText);
181BOOL OSLibWinQueryPointerPos(HWND hwndDeskTop,PPOINT pptlPoint); //pptlPoint == POINTL pointer!
182
183#define SWPOS_SIZE 0x0001
184#define SWPOS_MOVE 0x0002
185#define SWPOS_ZORDER 0x0004
186#define SWPOS_SHOW 0x0008
187#define SWPOS_HIDE 0x0010
188#define SWPOS_NOREDRAW 0x0020
189#define SWPOS_NOADJUST 0x0040
190#define SWPOS_ACTIVATE 0x0080
191#define SWPOS_DEACTIVATE 0x0100
192#define SWPOS_EXTSTATECHANGE 0x0200
193#define SWPOS_MINIMIZE 0x0400
194#define SWPOS_MAXIMIZE 0x0800
195#define SWPOS_RESTORE 0x1000
196#define SWPOS_FOCUSACTIVATE 0x2000
197#define SWPOS_FOCUSDEACTIVATE 0x4000
198#define SWPOS_NOAUTOCLOSE 0x8000 /* Valid in PROGDETAILS struct only */
199
200#define HWNDOS_TOP (HWND)3
201#define HWNDOS_BOTTOM (HWND)4
202
203BOOL OSLibWinSetMultWindowPos(struct _SWP *pswp, ULONG num);
204BOOL OSLibWinShowWindow(HWND hwnd, ULONG fl);
205
206BOOL OSLibWinDestroyWindow(HWND hwnd);
207
208BOOL OSLibWinIsIconic(HWND hwnd);
209BOOL OSLibWinIsChild (HWND hwnd, HWND hwndOf);
210BOOL OSLibWinSetActiveWindow(HWND hwnd);
211BOOL OSLibWinSetFocus(HWND hwnd);
212BOOL OSLibWinEnableWindow(HWND hwnd, BOOL fEnable);
213BOOL OSLibWinIsWindowEnabled(HWND hwnd);
214BOOL OSLibWinIsWindowVisible(HWND hwnd);
215BOOL OSLibWinQueryActiveWindow();
216
217
218#define RELATIVE_TO_WINDOW 0
219#define RELATIVE_TO_SCREEN 1
220BOOL OSLibWinQueryWindowRect(HWND hwnd, PRECT pRect, int RelativeTo = RELATIVE_TO_WINDOW);
221BOOL OSLibWinCalcFrameRect(HWND hwnd, RECT *pRect, BOOL fClient);
222BOOL OSLibGetMinMaxInfo(HWND hwndFrame, MINMAXINFO *pMinMax);
223
224#define QWOS_NEXT 0
225#define QWOS_PREV 1
226#define QWOS_TOP 2
227#define QWOS_BOTTOM 3
228#define QWOS_OWNER 4
229#define QWOS_PARENT 5
230#define QWOS_NEXTTOP 6
231#define QWOS_PREVTOP 7
232#define QWOS_FRAMEOWNER 8
233
234HWND OSLibWinQueryWindow(HWND hwnd, ULONG lCode);
235
236LONG OSLibWinQueryWindowTextLength(HWND hwnd);
237LONG OSLibWinQueryWindowText(HWND hwnd, LONG length, LPSTR lpsz);
238BOOL OSLibWinSetWindowText(HWND hwnd, LPSTR lpsz);
239BOOL OSLibWinFlashWindow(HWND hwnd, BOOL fFlash);
240HWND OSLibWinWindowFromPoint(HWND hwnd, PVOID ppoint);
241BOOL OSLibWinMinimizeWindow(HWND hwnd);
242
243BOOL OSLibWinGetBorderSize(HWND hwnd, OSLIBPOINT *pointl);
244BOOL OSLibWinSetIcon(HWND hwnd, HANDLE hIcon);
245
246BOOL OSLibWinQueryWindowPos (HWND hwnd, PSWP pswp);
247void OSLibMapSWPtoWINDOWPOS(PSWP pswp, struct tagWINDOWPOS *pwpos, PSWP pswpOld, HWND hParent, HWND hFrame);
248void OSLibMapSWPtoWINDOWPOSFrame(PSWP pswp, struct tagWINDOWPOS *pwpos, PSWP pswpOld, HWND hParent, HWND hFrame);
249void OSLibMapWINDOWPOStoSWP(struct tagWINDOWPOS *pwpos, PSWP pswp, PSWP pswpOld, HWND hParent, HWND hFrame);
250void OSLibMapWINDOWPOStoSWPFrame(PWINDOWPOS pwpos, PSWP pswp, PSWP pswpOld, HWND hParent, HWND hFrame);
251
252HWND OSLibWinBeginEnumWindows(HWND hwnd);
253HWND OSLibWinGetNextWindow(HWND hwndEnum);
254HWND OSLibWinQueryClientWindow(HWND hwndFrame);
255BOOL OSLibWinEndEnumWindows(HWND hwndEnum);
256BOOL OSLibWinQueryWindowProcess(HWND hwnd, ULONG *pid, ULONG *tid);
257BOOL OSLibWinMapWindowPoints (HWND hwndFrom, HWND hwndTo, OSLIBPOINT *pptl, ULONG num);
258
259HWND OSLibWinObjectWindowFromID(HWND hwndOwner, ULONG ID);
260
261#define OSLIB_HSCROLL 0
262#define OSLIB_VSCROLL 1
263BOOL OSLibWinEnableScrollBar(HWND hwndParent, int scrollBar, BOOL fEnable);
264HWND OSLibWinQueryObjectWindow(VOID);
265ULONG OSLibWinGetScrollPos(HWND hwndParent, HWND hwndScroll);
266ULONG OSLibWinSetScrollPos(HWND hwndParent, HWND hwndScroll, int pos, int fRedraw);
267BOOL OSLibWinSetScrollRange(HWND hwndParent, HWND hwndScroll, int minpos,
268 int maxpos, int fRedraw);
269BOOL OSLibWinSetScrollPageSize(HWND hwndParent, HWND hwndScroll, int pagesize,
270 int totalsize, int fRedraw);
271
272void OSLibTranslateScrollCmdAndMsg(ULONG *msg, ULONG *scrollcmd);
273
274PVOID OSLibWinSubclassWindow(HWND hwnd,PVOID newWndProc);
275
276BOOL OSLibSetWindowRestoreRect(HWND hwnd, PRECT pRect);
277BOOL OSLibSetWindowMinPos(HWND hwnd, ULONG x, ULONG y);
278
279BOOL OSLibWinGetKeyboardStateTable(unsigned char * PMKeyState);
280BOOL OSLibWinSetKeyboardStateTable(unsigned char * PMKeyState);
281
282#define HTOS_NORMAL 0
283#define HTOS_TRANSPARENT (-1)
284#define HTOS_DISCARD (-2)
285#define HTOS_ERROR (-3)
286
287BOOL OSLibWinEnableWindowUpdate(HWND hwnd,BOOL fEnable);
288ULONG OSLibWinGetLastError();
289
290#endif //__OSLIBWIN_H__
Note: See TracBrowser for help on using the repository browser.