source: trunk/src/user32/user32.cpp@ 1844

Last change on this file since 1844 was 1818, checked in by sandervl, 26 years ago

display api fixes

File size: 114.6 KB
Line 
1/* $Id: user32.cpp,v 1.55 1999-11-23 19:34:19 sandervl Exp $ */
2
3/*
4 * Win32 misc user32 API functions for OS/2
5 *
6 * Copyright 1998 Sander van Leeuwen
7 * Copyright 1998 Patrick Haller
8 * Copyright 1998 Peter Fitzsimmons
9 * Copyright 1999 Christoph Bratschi
10 * Copyright 1999 Daniela Engert (dani@ngrt.de)
11 *
12 *
13 * Project Odin Software License can be found in LICENSE.TXT
14 *
15 */
16/*****************************************************************************
17 * Name : USER32.CPP
18 * Purpose : This module maps all Win32 functions contained in USER32.DLL
19 * to their OS/2-specific counterparts as far as possible.
20 *****************************************************************************/
21
22//Attention: many functions belong to other subsystems, move them to their
23// right place!
24
25#include <odin.h>
26#include <odinwrap.h>
27#include <os2sel.h>
28
29#include <os2win.h>
30#include "misc.h"
31
32#include "user32.h"
33#include <winicon.h>
34#include "syscolor.h"
35#include "pmwindow.h"
36
37#include <wchar.h>
38#include <stdlib.h>
39#include <string.h>
40#include <oslibwin.h>
41#include <win32wnd.h>
42#include <winuser.h>
43
44//undocumented stuff
45// WIN32API CalcChildScroll
46// WIN32API CascadeChildWindows
47// WIN32API ClientThreadConnect
48// WIN32API DragObject
49// WIN32API DrawFrame
50// WIN32API EditWndProc
51// WIN32API EndTask
52// WIN32API GetInputDesktop
53// WIN32API GetNextQueueWindow
54// WIN32API GetShellWindow
55// WIN32API InitSharedTable
56// WIN32API InitTask
57// WIN32API IsHungThread
58// WIN32API LockWindowStation
59// WIN32API ModifyAccess
60// WIN32API PlaySoundEvent
61// WIN32API RegisterLogonProcess
62// WIN32API RegisterNetworkCapabilities
63// WIN32API RegisterSystemThread
64// WIN32API SetDeskWallpaper
65// WIN32API SetDesktopBitmap
66// WIN32API SetInternalWindowPos
67// WIN32API SetLogonNotifyWindow
68// WIN32API SetShellWindow
69// WIN32API SetSysColorsTemp
70// WIN32API SetWindowFullScreenState
71// WIN32API SwitchToThisWindow
72// WIN32API SysErrorBox
73// WIN32API TileChildWindows
74// WIN32API UnlockWindowStation
75// WIN32API UserClientDllInitialize
76// WIN32API UserSignalProc
77// WIN32API WinOldAppHackoMatic
78// WIN32API WNDPROC_CALLBACK
79// WIN32API YieldTask
80
81ODINDEBUGCHANNEL(USER32-USER32)
82
83
84/* Coordinate Transformation */
85
86inline void OS2ToWin32ScreenPos(POINT *dest,POINT *source)
87{
88 dest->x = source->x;
89 dest->y = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CYSCREEN)-1-source->y;
90}
91
92inline void Win32ToOS2ScreenPos(POINT *dest,POINT *source)
93{
94 OS2ToWin32ScreenPos(dest,source); //transform back
95}
96
97/* Rectangle Functions - parts from wine/windows/rect.c */
98
99BOOL WIN32API CopyRect( PRECT lprcDst, const RECT * lprcSrc)
100{
101 dprintf2(("USER32: CopyRect\n"));
102 if (!lprcDst || !lprcSrc) {
103 SetLastError(ERROR_INVALID_PARAMETER);
104 return FALSE;
105 }
106
107 memcpy(lprcDst,lprcSrc,sizeof(RECT));
108
109 return TRUE;
110}
111//******************************************************************************
112//******************************************************************************
113BOOL WIN32API EqualRect( const RECT *lprc1, const RECT *lprc2)
114{
115 dprintf2(("USER32: EqualRect\n"));
116 if (!lprc1 || !lprc2)
117 {
118 SetLastError(ERROR_INVALID_PARAMETER);
119 return FALSE;
120 }
121
122 return (lprc1->left == lprc2->left &&
123 lprc1->right == lprc2->right &&
124 lprc1->top == lprc2->top &&
125 lprc1->bottom == lprc2->bottom);
126}
127//******************************************************************************
128//******************************************************************************
129BOOL WIN32API InflateRect( PRECT lprc, int dx, int dy)
130{
131 dprintf(("USER32: InflateRect\n"));
132 if (!lprc)
133 {
134 SetLastError(ERROR_INVALID_PARAMETER);
135 return FALSE;
136 }
137
138 lprc->left -= dx;
139 lprc->right += dx;
140 lprc->top -= dy;
141 lprc->bottom += dy;
142
143 return TRUE;
144}
145//******************************************************************************
146//******************************************************************************
147BOOL WIN32API IntersectRect( PRECT lprcDst, const RECT * lprcSrc1, const RECT * lprcSrc2)
148{
149 dprintf2(("USER32: IntersectRect\n"));
150 if (!lprcDst || !lprcSrc1 || !lprcSrc2)
151 {
152 SetLastError(ERROR_INVALID_PARAMETER);
153 return FALSE;
154 }
155
156 if (IsRectEmpty(lprcSrc1) || IsRectEmpty(lprcSrc2) ||
157 (lprcSrc1->left >= lprcSrc2->right) || (lprcSrc2->left >= lprcSrc1->right) ||
158 (lprcSrc1->top >= lprcSrc2->bottom) || (lprcSrc2->top >= lprcSrc1->bottom))
159 {
160 SetLastError(ERROR_INVALID_PARAMETER);
161 SetRectEmpty(lprcDst);
162 return FALSE;
163 }
164 lprcDst->left = MAX(lprcSrc1->left,lprcSrc2->left);
165 lprcDst->right = MIN(lprcSrc1->right,lprcSrc2->right);
166 lprcDst->top = MAX(lprcSrc1->top,lprcSrc2->top);
167 lprcDst->bottom = MIN(lprcSrc1->bottom,lprcSrc2->bottom);
168
169 return TRUE;
170}
171//******************************************************************************
172//******************************************************************************
173BOOL WIN32API IsRectEmpty( const RECT * lprc)
174{
175 if (!lprc)
176 {
177 SetLastError(ERROR_INVALID_PARAMETER);
178 return FALSE;
179 }
180
181 return (lprc->left == lprc->right || lprc->top == lprc->bottom);
182}
183//******************************************************************************
184//******************************************************************************
185BOOL WIN32API OffsetRect( PRECT lprc, int x, int y)
186{
187 dprintf2(("USER32: OffsetRect\n"));
188 if (!lprc)
189 {
190 SetLastError(ERROR_INVALID_PARAMETER);
191 return FALSE;
192 }
193
194 lprc->left += x;
195 lprc->right += x;
196 lprc->top += y;
197 lprc->bottom += y;
198
199 return TRUE;
200}
201//******************************************************************************
202//******************************************************************************
203BOOL WIN32API PtInRect( const RECT *lprc, POINT pt)
204{
205 dprintf2(("USER32: PtInRect\n"));
206 if (!lprc)
207 {
208 SetLastError(ERROR_INVALID_PARAMETER);
209 return FALSE;
210 }
211
212 return (pt.x >= lprc->left &&
213 pt.x < lprc->right &&
214 pt.y >= lprc->top &&
215 pt.y < lprc->bottom);
216}
217//******************************************************************************
218//******************************************************************************
219BOOL WIN32API SetRect( PRECT lprc, int nLeft, int nTop, int nRight, int nBottom)
220{
221 if (!lprc)
222 {
223 SetLastError(ERROR_INVALID_PARAMETER);
224 return FALSE;
225 }
226
227 lprc->left = nLeft;
228 lprc->top = nTop;
229 lprc->right = nRight;
230 lprc->bottom = nBottom;
231
232 return TRUE;
233}
234//******************************************************************************
235//******************************************************************************
236BOOL WIN32API SetRectEmpty( PRECT lprc)
237{
238 if (!lprc)
239 {
240 SetLastError(ERROR_INVALID_PARAMETER);
241 return FALSE;
242 }
243
244 lprc->left = lprc->right = lprc->top = lprc->bottom = 0;
245
246 return TRUE;
247}
248//******************************************************************************
249//******************************************************************************
250BOOL WIN32API SubtractRect( PRECT lprcDest, const RECT * lprcSrc1, const RECT * lprcSrc2)
251{
252 dprintf2(("USER32: SubtractRect"));
253 RECT tmp;
254
255 if (!lprcDest || !lprcSrc1 || !lprcSrc2)
256 {
257 SetLastError(ERROR_INVALID_PARAMETER);
258 return FALSE;
259 }
260
261 if (IsRectEmpty(lprcSrc1))
262 {
263 SetLastError(ERROR_INVALID_PARAMETER);
264 SetRectEmpty(lprcDest);
265 return FALSE;
266 }
267 *lprcDest = *lprcSrc1;
268 if (IntersectRect(&tmp,lprcSrc1,lprcSrc2))
269 {
270 if (EqualRect(&tmp,lprcDest))
271 {
272 SetRectEmpty(lprcDest);
273 return FALSE;
274 }
275 if ((tmp.top == lprcDest->top) && (tmp.bottom == lprcDest->bottom))
276 {
277 if (tmp.left == lprcDest->left) lprcDest->left = tmp.right;
278 else if (tmp.right == lprcDest->right) lprcDest->right = tmp.left;
279 }
280 else if ((tmp.left == lprcDest->left) && (tmp.right == lprcDest->right))
281 {
282 if (tmp.top == lprcDest->top) lprcDest->top = tmp.bottom;
283 else if (tmp.bottom == lprcDest->bottom) lprcDest->bottom = tmp.top;
284 }
285 }
286
287 return TRUE;
288}
289//******************************************************************************
290//******************************************************************************
291BOOL WIN32API UnionRect( PRECT lprcDst, const RECT *lprcSrc1, const RECT *lprcSrc2)
292{
293 dprintf2(("USER32: UnionRect\n"));
294 if (!lprcDst || !lprcSrc1 || !lprcSrc2)
295 {
296 SetLastError(ERROR_INVALID_PARAMETER);
297 return FALSE;
298 }
299
300 if (IsRectEmpty(lprcSrc1))
301 {
302 if (IsRectEmpty(lprcSrc2))
303 {
304 SetLastError(ERROR_INVALID_PARAMETER);
305 SetRectEmpty(lprcDst);
306 return FALSE;
307 }
308 else *lprcDst = *lprcSrc2;
309 }
310 else
311 {
312 if (IsRectEmpty(lprcSrc2)) *lprcDst = *lprcSrc1;
313 else
314 {
315 lprcDst->left = MIN(lprcSrc1->left,lprcSrc2->left);
316 lprcDst->right = MAX(lprcSrc1->right,lprcSrc2->right);
317 lprcDst->top = MIN(lprcSrc1->top,lprcSrc2->top);
318 lprcDst->bottom = MAX(lprcSrc1->bottom,lprcSrc2->bottom);
319 }
320 }
321
322 return TRUE;
323}
324
325/* Cursor Functions */
326
327BOOL WIN32API ClipCursor(const RECT * lpRect)
328{
329 dprintf(("USER32: ClipCursor\n"));
330 return O32_ClipCursor(lpRect);
331}
332//******************************************************************************
333//******************************************************************************
334HCURSOR WIN32API CreateCursor( HINSTANCE hInst, int xHotSpot, int yHotSpot, int nWidth, int nHeight, const VOID *pvANDPlane, const VOID *pvXORPlane)
335{
336 dprintf(("USER32: CreateCursor\n"));
337 return O32_CreateCursor(hInst,xHotSpot,yHotSpot,nWidth,nHeight,pvANDPlane,pvXORPlane);
338}
339//******************************************************************************
340//******************************************************************************
341BOOL WIN32API DestroyCursor( HCURSOR hCursor)
342{
343 dprintf(("USER32: DestroyCursor\n"));
344 return O32_DestroyCursor(hCursor);
345}
346//******************************************************************************
347//******************************************************************************
348BOOL WIN32API GetClipCursor( LPRECT lpRect)
349{
350 dprintf(("USER32: GetClipCursor\n"));
351 return O32_GetClipCursor(lpRect);
352}
353//******************************************************************************
354//******************************************************************************
355HCURSOR WIN32API GetCursor(void)
356{
357 dprintf2(("USER32: GetCursor\n"));
358 return O32_GetCursor();
359}
360//******************************************************************************
361//******************************************************************************
362BOOL WIN32API GetCursorPos( PPOINT lpPoint)
363{
364 BOOL rc;
365 POINT point;
366
367 dprintf2(("USER32: GetCursorPos\n"));
368
369 if (!lpPoint) return FALSE;
370 if (OSLibWinQueryPointerPos(OSLIB_HWND_DESKTOP,&point)) //POINT == POINTL
371 {
372 OS2ToWin32ScreenPos(lpPoint,&point);
373 return TRUE;
374 } else return FALSE;
375}
376/*****************************************************************************
377 * Name : HCURSOR WIN32API LoadCursorFromFileA
378 * Purpose : The LoadCursorFromFile function creates a cursor based on data
379 * contained in a file. The file is specified by its name or by a
380 * system cursor identifier. The function returns a handle to the
381 * newly created cursor. Files containing cursor data may be in
382 * either cursor (.CUR) or animated cursor (.ANI) format.
383 * Parameters: LPCTSTR lpFileName pointer to cursor file, or system cursor id
384 * Variables :
385 * Result : If the function is successful, the return value is a handle to
386 * the new cursor.
387 * If the function fails, the return value is NULL. To get extended
388 * error information, call GetLastError. GetLastError may return
389 * the following
390 * Remark :
391 * Status : UNTESTED STUB
392 *
393 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
394 *****************************************************************************/
395HCURSOR WIN32API LoadCursorFromFileA(LPCTSTR lpFileName)
396{
397 if (!HIWORD(lpFileName))
398 {
399 return LoadCursorA(NULL,lpFileName);
400 }
401 else
402 {
403 dprintf(("USER32:LoadCursorFromFileA (%s) not implemented.\n",
404 lpFileName));
405
406 return (NULL);
407 }
408}
409/*****************************************************************************
410 * Name : HCURSOR WIN32API LoadCursorFromFileW
411 * Purpose : The LoadCursorFromFile function creates a cursor based on data
412 * contained in a file. The file is specified by its name or by a
413 * system cursor identifier. The function returns a handle to the
414 * newly created cursor. Files containing cursor data may be in
415 * either cursor (.CUR) or animated cursor (.ANI) format.
416 * Parameters: LPCTSTR lpFileName pointer to cursor file, or system cursor id
417 * Variables :
418 * Result : If the function is successful, the return value is a handle to
419 * the new cursor.
420 * If the function fails, the return value is NULL. To get extended
421 * error information, call GetLastError. GetLastError may return
422 * the following
423 * Remark :
424 * Status : UNTESTED STUB
425 *
426 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
427 *****************************************************************************/
428HCURSOR WIN32API LoadCursorFromFileW(LPCWSTR lpFileName)
429{
430 if (!HIWORD(lpFileName))
431 {
432 return LoadCursorW(NULL,lpFileName);
433 } else
434 {
435 dprintf(("USER32:LoadCursorFromFileW (%s) not implemented.\n",
436 lpFileName));
437
438 return (NULL);
439 }
440}
441//******************************************************************************
442//******************************************************************************
443HCURSOR WIN32API SetCursor( HCURSOR hcur)
444{
445 HCURSOR rc;
446
447 rc = O32_SetCursor(hcur);
448 dprintf(("USER32: SetCursor %x (prev %x (%x))\n", hcur, rc, O32_GetCursor()));
449 return rc;
450}
451//******************************************************************************
452//******************************************************************************
453BOOL WIN32API SetCursorPos( int X, int Y)
454{
455 dprintf(("USER32: SetCursorPos %d %d", X,Y));
456 return O32_SetCursorPos(X,Y);
457}
458/*****************************************************************************
459 * Name : BOOL WIN32API SetSystemCursor
460 * Purpose : The SetSystemCursor function replaces the contents of the system
461 * cursor specified by dwCursorId with the contents of the cursor
462 * specified by hCursor, and then destroys hCursor. This function
463 * lets an application customize the system cursors.
464 * Parameters: HCURSOR hCursor set specified system cursor to this cursor's
465 * contents, then destroy this
466 * DWORD dwCursorID system cursor specified by its identifier
467 * Variables :
468 * Result : If the function succeeds, the return value is TRUE.
469 * If the function fails, the return value is FALSE. To get extended
470 * error information, call GetLastError.
471 * Remark :
472 * Status : UNTESTED STUB
473 *
474 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
475 *****************************************************************************/
476BOOL WIN32API SetSystemCursor(HCURSOR hCursor,
477 DWORD dwCursorId)
478{
479 dprintf(("USER32:SetSystemCursor (%08xh,%08x) not supported.\n",
480 hCursor,
481 dwCursorId));
482
483 return DestroyCursor(hCursor);
484}
485//******************************************************************************
486//******************************************************************************
487int WIN32API ShowCursor( BOOL bShow)
488{
489 dprintf2(("USER32: ShowCursor %d", bShow));
490 return O32_ShowCursor(bShow);
491}
492
493/* Mouse Input Functions */
494
495/*****************************************************************************
496 * Name : BOOL WIN32API DragDetect
497 * Purpose : The DragDetect function captures the mouse and tracks its movement
498 * Parameters: HWND hwnd
499 * POINT pt
500 * Variables :
501 * Result : If the user moved the mouse outside of the drag rectangle while
502 * holding the left button down, the return value is TRUE.
503 * If the user did not move the mouse outside of the drag rectangle
504 * while holding the left button down, the return value is FALSE.
505 * Remark :
506 * Status : UNTESTED STUB
507 *
508 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
509 *****************************************************************************/
510BOOL WIN32API DragDetect(HWND hwnd,
511 POINT pt)
512{
513 dprintf(("USER32:DragDetect(%08xh,...) not implemented.\n",
514 hwnd));
515
516 return (FALSE);
517}
518//******************************************************************************
519//******************************************************************************
520UINT WIN32API GetDoubleClickTime(void)
521{
522 dprintf(("USER32: GetDoubleClickTime\n"));
523 return O32_GetDoubleClickTime();
524}
525/*****************************************************************************
526 * Name : VOID WIN32API mouse_event
527 * Purpose : The mouse_event function synthesizes mouse motion and button clicks.
528 * Parameters: DWORD dwFlags flags specifying various motion/click variants
529 * DWORD dx horizontal mouse position or position change
530 * DWORD dy vertical mouse position or position change
531 * DWORD cButtons unused, reserved for future use, set to zero
532 * DWORD dwExtraInfo 32 bits of application-defined information
533 * Variables :
534 * Result :
535 * Remark :
536 * Status : UNTESTED STUB
537 *
538 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
539 *****************************************************************************/
540VOID WIN32API mouse_event(DWORD dwFlags,
541 DWORD dx,
542 DWORD dy,
543 DWORD cButtons,
544 DWORD dwExtraInfo)
545{
546 dprintf(("USER32:mouse_event (%08xh,%u,%u,%u,%08x) not implemented.\n",
547 dwFlags,
548 dx,
549 dy,
550 cButtons,
551 dwExtraInfo));
552}
553//******************************************************************************
554//******************************************************************************
555BOOL WIN32API ReleaseCapture(void)
556{
557 dprintf(("USER32: ReleaseCapture"));
558 return O32_ReleaseCapture();
559}
560//******************************************************************************
561//******************************************************************************
562HWND WIN32API GetCapture(void)
563{
564 HWND hwnd;
565
566 hwnd = Win32Window::OS2ToWin32Handle(O32_GetCapture());
567 dprintf(("USER32: GetCapture returned %x", hwnd));
568 return hwnd;
569}
570//******************************************************************************
571//******************************************************************************
572HWND WIN32API SetCapture( HWND hwnd)
573{
574#ifdef DEBUG
575 WriteLog("USER32: SetCapture %x", hwnd);
576#endif
577 hwnd = Win32Window::Win32ToOS2Handle(hwnd);
578 return Win32Window::OS2ToWin32Handle(O32_SetCapture(hwnd));
579}
580//******************************************************************************
581//******************************************************************************
582BOOL WIN32API SetDoubleClickTime( UINT uInterval)
583{
584#ifdef DEBUG
585 WriteLog("USER32: SetDoubleClickTime\n");
586#endif
587 return O32_SetDoubleClickTime(uInterval);
588}
589//******************************************************************************
590//******************************************************************************
591BOOL WIN32API SwapMouseButton( BOOL fSwap)
592{
593#ifdef DEBUG
594 WriteLog("USER32: SwapMouseButton\n");
595#endif
596 return O32_SwapMouseButton(fSwap);
597}
598
599/* Error Functions */
600
601/*****************************************************************************
602 * Name : ExitWindowsEx
603 * Purpose : Shutdown System
604 * Parameters: UINT uFlags
605 * DWORD dwReserved
606 * Variables :
607 * Result : TRUE / FALSE
608 * Remark :
609 * Status :
610 *
611 * Author : Patrick Haller [Tue, 1999/10/20 21:24]
612 *****************************************************************************/
613
614ODINFUNCTION2(BOOL, ExitWindowsEx, UINT, uFlags,
615 DWORD, dwReserved)
616{
617 int rc = MessageBoxA(HWND_DESKTOP,
618 "Are you sure you want to shutdown the system?",
619 "Shutdown ...",
620 MB_YESNOCANCEL | MB_ICONQUESTION);
621 switch (rc)
622 {
623 case IDCANCEL: return (FALSE);
624 case IDYES: break;
625 case IDNO:
626 dprintf(("no shutdown!\n"));
627 return TRUE;
628 }
629
630 return O32_ExitWindowsEx(uFlags,dwReserved);
631}
632
633
634//******************************************************************************
635//******************************************************************************
636BOOL WIN32API MessageBeep( UINT uType)
637{
638 INT flStyle;
639
640#ifdef DEBUG
641 WriteLog("USER32: MessageBeep\n");
642#endif
643
644 switch (uType)
645 {
646 case 0xFFFFFFFF:
647 OSLibDosBeep(500,50);
648 return TRUE;
649 case MB_ICONASTERISK:
650 flStyle = WAOS_NOTE;
651 break;
652 case MB_ICONEXCLAMATION:
653 flStyle = WAOS_WARNING;
654 break;
655 case MB_ICONHAND:
656 case MB_ICONQUESTION:
657 case MB_OK:
658 flStyle = WAOS_NOTE;
659 break;
660 default:
661 flStyle = WAOS_ERROR; //CB: should be right
662 break;
663 }
664 return OSLibWinAlarm(OSLIB_HWND_DESKTOP,flStyle);
665}
666//******************************************************************************
667//2nd parameter not used according to SDK (yet?)
668//******************************************************************************
669VOID WIN32API SetLastErrorEx(DWORD dwErrCode, DWORD dwType)
670{
671#ifdef DEBUG
672 WriteLog("USER32: SetLastErrorEx\n");
673#endif
674 SetLastError(dwErrCode);
675}
676
677/* Accessibility Functions */
678
679int WIN32API GetSystemMetrics(int nIndex)
680{
681 int rc = 0;
682
683 switch(nIndex) {
684 case SM_CXICONSPACING: //TODO: size of grid cell for large icons
685 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CXICON);
686 //CB: return standard windows icon size?
687 //rc = 32;
688 break;
689 case SM_CYICONSPACING:
690 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CYICON);
691 //read SM_CXICONSPACING comment
692 //rc = 32;
693 break;
694 case SM_PENWINDOWS:
695 rc = FALSE;
696 break;
697 case SM_DBCSENABLED:
698 rc = FALSE;
699 break;
700 case SM_CXEDGE: //size of 3D window edge (not supported)
701 rc = 1;
702 break;
703 case SM_CYEDGE:
704 rc = 1;
705 break;
706 case SM_CXMINSPACING: //can be SM_CXMINIMIZED or larger
707 //CB: replace with const
708 rc = O32_GetSystemMetrics(SM_CXMINIMIZED);
709 break;
710 case SM_CYMINSPACING:
711 //CB: replace with const
712 rc = GetSystemMetrics(SM_CYMINIMIZED);
713 break;
714 case SM_CXICON:
715 case SM_CYICON:
716 rc = 32; //CB: Win32: only 32x32, OS/2 32x32/40x40
717 // we must implement 32x32 for all screen resolutions
718 break;
719 case SM_CXSMICON: //recommended size of small icons (TODO: adjust to screen res.)
720 rc = 16;
721 break;
722 case SM_CYSMICON:
723 rc = 16;
724 break;
725 case SM_CYSMCAPTION: //size in pixels of a small caption (TODO: ????)
726 rc = 8;
727 break;
728 case SM_CXSMSIZE: //size of small caption buttons (pixels) (TODO: implement properly)
729 rc = 16;
730 break;
731 case SM_CYSMSIZE:
732 rc = 16;
733 break;
734 case SM_CXMENUSIZE: //TODO: size of menu bar buttons (such as MDI window close)
735 rc = 16;
736 break;
737 case SM_CYMENUSIZE:
738 rc = 16;
739 break;
740 case SM_ARRANGE:
741 rc = ARW_BOTTOMLEFT | ARW_LEFT;
742 break;
743 case SM_CXMINIMIZED:
744 break;
745 case SM_CYMINIMIZED:
746 break;
747 case SM_CXMAXTRACK: //max window size
748 case SM_CXMAXIMIZED: //max toplevel window size
749 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CXSCREEN);
750 break;
751 case SM_CYMAXTRACK:
752 case SM_CYMAXIMIZED:
753 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CYSCREEN);
754 break;
755 case SM_NETWORK:
756 rc = 0x01; //TODO: default = yes
757 break;
758 case SM_CLEANBOOT:
759 rc = 0; //normal boot
760 break;
761 case SM_CXDRAG: //nr of pixels before drag becomes a real one
762 rc = 2;
763 break;
764 case SM_CYDRAG:
765 rc = 2;
766 break;
767 case SM_SHOWSOUNDS: //show instead of play sound
768 rc = FALSE;
769 break;
770 case SM_CXMENUCHECK:
771 rc = 4; //TODO
772 break;
773 case SM_CYMENUCHECK:
774 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CYMENU);
775 break;
776 case SM_SLOWMACHINE:
777 rc = FALSE; //even a slow machine is fast with OS/2 :)
778 break;
779 case SM_MIDEASTENABLED:
780 rc = FALSE;
781 break;
782 case SM_MOUSEWHEELPRESENT:
783 rc = FALSE;
784 break;
785 case SM_XVIRTUALSCREEN:
786 rc = 0;
787 break;
788 case SM_YVIRTUALSCREEN:
789 rc = 0;
790 break;
791 case SM_CXSCREEN:
792
793 return ScreenWidth;
794 case SM_CYSCREEN:
795 return ScreenHeight;
796
797 case SM_CXVIRTUALSCREEN:
798 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CXSCREEN);
799 break;
800 case SM_CYVIRTUALSCREEN:
801 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CYSCREEN);
802 break;
803 case SM_CMONITORS:
804 rc = 1;
805 break;
806 case SM_SAMEDISPLAYFORMAT:
807 rc = TRUE;
808 break;
809 case SM_CMETRICS:
810 rc = 81;
811 //rc = O32_GetSystemMetrics(44); //Open32 changed this one
812 break;
813 default:
814 //better than nothing
815 rc = O32_GetSystemMetrics(nIndex);
816 break;
817 }
818 dprintf(("USER32: GetSystemMetrics %d returned %d\n", nIndex, rc));
819 return(rc);
820}
821//******************************************************************************
822/* Not support by Open32 (not included are the new win9x parameters):
823 case SPI_GETFASTTASKSWITCH:
824 case SPI_GETGRIDGRANULARITY:
825 case SPI_GETICONTITLELOGFONT:
826 case SPI_GETICONTITLEWRAP:
827 case SPI_GETMENUDROPALIGNMENT:
828 case SPI_ICONHORIZONTALSPACING:
829 case SPI_ICONVERTICALSPACING:
830 case SPI_LANGDRIVER:
831 case SPI_SETFASTTASKSWITCH:
832 case SPI_SETGRIDGRANULARITY:
833 case SPI_SETICONTITLELOGFONT:
834 case SPI_SETICONTITLEWRAP:
835 case SPI_SETMENUDROPALIGNMENT:
836 case SPI_GETSCREENSAVEACTIVE:
837 case SPI_GETSCREENSAVETIMEOUT:
838 case SPI_SETDESKPATTERN:
839 case SPI_SETDESKWALLPAPER:
840 case SPI_SETSCREENSAVEACTIVE:
841 case SPI_SETSCREENSAVETIMEOUT:
842*/
843//******************************************************************************
844BOOL WIN32API SystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
845{
846 BOOL rc = TRUE;
847 NONCLIENTMETRICSA *cmetric = (NONCLIENTMETRICSA *)pvParam;
848
849 switch(uiAction) {
850 case SPI_SCREENSAVERRUNNING:
851 *(BOOL *)pvParam = FALSE;
852 break;
853 case SPI_GETDRAGFULLWINDOWS:
854 *(BOOL *)pvParam = FALSE;
855 break;
856 case SPI_GETNONCLIENTMETRICS:
857 memset(cmetric, 0, sizeof(NONCLIENTMETRICSA));
858 cmetric->cbSize = sizeof(NONCLIENTMETRICSA);
859
860 //CB: fonts not handled by Open32, set to WarpSans
861 lstrcpyA(cmetric->lfCaptionFont.lfFaceName,"WarpSans");
862 cmetric->lfCaptionFont.lfHeight = 9;
863
864 lstrcpyA(cmetric->lfMenuFont.lfFaceName,"WarpSans");
865 cmetric->lfMenuFont.lfHeight = 9;
866
867 lstrcpyA(cmetric->lfStatusFont.lfFaceName,"WarpSans");
868 cmetric->lfStatusFont.lfHeight = 9;
869
870 lstrcpyA(cmetric->lfMessageFont.lfFaceName,"WarpSans");
871 cmetric->lfMessageFont.lfHeight = 9;
872
873 cmetric->iBorderWidth = GetSystemMetrics(SM_CXBORDER);
874 cmetric->iScrollWidth = GetSystemMetrics(SM_CXHSCROLL);
875 cmetric->iScrollHeight = GetSystemMetrics(SM_CYHSCROLL);
876 cmetric->iCaptionWidth = 32; //TODO
877 cmetric->iCaptionHeight = 16; //TODO
878 cmetric->iSmCaptionWidth = GetSystemMetrics(SM_CXSMSIZE);
879 cmetric->iSmCaptionHeight = GetSystemMetrics(SM_CYSMSIZE);
880 cmetric->iMenuWidth = 32; //TODO
881 cmetric->iMenuHeight = GetSystemMetrics(SM_CYMENU);
882 break;
883 case SPI_GETICONTITLELOGFONT:
884 {
885 LPLOGFONTA lpLogFont = (LPLOGFONTA)pvParam;
886
887 /* from now on we always have an alias for MS Sans Serif */
888 strcpy(lpLogFont->lfFaceName, "MS Sans Serif");
889 lpLogFont->lfHeight = -GetProfileIntA("Desktop","IconTitleSize", 8);
890 lpLogFont->lfWidth = 0;
891 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
892 lpLogFont->lfWeight = FW_NORMAL;
893 lpLogFont->lfItalic = FALSE;
894 lpLogFont->lfStrikeOut = FALSE;
895 lpLogFont->lfUnderline = FALSE;
896 lpLogFont->lfCharSet = ANSI_CHARSET;
897 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
898 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
899 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
900 break;
901 }
902 case SPI_GETBORDER:
903 *(INT *)pvParam = GetSystemMetrics( SM_CXFRAME );
904 break;
905
906 case SPI_GETWORKAREA:
907 SetRect( (RECT *)pvParam, 0, 0,
908 GetSystemMetrics( SM_CXSCREEN ),
909 GetSystemMetrics( SM_CYSCREEN )
910 );
911 break;
912
913 case 104: //TODO: Undocumented
914 rc = 16;
915 break;
916 default:
917 rc = O32_SystemParametersInfo(uiAction, uiParam, pvParam, fWinIni);
918 break;
919 }
920 dprintf(("USER32: SystemParametersInfoA %d, returned %d\n", uiAction, rc));
921 return(rc);
922}
923//******************************************************************************
924//TODO: Check for more options that have different structs for Unicode!!!!
925//******************************************************************************
926BOOL WIN32API SystemParametersInfoW(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
927{
928 BOOL rc;
929 NONCLIENTMETRICSW *clientMetricsW = (NONCLIENTMETRICSW *)pvParam;
930 NONCLIENTMETRICSA clientMetricsA = {0};
931 PVOID pvParamA;
932 UINT uiParamA;
933
934 switch(uiAction) {
935 case SPI_SETNONCLIENTMETRICS:
936 clientMetricsA.cbSize = sizeof(NONCLIENTMETRICSA);
937 clientMetricsA.iBorderWidth = clientMetricsW->iBorderWidth;
938 clientMetricsA.iScrollWidth = clientMetricsW->iScrollWidth;
939 clientMetricsA.iScrollHeight = clientMetricsW->iScrollHeight;
940 clientMetricsA.iCaptionWidth = clientMetricsW->iCaptionWidth;
941 clientMetricsA.iCaptionHeight = clientMetricsW->iCaptionHeight;
942 ConvertFontWA(&clientMetricsW->lfCaptionFont, &clientMetricsA.lfCaptionFont);
943 clientMetricsA.iSmCaptionWidth = clientMetricsW->iSmCaptionWidth;
944 clientMetricsA.iSmCaptionHeight = clientMetricsW->iSmCaptionHeight;
945 ConvertFontWA(&clientMetricsW->lfSmCaptionFont, &clientMetricsA.lfSmCaptionFont);
946 clientMetricsA.iMenuWidth = clientMetricsW->iMenuWidth;
947 clientMetricsA.iMenuHeight = clientMetricsW->iMenuHeight;
948 ConvertFontWA(&clientMetricsW->lfMenuFont, &clientMetricsA.lfMenuFont);
949 ConvertFontWA(&clientMetricsW->lfStatusFont, &clientMetricsA.lfStatusFont);
950 ConvertFontWA(&clientMetricsW->lfMessageFont, &clientMetricsA.lfMessageFont);
951 //no break
952 case SPI_GETNONCLIENTMETRICS:
953 uiParamA = sizeof(NONCLIENTMETRICSA);
954 pvParamA = &clientMetricsA;
955 break;
956 case SPI_GETICONTITLELOGFONT:
957 {
958 LPLOGFONTW lpLogFont = (LPLOGFONTW)pvParam;
959
960 /* from now on we always have an alias for MS Sans Serif */
961 lstrcpyW(lpLogFont->lfFaceName, (LPCWSTR)L"MS Sans Serif");
962 lpLogFont->lfHeight = -GetProfileIntA("Desktop","IconTitleSize", 8);
963 lpLogFont->lfWidth = 0;
964 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
965 lpLogFont->lfWeight = FW_NORMAL;
966 lpLogFont->lfItalic = FALSE;
967 lpLogFont->lfStrikeOut = FALSE;
968 lpLogFont->lfUnderline = FALSE;
969 lpLogFont->lfCharSet = ANSI_CHARSET;
970 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
971 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
972 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
973 return TRUE;
974 }
975 default:
976 pvParamA = pvParam;
977 uiParamA = uiParam;
978 break;
979 }
980 rc = SystemParametersInfoA(uiAction, uiParamA, pvParamA, fWinIni);
981
982 switch(uiAction) {
983 case SPI_GETNONCLIENTMETRICS:
984 clientMetricsW->cbSize = sizeof(*clientMetricsW);
985 clientMetricsW->iBorderWidth = clientMetricsA.iBorderWidth;
986 clientMetricsW->iScrollWidth = clientMetricsA.iScrollWidth;
987 clientMetricsW->iScrollHeight = clientMetricsA.iScrollHeight;
988 clientMetricsW->iCaptionWidth = clientMetricsA.iCaptionWidth;
989 clientMetricsW->iCaptionHeight = clientMetricsA.iCaptionHeight;
990 ConvertFontAW(&clientMetricsA.lfCaptionFont, &clientMetricsW->lfCaptionFont);
991
992 clientMetricsW->iSmCaptionWidth = clientMetricsA.iSmCaptionWidth;
993 clientMetricsW->iSmCaptionHeight = clientMetricsA.iSmCaptionHeight;
994 ConvertFontAW(&clientMetricsA.lfSmCaptionFont, &clientMetricsW->lfSmCaptionFont);
995
996 clientMetricsW->iMenuWidth = clientMetricsA.iMenuWidth;
997 clientMetricsW->iMenuHeight = clientMetricsA.iMenuHeight;
998 ConvertFontAW(&clientMetricsA.lfMenuFont, &clientMetricsW->lfMenuFont);
999 ConvertFontAW(&clientMetricsA.lfStatusFont, &clientMetricsW->lfStatusFont);
1000 ConvertFontAW(&clientMetricsA.lfMessageFont, &clientMetricsW->lfMessageFont);
1001 break;
1002 }
1003#ifdef DEBUG
1004 WriteLog("USER32: SystemParametersInfoW %d, returned %d\n", uiAction, rc);
1005#endif
1006 return(rc);
1007}
1008
1009/* Process and Thread Functions */
1010
1011//******************************************************************************
1012//DWORD idAttach; /* thread to attach */
1013//DWORD idAttachTo; /* thread to attach to */
1014//BOOL fAttach; /* attach or detach */
1015//******************************************************************************
1016BOOL WIN32API AttachThreadInput(DWORD idAttach, DWORD idAttachTo, BOOL fAttach)
1017{
1018#ifdef DEBUG
1019 WriteLog("USER32: AttachThreadInput, not implemented\n");
1020#endif
1021 return(TRUE);
1022}
1023//******************************************************************************
1024//TODO:How can we emulate this one in OS/2???
1025//******************************************************************************
1026DWORD WIN32API WaitForInputIdle(HANDLE hProcess, DWORD dwTimeOut)
1027{
1028#ifdef DEBUG
1029 WriteLog("USER32: WaitForInputIdle (Not Implemented) %d\n", dwTimeOut);
1030#endif
1031
1032 if(dwTimeOut == INFINITE) return(0);
1033
1034// DosSleep(dwTimeOut/16);
1035 return(0);
1036}
1037
1038/* Help Functions */
1039
1040BOOL WIN32API WinHelpA( HWND hwnd, LPCSTR lpszHelp, UINT uCommand, DWORD dwData)
1041{
1042#ifdef DEBUG
1043 WriteLog("USER32: WinHelp not implemented %s\n", lpszHelp);
1044#endif
1045// hwnd = Win32Window::Win32ToOS2Handle(hwnd);
1046// return O32_WinHelp(arg1, arg2, arg3, arg4);
1047
1048 return(TRUE);
1049}
1050//******************************************************************************
1051//******************************************************************************
1052BOOL WIN32API WinHelpW( HWND arg1, LPCWSTR arg2, UINT arg3, DWORD arg4)
1053{
1054 char *astring = UnicodeToAsciiString((LPWSTR)arg2);
1055 BOOL rc;
1056
1057#ifdef DEBUG
1058 WriteLog("USER32: WinHelpW\n");
1059#endif
1060 rc = WinHelpA(arg1, astring, arg3, arg4);
1061 FreeAsciiString(astring);
1062 return rc;
1063}
1064
1065/* Keyboard and Input Functions */
1066
1067BOOL WIN32API ActivateKeyboardLayout(HKL hkl, UINT fuFlags)
1068{
1069#ifdef DEBUG
1070 WriteLog("USER32: ActivateKeyboardLayout, not implemented\n");
1071#endif
1072 return(TRUE);
1073}
1074//******************************************************************************
1075//SvL: 24-6-'97 - Added
1076//TODO: Not implemented
1077//******************************************************************************
1078WORD WIN32API GetAsyncKeyState(INT nVirtKey)
1079{
1080 dprintf2(("USER32: GetAsyncKeyState Not implemented\n"));
1081 return 0;
1082}
1083/*****************************************************************************
1084 * Name : UINT WIN32API GetKBCodePage
1085 * Purpose : The GetKBCodePage function is provided for compatibility with
1086 * earlier versions of Windows. In the Win32 application programming
1087 * interface (API) it just calls the GetOEMCP function.
1088 * Parameters:
1089 * Variables :
1090 * Result : If the function succeeds, the return value is an OEM code-page
1091 * identifier, or it is the default identifier if the registry
1092 * value is not readable. For a list of OEM code-page identifiers,
1093 * see GetOEMCP.
1094 * Remark :
1095 * Status : UNTESTED
1096 *
1097 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1098 *****************************************************************************/
1099
1100UINT WIN32API GetKBCodePage(VOID)
1101{
1102 return (GetOEMCP());
1103}
1104//******************************************************************************
1105//******************************************************************************
1106int WIN32API GetKeyNameTextA( LPARAM lParam, LPSTR lpString, int nSize)
1107{
1108#ifdef DEBUG
1109 WriteLog("USER32: GetKeyNameTextA\n");
1110#endif
1111 return O32_GetKeyNameText(lParam,lpString,nSize);
1112}
1113//******************************************************************************
1114//******************************************************************************
1115int WIN32API GetKeyNameTextW( LPARAM lParam, LPWSTR lpString, int nSize)
1116{
1117#ifdef DEBUG
1118 WriteLog("USER32: GetKeyNameTextW DOES NOT WORK\n");
1119#endif
1120 // NOTE: This will not work as is (needs UNICODE support)
1121 return 0;
1122// return O32_GetKeyNameText(arg1, arg2, arg3);
1123}
1124//******************************************************************************
1125//SvL: 24-6-'97 - Added
1126//******************************************************************************
1127SHORT WIN32API GetKeyState( int nVirtKey)
1128{
1129//SvL: Hehe. 32 MB logfile for Opera after a minute.
1130 dprintf2(("USER32: GetKeyState %d\n", nVirtKey));
1131 return O32_GetKeyState(nVirtKey);
1132}
1133/*****************************************************************************
1134 * Name : VOID WIN32API keybd_event
1135 * Purpose : The keybd_event function synthesizes a keystroke. The system
1136 * can use such a synthesized keystroke to generate a WM_KEYUP or
1137 * WM_KEYDOWN message. The keyboard driver's interrupt handler calls
1138 * the keybd_event function.
1139 * Parameters: BYTE bVk virtual-key code
1140
1141 * BYTE bScan hardware scan code
1142 * DWORD dwFlags flags specifying various function options
1143 * DWORD dwExtraInfo additional data associated with keystroke
1144 * Variables :
1145 * Result :
1146 * Remark :
1147 * Status : UNTESTED STUB
1148 *
1149 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1150 *****************************************************************************/
1151VOID WIN32API keybd_event (BYTE bVk,
1152 BYTE bScan,
1153 DWORD dwFlags,
1154 DWORD dwExtraInfo)
1155{
1156 dprintf(("USER32:keybd_event (%u,%u,%08xh,%08x) not implemented.\n",
1157 bVk,
1158 bScan,
1159 dwFlags,
1160 dwExtraInfo));
1161}
1162/*****************************************************************************
1163 * Name : HLK WIN32API LoadKeyboardLayoutA
1164 * Purpose : The LoadKeyboardLayout function loads a new keyboard layout into
1165 * the system. Several keyboard layouts can be loaded at a time, but
1166 * only one per process is active at a time. Loading multiple keyboard
1167 * layouts makes it possible to rapidly switch between layouts.
1168 * Parameters:
1169 * Variables :
1170 * Result : If the function succeeds, the return value is the handle of the
1171 * keyboard layout.
1172 * If the function fails, the return value is NULL. To get extended
1173 * error information, call GetLastError.
1174 * Remark :
1175 * Status : UNTESTED STUB
1176 *
1177 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1178 *****************************************************************************/
1179HKL WIN32API LoadKeyboardLayoutA(LPCTSTR pwszKLID,
1180 UINT Flags)
1181{
1182 dprintf(("USER32:LeadKeyboardLayoutA (%s,%u) not implemented.\n",
1183 pwszKLID,
1184 Flags));
1185
1186 return (NULL);
1187}
1188/*****************************************************************************
1189 * Name : HLK WIN32API LoadKeyboardLayoutW
1190 * Purpose : The LoadKeyboardLayout function loads a new keyboard layout into
1191 * the system. Several keyboard layouts can be loaded at a time, but
1192 * only one per process is active at a time. Loading multiple keyboard
1193 * layouts makes it possible to rapidly switch between layouts.
1194 * Parameters:
1195 * Variables :
1196 * Result : If the function succeeds, the return value is the handle of the
1197 * keyboard layout.
1198 * If the function fails, the return value is NULL. To get extended
1199 * error information, call GetLastError.
1200 * Remark :
1201 * Status : UNTESTED STUB
1202 *
1203 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1204 *****************************************************************************/
1205HKL WIN32API LoadKeyboardLayoutW(LPCWSTR pwszKLID,
1206 UINT Flags)
1207{
1208 dprintf(("USER32:LeadKeyboardLayoutW (%s,%u) not implemented.\n",
1209 pwszKLID,
1210 Flags));
1211
1212 return (NULL);
1213}
1214//******************************************************************************
1215//******************************************************************************
1216UINT WIN32API MapVirtualKeyA( UINT uCode, UINT uMapType)
1217{
1218#ifdef DEBUG
1219 WriteLog("USER32: MapVirtualKeyA\n");
1220#endif
1221 return O32_MapVirtualKey(uCode,uMapType);
1222}
1223//******************************************************************************
1224//******************************************************************************
1225UINT WIN32API MapVirtualKeyW( UINT uCode, UINT uMapType)
1226{
1227#ifdef DEBUG
1228 WriteLog("USER32: MapVirtualKeyW\n");
1229#endif
1230 // NOTE: This will not work as is (needs UNICODE support)
1231 return O32_MapVirtualKey(uCode,uMapType);
1232}
1233/*****************************************************************************
1234 * Name : UINT WIN32API MapVirtualKeyExA
1235 * Purpose : The MapVirtualKeyEx function translates (maps) a virtual-key
1236 * code into a scan code or character value, or translates a scan
1237 * code into a virtual-key code. The function translates the codes
1238 * using the input language and physical keyboard layout identified
1239 * by the given keyboard layout handle.
1240 * Parameters:
1241 * Variables :
1242 * Result : The return value is either a scan code, a virtual-key code, or
1243 * a character value, depending on the value of uCode and uMapType.
1244 * If there is no translation, the return value is zero.
1245 * Remark :
1246 * Status : UNTESTED STUB
1247 *
1248 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1249 *****************************************************************************/
1250UINT WIN32API MapVirtualKeyExA(UINT uCode,
1251 UINT uMapType,
1252 HKL dwhkl)
1253{
1254 dprintf(("USER32:MapVirtualKeyExA (%u,%u,%08x) not implemented.\n",
1255 uCode,
1256 uMapType,
1257 dwhkl));
1258
1259 return (0);
1260}
1261/*****************************************************************************
1262 * Name : UINT WIN32API MapVirtualKeyExW
1263 * Purpose : The MapVirtualKeyEx function translates (maps) a virtual-key
1264 * code into a scan code or character value, or translates a scan
1265 * code into a virtual-key code. The function translates the codes
1266 * using the input language and physical keyboard layout identified
1267 * by the given keyboard layout handle.
1268 * Parameters:
1269 * Variables :
1270 * Result : The return value is either a scan code, a virtual-key code, or
1271 * a character value, depending on the value of uCode and uMapType.
1272 * If there is no translation, the return value is zero.
1273 * Remark :
1274 * Status : UNTESTED STUB
1275
1276 *
1277 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1278 *****************************************************************************/
1279UINT WIN32API MapVirtualKeyExW(UINT uCode,
1280 UINT uMapType,
1281 HKL dwhkl)
1282{
1283 dprintf(("USER32:MapVirtualKeyExW (%u,%u,%08x) not implemented.\n",
1284 uCode,
1285 uMapType,
1286 dwhkl));
1287
1288 return (0);
1289}
1290/*****************************************************************************
1291 * Name : DWORD WIN32API OemKeyScan
1292 * Purpose : The OemKeyScan function maps OEM ASCII codes 0 through 0x0FF
1293 * into the OEM scan codes and shift states. The function provides
1294 * information that allows a program to send OEM text to another
1295 * program by simulating keyboard input.
1296 * Parameters:
1297 * Variables :
1298 * Result :
1299 * Remark :
1300 * Status : UNTESTED STUB
1301 *
1302 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1303 *****************************************************************************/
1304DWORD WIN32API OemKeyScan(WORD wOemChar)
1305{
1306 dprintf(("USER32:OemKeyScan (%u) not implemented.\n",
1307 wOemChar));
1308
1309 return (wOemChar);
1310}
1311//******************************************************************************
1312//******************************************************************************
1313BOOL WIN32API RegisterHotKey(HWND hwnd, int idHotKey, UINT fuModifiers, UINT uVirtKey)
1314{
1315#ifdef DEBUG
1316 WriteLog("USER32: RegisterHotKey, not implemented\n");
1317#endif
1318 hwnd = Win32Window::Win32ToOS2Handle(hwnd);
1319 return(TRUE);
1320}
1321/*****************************************************************************
1322 * Name : int WIN32API ToAscii
1323 * Purpose : The ToAscii function translates the specified virtual-key code
1324 * and keyboard state to the corresponding Windows character or characters.
1325 * Parameters: UINT uVirtKey virtual-key code
1326 * UINT uScanCode scan code
1327 * PBYTE lpbKeyState address of key-state array
1328 * LPWORD lpwTransKey buffer for translated key
1329 * UINT fuState active-menu flag
1330 * Variables :
1331 * Result : 0 The specified virtual key has no translation for the current
1332 * state of the keyboard.
1333 * 1 One Windows character was copied to the buffer.
1334 * 2 Two characters were copied to the buffer. This usually happens
1335 * when a dead-key character (accent or diacritic) stored in the
1336 * keyboard layout cannot be composed with the specified virtual
1337 * key to form a single character.
1338 * Remark :
1339 * Status : UNTESTED STUB
1340 *
1341 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1342 *****************************************************************************/
1343int WIN32API ToAscii(UINT uVirtKey,
1344 UINT uScanCode,
1345 PBYTE lpbKeyState,
1346 LPWORD lpwTransKey,
1347 UINT fuState)
1348{
1349 dprintf(("USER32:ToAscii (%u,%u,%08xh,%08xh,%u) not implemented.\n",
1350 uVirtKey,
1351 uScanCode,
1352 lpbKeyState,
1353 lpwTransKey,
1354 fuState));
1355
1356 return (0);
1357}
1358/*****************************************************************************
1359 * Name : int WIN32API ToAsciiEx
1360 * Purpose : The ToAscii function translates the specified virtual-key code
1361 * and keyboard state to the corresponding Windows character or characters.
1362 * Parameters: UINT uVirtKey virtual-key code
1363 * UINT uScanCode scan code
1364 * PBYTE lpbKeyState address of key-state array
1365 * LPWORD lpwTransKey buffer for translated key
1366 * UINT fuState active-menu flag
1367 * HLK hlk keyboard layout handle
1368 * Variables :
1369 * Result : 0 The specified virtual key has no translation for the current
1370 * state of the keyboard.
1371 * 1 One Windows character was copied to the buffer.
1372 * 2 Two characters were copied to the buffer. This usually happens
1373 * when a dead-key character (accent or diacritic) stored in the
1374 * keyboard layout cannot be composed with the specified virtual
1375 * key to form a single character.
1376 * Remark :
1377 * Status : UNTESTED STUB
1378 *
1379 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1380 *****************************************************************************/
1381int WIN32API ToAsciiEx(UINT uVirtKey,
1382 UINT uScanCode,
1383 PBYTE lpbKeyState,
1384 LPWORD lpwTransKey,
1385 UINT fuState,
1386 HKL hkl)
1387{
1388 dprintf(("USER32:ToAsciiEx (%u,%u,%08xh,%08xh,%u,%08x) not implemented.\n",
1389 uVirtKey,
1390 uScanCode,
1391 lpbKeyState,
1392 lpwTransKey,
1393 fuState,
1394 hkl));
1395
1396 return (0);
1397}
1398/*****************************************************************************
1399 * Name : int WIN32API ToUnicode
1400 * Purpose : The ToUnicode function translates the specified virtual-key code
1401 * and keyboard state to the corresponding Unicode character or characters.
1402 * Parameters: UINT wVirtKey virtual-key code
1403 * UINT wScanCode scan code
1404 * PBYTE lpKeyState address of key-state array
1405 * LPWSTR pwszBuff buffer for translated key
1406 * int cchBuff size of translated key buffer
1407 * UINT wFlags set of function-conditioning flags
1408 * Variables :
1409 * Result : - 1 The specified virtual key is a dead-key character (accent or
1410 * diacritic). This value is returned regardless of the keyboard
1411 * layout, even if several characters have been typed and are
1412 * stored in the keyboard state. If possible, even with Unicode
1413 * keyboard layouts, the function has written a spacing version of
1414 * the dead-key character to the buffer specified by pwszBuffer.
1415 * For example, the function writes the character SPACING ACUTE
1416 * (0x00B4), rather than the character NON_SPACING ACUTE (0x0301).
1417 * 0 The specified virtual key has no translation for the current
1418 * state of the keyboard. Nothing was written to the buffer
1419 * specified by pwszBuffer.
1420 * 1 One character was written to the buffer specified by pwszBuffer.
1421 * 2 or more Two or more characters were written to the buffer specified by
1422 * pwszBuff. The most common cause for this is that a dead-key
1423 * character (accent or diacritic) stored in the keyboard layout
1424 * could not be combined with the specified virtual key to form a
1425 * single character.
1426 * Remark :
1427 * Status : UNTESTED STUB
1428 *
1429 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1430 *****************************************************************************/
1431int WIN32API ToUnicode(UINT uVirtKey,
1432 UINT uScanCode,
1433 PBYTE lpKeyState,
1434 LPWSTR pwszBuff,
1435 int cchBuff,
1436 UINT wFlags)
1437{
1438 dprintf(("USER32:ToUnicode (%u,%u,%08xh,%08xh,%u,%08x) not implemented.\n",
1439 uVirtKey,
1440 uScanCode,
1441 lpKeyState,
1442 pwszBuff,
1443 cchBuff,
1444 wFlags));
1445
1446 return (0);
1447}
1448/*****************************************************************************
1449 * Name : BOOL WIN32API UnloadKeyboardLayout
1450 * Purpose : The UnloadKeyboardLayout function removes a keyboard layout.
1451 * Parameters: HKL hkl handle of keyboard layout
1452 * Variables :
1453 * Result : If the function succeeds, the return value is the handle of the
1454 * keyboard layout; otherwise, it is NULL. To get extended error
1455 * information, use the GetLastError function.
1456 * Remark :
1457 * Status : UNTESTED STUB
1458 *
1459 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1460 *****************************************************************************/
1461BOOL WIN32API UnloadKeyboardLayout (HKL hkl)
1462{
1463 dprintf(("USER32:UnloadKeyboardLayout (%08x) not implemented.\n",
1464 hkl));
1465
1466 return (0);
1467}
1468//******************************************************************************
1469//******************************************************************************
1470BOOL WIN32API UnregisterHotKey(HWND hwnd, int idHotKey)
1471{
1472#ifdef DEBUG
1473 WriteLog("USER32: UnregisterHotKey, not implemented\n");
1474#endif
1475 hwnd = Win32Window::Win32ToOS2Handle(hwnd);
1476
1477 return(TRUE);
1478}
1479//******************************************************************************
1480//SvL: 24-6-'97 - Added
1481//******************************************************************************
1482WORD WIN32API VkKeyScanA( char ch)
1483{
1484#ifdef DEBUG
1485 WriteLog("USER32: VkKeyScanA\n");
1486#endif
1487 return O32_VkKeyScan(ch);
1488}
1489//******************************************************************************
1490//******************************************************************************
1491WORD WIN32API VkKeyScanW( WCHAR wch)
1492{
1493#ifdef DEBUG
1494 WriteLog("USER32: VkKeyScanW\n");
1495#endif
1496 // NOTE: This will not work as is (needs UNICODE support)
1497 return O32_VkKeyScan((char)wch);
1498}
1499/*****************************************************************************
1500 * Name : SHORT WIN32API VkKeyScanExW
1501 * Purpose : The VkKeyScanEx function translates a character to the
1502 * corresponding virtual-key code and shift state. The function
1503 * translates the character using the input language and physical
1504 * keyboard layout identified by the given keyboard layout handle.
1505 * Parameters: UINT uChar character to translate
1506 * HKL hkl keyboard layout handle
1507 * Variables :
1508 * Result : see docs
1509 * Remark :
1510 * Status : UNTESTED STUB
1511 *
1512 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1513 *****************************************************************************/
1514WORD WIN32API VkKeyScanExW(WCHAR uChar,
1515 HKL hkl)
1516{
1517 dprintf(("USER32:VkKeyScanExW (%u,%08x) not implemented.\n",
1518 uChar,
1519 hkl));
1520
1521 return (uChar);
1522}
1523/*****************************************************************************
1524 * Name : SHORT WIN32API VkKeyScanExA
1525 * Purpose : The VkKeyScanEx function translates a character to the
1526 * corresponding virtual-key code and shift state. The function
1527 * translates the character using the input language and physical
1528 * keyboard layout identified by the given keyboard layout handle.
1529 * Parameters: UINT uChar character to translate
1530 * HKL hkl keyboard layout handle
1531 * Variables :
1532 * Result : see docs
1533 * Remark :
1534 * Status : UNTESTED STUB
1535 *
1536 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1537 *****************************************************************************/
1538WORD WIN32API VkKeyScanExA(CHAR uChar,
1539 HKL hkl)
1540{
1541 dprintf(("USER32:VkKeyScanExA (%u,%08x) not implemented.\n",
1542 uChar,
1543 hkl));
1544
1545 return (uChar);
1546}
1547
1548/* Synchronization Functions */
1549ODINFUNCTION5(DWORD,MsgWaitForMultipleObjects,DWORD, nCount,
1550 LPHANDLE, pHandles,
1551 BOOL, fWaitAll,
1552 DWORD, dwMilliseconds,
1553 DWORD, dwWakeMask)
1554{
1555 // @@@PH that's a really difficult function to implement
1556
1557 // @@@PH this is a temporary bugfix for WINFILE.EXE
1558 if (nCount == 0)
1559 {
1560 // only listens to incoming thread messages.
1561 return (WAIT_OBJECT_0);
1562 }
1563
1564 return O32_MsgWaitForMultipleObjects(nCount,pHandles,fWaitAll,dwMilliseconds,dwWakeMask);
1565}
1566
1567/* Button Functions */
1568
1569BOOL WIN32API CheckRadioButton( HWND hDlg, UINT nIDFirstButton, UINT nIDLastButton, UINT nIDCheckButton)
1570{
1571#ifdef DEBUG
1572 WriteLog("USER32: CheckRadioButton\n");
1573#endif
1574 //CB: check radio buttons in interval
1575 if (nIDFirstButton > nIDLastButton)
1576 {
1577 SetLastError(ERROR_INVALID_PARAMETER);
1578 return (FALSE);
1579 }
1580
1581 for (UINT x = nIDFirstButton;x <= nIDLastButton;x++)
1582 {
1583 SendDlgItemMessageA(hDlg,x,BM_SETCHECK,(x == nIDCheckButton) ? BST_CHECKED : BST_UNCHECKED,0);
1584 }
1585
1586 return (TRUE);
1587}
1588
1589/* Window Functions */
1590
1591/*****************************************************************************
1592 * Name : BOOL WIN32API AnyPopup
1593 * Purpose : The AnyPopup function indicates whether an owned, visible,
1594 * top-level pop-up, or overlapped window exists on the screen. The
1595 * function searches the entire Windows screen, not just the calling
1596 * application's client area.
1597 * Parameters: VOID
1598 * Variables :
1599 * Result : If a pop-up window exists, the return value is TRUE even if the
1600 * pop-up window is completely covered by other windows. Otherwise,
1601 * it is FALSE.
1602 * Remark : AnyPopup is a Windows version 1.x function and is retained for
1603 * compatibility purposes. It is generally not useful.
1604 * Status : UNTESTED STUB
1605 *
1606 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1607 *****************************************************************************/
1608BOOL WIN32API AnyPopup(VOID)
1609{
1610 dprintf(("USER32:AnyPopup() not implemented.\n"));
1611
1612 return (FALSE);
1613}
1614
1615//******************************************************************************
1616//******************************************************************************
1617/*****************************************************************************
1618 * Name : int WIN32API GetWindowRgn
1619 * Purpose : The GetWindowRgn function obtains a copy of the window region of a window.
1620 * Parameters: HWND hWnd handle to window whose window region is to be obtained
1621 * HRGN hRgn handle to region that receives a copy of the window region
1622 * Variables :
1623 * Result : NULLREGION, SIMPLEREGION, COMPLEXREGION, ERROR
1624 * Remark :
1625 * Status : UNTESTED STUB
1626 *
1627 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1628 *****************************************************************************/
1629
1630int WIN32API GetWindowRgn (HWND hWnd,
1631 HRGN hRgn)
1632{
1633 dprintf(("USER32:GetWindowRgn (%08xh,%08x) not implemented.\n",
1634 hWnd,
1635 hRgn));
1636 //Attention: Win32 hwnd handle!
1637
1638 return (NULLREGION);
1639}
1640//******************************************************************************
1641//TODO: Not complete
1642//******************************************************************************
1643BOOL WIN32API GrayStringA(HDC hdc, HBRUSH hBrush, GRAYSTRINGPROC lpOutputFunc,
1644 LPARAM lpData, int nCount, int X, int Y, int nWidth,
1645 int nHeight)
1646{
1647 BOOL rc;
1648 COLORREF curclr;
1649
1650#ifdef DEBUG
1651 WriteLog("USER32: GrayStringA, not completely implemented\n");
1652#endif
1653 if(lpOutputFunc == NULL && lpData == NULL) {
1654#ifdef DEBUG
1655 WriteLog("USER32: lpOutputFunc == NULL && lpData == NULL\n");
1656#endif
1657 return(FALSE);
1658 }
1659 if(lpOutputFunc) {
1660 return(lpOutputFunc(hdc, lpData, nCount));
1661 }
1662 curclr = SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
1663 rc = TextOutA(hdc, X, Y, (char *)lpData, nCount);
1664 SetTextColor(hdc, curclr);
1665
1666 return(rc);
1667}
1668//******************************************************************************
1669//******************************************************************************
1670BOOL WIN32API GrayStringW(HDC hdc, HBRUSH hBrush, GRAYSTRINGPROC lpOutputFunc,
1671 LPARAM lpData, int nCount, int X, int Y, int nWidth,
1672 int nHeight)
1673{
1674 BOOL rc;
1675 char *astring;
1676 COLORREF curclr;
1677
1678#ifdef DEBUG
1679 WriteLog("USER32: GrayStringW, not completely implemented\n");
1680#endif
1681
1682 if(lpOutputFunc == NULL && lpData == NULL) {
1683#ifdef DEBUG
1684 WriteLog("USER32: lpOutputFunc == NULL && lpData == NULL\n");
1685#endif
1686 return(FALSE);
1687 }
1688 if(nCount == 0)
1689 nCount = UniStrlen((UniChar*)lpData);
1690
1691 if(lpOutputFunc) {
1692 return(lpOutputFunc(hdc, lpData, nCount));
1693 }
1694 astring = UnicodeToAsciiString((LPWSTR)lpData);
1695
1696 curclr = SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
1697 rc = TextOutA(hdc, X, Y, astring, nCount);
1698 SetTextColor(hdc, curclr);
1699
1700 FreeAsciiString(astring);
1701 return(rc);
1702}
1703//******************************************************************************
1704//******************************************************************************
1705#if 0
1706BOOL WIN32API InvalidateRgn( HWND hWnd, HRGN hRgn, BOOL bErase)
1707{
1708#ifdef DEBUG
1709 WriteLog("USER32: InvalidateRgn\n");
1710#endif
1711 hWnd = Win32Window::Win32ToOS2Handle(hWnd);
1712
1713 return O32_InvalidateRgn(hWnd,hRgn,bErase);
1714}
1715#endif
1716/*****************************************************************************
1717 * Name : BOOL WIN32API PaintDesktop
1718 * Purpose : The PaintDesktop function fills the clipping region in the
1719 * specified device context with the desktop pattern or wallpaper.
1720 * The function is provided primarily for shell desktops.
1721 * Parameters:
1722 * Variables :
1723 * Result : If the function succeeds, the return value is TRUE.
1724 * If the function fails, the return value is FALSE.
1725 * Remark :
1726 * Status : UNTESTED STUB
1727 *
1728 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1729 *****************************************************************************/
1730BOOL WIN32API PaintDesktop(HDC hdc)
1731{
1732 dprintf(("USER32:PaintDesktop (%08x) not implemented.\n",
1733 hdc));
1734
1735 return (FALSE);
1736}
1737/*****************************************************************************
1738 * Name : int WIN32API SetWindowRgn
1739 * Purpose : The SetWindowRgn function sets the window region of a window. The
1740 * window region determines the area within the window where the
1741 * operating system permits drawing. The operating system does not
1742 * display any portion of a window that lies outside of the window region
1743 * Parameters: HWND hWnd handle to window whose window region is to be set
1744 * HRGN hRgn handle to region
1745 * BOOL bRedraw window redraw flag
1746 * Variables :
1747 * Result : If the function succeeds, the return value is non-zero.
1748 * If the function fails, the return value is zero.
1749 * Remark :
1750 * Status : UNTESTED STUB
1751 *
1752 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1753 *****************************************************************************/
1754
1755int WIN32API SetWindowRgn(HWND hWnd,
1756 HRGN hRgn,
1757 BOOL bRedraw)
1758{
1759 dprintf(("USER32:SetWindowRgn (%08xh,%08xh,%u) not implemented.\n",
1760 hWnd,
1761 hRgn,
1762 bRedraw));
1763 //Attention: Win32 hwnd handle!
1764
1765 return (0);
1766}
1767//******************************************************************************
1768//******************************************************************************
1769BOOL WIN32API ValidateRect( HWND hwnd, const RECT * lprc)
1770{
1771#ifdef DEBUG
1772 WriteLog("USER32: ValidateRect\n");
1773#endif
1774 hwnd = Win32Window::Win32ToOS2Handle(hwnd);
1775
1776 return O32_ValidateRect(hwnd,lprc);
1777}
1778//******************************************************************************
1779//******************************************************************************
1780BOOL WIN32API ValidateRgn( HWND hwnd, HRGN hrgn)
1781{
1782#ifdef DEBUG
1783 WriteLog("USER32: ValidateRgn\n");
1784#endif
1785 hwnd = Win32Window::Win32ToOS2Handle(hwnd);
1786
1787 return O32_ValidateRgn(hwnd,hrgn);
1788}
1789
1790/* Filled Shape Functions */
1791
1792
1793int WIN32API FillRect(HDC hDC, const RECT * lprc, HBRUSH hbr)
1794{
1795#ifdef DEBUG
1796 WriteLog("USER32: FillRect (%d,%d)(%d,%d) brush %X\n", lprc->left, lprc->top, lprc->right, lprc->bottom, hbr);
1797#endif
1798 return O32_FillRect(hDC,lprc,hbr);
1799}
1800//******************************************************************************
1801//******************************************************************************
1802int WIN32API FrameRect( HDC hDC, const RECT * lprc, HBRUSH hbr)
1803{
1804#ifdef DEBUG
1805 WriteLog("USER32: FrameRect\n");
1806#endif
1807 return O32_FrameRect(hDC,lprc,hbr);
1808}
1809//******************************************************************************
1810//******************************************************************************
1811BOOL WIN32API InvertRect( HDC hDC, const RECT * lprc)
1812{
1813#ifdef DEBUG
1814 WriteLog("USER32: InvertRect\n");
1815#endif
1816 return O32_InvertRect(hDC,lprc);
1817}
1818
1819/* System Information Functions */
1820
1821int WIN32API GetKeyboardType( int nTypeFlag)
1822{
1823#ifdef DEBUG
1824 WriteLog("USER32: GetKeyboardType\n");
1825#endif
1826 return O32_GetKeyboardType(nTypeFlag);
1827}
1828/*****************************************************************************
1829 * Name : HDESK WIN32API GetThreadDesktop
1830 * Purpose : The GetThreadDesktop function returns a handle to the desktop
1831 * associated with a specified thread.
1832 * Parameters: DWORD dwThreadId thread identifier
1833 * Variables :
1834 * Result : If the function succeeds, the return value is the handle of the
1835 * desktop associated with the specified thread.
1836 * Remark :
1837 * Status : UNTESTED STUB
1838 *
1839 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1840 *****************************************************************************/
1841HDESK WIN32API GetThreadDesktop(DWORD dwThreadId)
1842{
1843 dprintf(("USER32:GetThreadDesktop (%u) not implemented.\n",
1844 dwThreadId));
1845
1846 return (NULL);
1847}
1848
1849/* Message and Message Queue Functions */
1850
1851/*****************************************************************************
1852 * Name : BOOL WIN32API GetInputState
1853 * Purpose : The GetInputState function determines whether there are
1854 * mouse-button or keyboard messages in the calling thread's message queue.
1855 * Parameters:
1856 * Variables :
1857 * Result : If the queue contains one or more new mouse-button or keyboard
1858 * messages, the return value is TRUE.
1859 * If the function fails, the return value is FALSE.
1860 * Remark :
1861 * Status : UNTESTED STUB
1862 *
1863 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1864 *****************************************************************************/
1865BOOL WIN32API GetInputState(VOID)
1866{
1867 dprintf(("USER32:GetInputState () not implemented.\n"));
1868
1869 return (FALSE);
1870}
1871//******************************************************************************
1872//******************************************************************************
1873DWORD WIN32API GetQueueStatus( UINT flags)
1874{
1875#ifdef DEBUG
1876 WriteLog("USER32: GetQueueStatus\n");
1877#endif
1878 return O32_GetQueueStatus(flags);
1879}
1880
1881/* Font and Text Functions */
1882
1883DWORD WIN32API GetTabbedTextExtentA( HDC hDC, LPCSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions)
1884{
1885 dprintf2(("USER32: GetTabbedTextExtentA %x %s", hDC, lpString));
1886 return O32_GetTabbedTextExtent(hDC,lpString,nCount,nTabPositions,lpnTabStopPositions);
1887}
1888//******************************************************************************
1889//******************************************************************************
1890DWORD WIN32API GetTabbedTextExtentW( HDC hDC, LPCWSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions)
1891{
1892 char *astring = UnicodeToAsciiString((LPWSTR)lpString);
1893 DWORD rc;
1894
1895 dprintf2(("USER32: GetTabbedTextExtentW %x %s", hDC, astring));
1896 rc = O32_GetTabbedTextExtent(hDC,astring,nCount,nTabPositions,lpnTabStopPositions);
1897 FreeAsciiString(astring);
1898 return rc;
1899}
1900//******************************************************************************
1901//******************************************************************************
1902LONG WIN32API TabbedTextOutA( HDC hdc, int x, int y, LPCSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin)
1903{
1904#ifdef DEBUG
1905 WriteLog("USER32: TabbedTextOutA\n");
1906#endif
1907 return O32_TabbedTextOut(hdc,x,y,lpString,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin);
1908}
1909//******************************************************************************
1910//******************************************************************************
1911LONG WIN32API TabbedTextOutW( HDC hdc, int x, int y, LPCWSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin)
1912{
1913 char *astring = UnicodeToAsciiString((LPWSTR)lpString);
1914 LONG rc;
1915
1916#ifdef DEBUG
1917 WriteLog("USER32: TabbedTextOutW\n");
1918#endif
1919 rc = O32_TabbedTextOut(hdc,x,y,astring,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin);
1920 FreeAsciiString(astring);
1921 return rc;
1922}
1923
1924/* Device Context Functions */
1925
1926
1927/* Window Station and Desktop Functions */
1928
1929/*****************************************************************************
1930 * Name : BOOL WIN32API CloseDesktop
1931 * Purpose : The CloseDesktop function closes an open handle of a desktop
1932 * object. A desktop is a secure object contained within a window
1933 * station object. A desktop has a logical display surface and
1934 * contains windows, menus and hooks.
1935 * Parameters: HDESK hDesktop
1936 * Variables :
1937 * Result : If the function succeeds, the return value is TRUE.
1938 * If the functions fails, the return value is FALSE. To get
1939 * extended error information, call GetLastError.
1940 * Remark :
1941 * Status : UNTESTED STUB
1942 *
1943 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1944 *****************************************************************************/
1945BOOL WIN32API CloseDesktop(HDESK hDesktop)
1946{
1947 dprintf(("USER32:CloseDesktop(%08x) not implemented.\n",
1948 hDesktop));
1949
1950 return (FALSE);
1951}
1952/*****************************************************************************
1953 * Name : BOOL WIN32API CloseWindowStation
1954 * Purpose : The CloseWindowStation function closes an open window station handle.
1955 * Parameters: HWINSTA hWinSta
1956 * Variables :
1957 * Result :
1958 * Remark : If the function succeeds, the return value is TRUE.
1959 * If the functions fails, the return value is FALSE. To get
1960 * extended error information, call GetLastError.
1961 * Status : UNTESTED STUB
1962 *
1963 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1964 *****************************************************************************/
1965BOOL WIN32API CloseWindowStation(HWINSTA hWinSta)
1966{
1967 dprintf(("USER32:CloseWindowStation(%08x) not implemented.\n",
1968 hWinSta));
1969
1970 return (FALSE);
1971}
1972/*****************************************************************************
1973 * Name : HDESK WIN32API CreateDesktopA
1974 * Purpose : The CreateDesktop function creates a new desktop on the window
1975 * station associated with the calling process.
1976 * Parameters: LPCTSTR lpszDesktop name of the new desktop
1977 * LPCTSTR lpszDevice name of display device to assign to the desktop
1978 * LPDEVMODE pDevMode reserved; must be NULL
1979 * DWORD dwFlags flags to control interaction with other applications
1980 * DWORD dwDesiredAccess specifies access of returned handle
1981 * LPSECURITY_ATTRIBUTES lpsa specifies security attributes of the desktop
1982 * Variables :
1983 * Result : If the function succeeds, the return value is a handle of the
1984 * newly created desktop.
1985 * If the function fails, the return value is NULL. To get extended
1986 * error information, call GetLastError.
1987 * Remark :
1988 * Status : UNTESTED STUB
1989 *
1990 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1991 *****************************************************************************/
1992HDESK WIN32API CreateDesktopA(LPCTSTR lpszDesktop,
1993 LPCTSTR lpszDevice,
1994 LPDEVMODEA pDevMode,
1995 DWORD dwFlags,
1996 DWORD dwDesiredAccess,
1997 LPSECURITY_ATTRIBUTES lpsa)
1998{
1999 dprintf(("USER32:CreateDesktopA(%s,%s,%08xh,%08xh,%08xh,%08x) not implemented.\n",
2000 lpszDesktop,
2001 lpszDevice,
2002 pDevMode,
2003 dwFlags,
2004 dwDesiredAccess,
2005 lpsa));
2006
2007 return (NULL);
2008}
2009/*****************************************************************************
2010 * Name : HDESK WIN32API CreateDesktopW
2011 * Purpose : The CreateDesktop function creates a new desktop on the window
2012 * station associated with the calling process.
2013 * Parameters: LPCTSTR lpszDesktop name of the new desktop
2014 * LPCTSTR lpszDevice name of display device to assign to the desktop
2015 * LPDEVMODE pDevMode reserved; must be NULL
2016 * DWORD dwFlags flags to control interaction with other applications
2017 * DWORD dwDesiredAccess specifies access of returned handle
2018 * LPSECURITY_ATTRIBUTES lpsa specifies security attributes of the desktop
2019 * Variables :
2020 * Result : If the function succeeds, the return value is a handle of the
2021 * newly created desktop.
2022 * If the function fails, the return value is NULL. To get extended
2023 * error information, call GetLastError.
2024 * Remark :
2025 * Status : UNTESTED STUB
2026 *
2027 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2028 *****************************************************************************/
2029HDESK WIN32API CreateDesktopW(LPCTSTR lpszDesktop,
2030 LPCTSTR lpszDevice,
2031 LPDEVMODEW pDevMode,
2032 DWORD dwFlags,
2033 DWORD dwDesiredAccess,
2034 LPSECURITY_ATTRIBUTES lpsa)
2035{
2036 dprintf(("USER32:CreateDesktopW(%s,%s,%08xh,%08xh,%08xh,%08x) not implemented.\n",
2037 lpszDesktop,
2038 lpszDevice,
2039 pDevMode,
2040 dwFlags,
2041 dwDesiredAccess,
2042 lpsa));
2043
2044 return (NULL);
2045}
2046/*****************************************************************************
2047 * Name : HWINSTA WIN32API CreateWindowStationA
2048 * Purpose : The CreateWindowStation function creates a window station object.
2049 * It returns a handle that can be used to access the window station.
2050 * A window station is a secure object that contains a set of global
2051 * atoms, a clipboard, and a set of desktop objects.
2052 * Parameters: LPTSTR lpwinsta name of the new window station
2053 * DWORD dwReserved reserved; must be NULL
2054 * DWORD dwDesiredAccess specifies access of returned handle
2055 * LPSECURITY_ATTRIBUTES lpsa specifies security attributes of the window station
2056 * Variables :
2057 * Result : If the function succeeds, the return value is the handle to the
2058 * newly created window station.
2059 * If the function fails, the return value is NULL. To get extended
2060 * error information, call GetLastError.
2061 * Remark :
2062 * Status : UNTESTED STUB
2063 *
2064 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2065 *****************************************************************************/
2066HWINSTA WIN32API CreateWindowStationA(LPTSTR lpWinSta,
2067 DWORD dwReserved,
2068 DWORD dwDesiredAccess,
2069 LPSECURITY_ATTRIBUTES lpsa)
2070{
2071 dprintf(("USER32:CreateWindowStationA(%s,%08xh,%08xh,%08x) not implemented.\n",
2072 lpWinSta,
2073 dwReserved,
2074 dwDesiredAccess,
2075 lpsa));
2076
2077 return (NULL);
2078}
2079/*****************************************************************************
2080 * Name : HWINSTA WIN32API CreateWindowStationW
2081 * Purpose : The CreateWindowStation function creates a window station object.
2082 * It returns a handle that can be used to access the window station.
2083 * A window station is a secure object that contains a set of global
2084 * atoms, a clipboard, and a set of desktop objects.
2085 * Parameters: LPTSTR lpwinsta name of the new window station
2086 * DWORD dwReserved reserved; must be NULL
2087 * DWORD dwDesiredAccess specifies access of returned handle
2088 * LPSECURITY_ATTRIBUTES lpsa specifies security attributes of the window station
2089 * Variables :
2090 * Result : If the function succeeds, the return value is the handle to the
2091 * newly created window station.
2092 * If the function fails, the return value is NULL. To get extended
2093 * error information, call GetLastError.
2094 * Remark :
2095 * Status : UNTESTED STUB
2096 *
2097 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2098 *****************************************************************************/
2099HWINSTA WIN32API CreateWindowStationW(LPWSTR lpWinSta,
2100 DWORD dwReserved,
2101 DWORD dwDesiredAccess,
2102 LPSECURITY_ATTRIBUTES lpsa)
2103{
2104 dprintf(("USER32:CreateWindowStationW(%s,%08xh,%08xh,%08x) not implemented.\n",
2105 lpWinSta,
2106 dwReserved,
2107 dwDesiredAccess,
2108 lpsa));
2109
2110 return (NULL);
2111}
2112/*****************************************************************************
2113 * Name : BOOL WIN32API EnumDesktopWindows
2114 * Purpose : The EnumDesktopWindows function enumerates all windows in a
2115 * desktop by passing the handle of each window, in turn, to an
2116 * application-defined callback function.
2117 * Parameters: HDESK hDesktop handle of desktop to enumerate
2118 * WNDENUMPROC lpfn points to application's callback function
2119 * LPARAM lParam 32-bit value to pass to the callback function
2120 * Variables :
2121 * Result : If the function succeeds, the return value is TRUE.
2122 * If the function fails, the return value is FALSE. To get
2123 * extended error information, call GetLastError.
2124 * Remark :
2125 * Status : UNTESTED STUB
2126 *
2127 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2128 *****************************************************************************/
2129BOOL WIN32API EnumDesktopWindows(HDESK hDesktop,
2130 WNDENUMPROC lpfn,
2131 LPARAM lParam)
2132{
2133 dprintf(("USER32:EnumDesktopWindows (%08xh,%08xh,%08x) not implemented.\n",
2134 hDesktop,
2135 lpfn,
2136 lParam));
2137
2138 return (FALSE);
2139}
2140/*****************************************************************************
2141 * Name : BOOL WIN32API EnumDesktopsA
2142 * Purpose : The EnumDesktops function enumerates all desktops in the window
2143 * station assigned to the calling process. The function does so by
2144 * passing the name of each desktop, in turn, to an application-
2145 * defined callback function.
2146 * Parameters: HWINSTA hwinsta handle of window station to enumerate
2147 * DESKTOPENUMPROC lpEnumFunc points to application's callback function
2148 * LPARAM lParam 32-bit value to pass to the callback function
2149 * Variables :
2150 * Result : If the function succeeds, the return value is TRUE.
2151 * If the function fails, the return value is FALSE. To get extended
2152 * error information, call GetLastError.
2153 * Remark :
2154 * Status : UNTESTED STUB
2155 *
2156 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2157 *****************************************************************************/
2158BOOL WIN32API EnumDesktopsA(HWINSTA hWinSta,
2159 DESKTOPENUMPROCA lpEnumFunc,
2160 LPARAM lParam)
2161{
2162 dprintf(("USER32:EnumDesktopsA (%08xh,%08xh,%08x) not implemented.\n",
2163 hWinSta,
2164 lpEnumFunc,
2165 lParam));
2166
2167 return (FALSE);
2168}
2169/*****************************************************************************
2170 * Name : BOOL WIN32API EnumDesktopsW
2171 * Purpose : The EnumDesktops function enumerates all desktops in the window
2172 * station assigned to the calling process. The function does so by
2173 * passing the name of each desktop, in turn, to an application-
2174 * defined callback function.
2175 * Parameters: HWINSTA hwinsta handle of window station to enumerate
2176 * DESKTOPENUMPROC lpEnumFunc points to application's callback function
2177 * LPARAM lParam 32-bit value to pass to the callback function
2178 * Variables :
2179 * Result : If the function succeeds, the return value is TRUE.
2180 * If the function fails, the return value is FALSE. To get extended
2181 * error information, call GetLastError.
2182 * Remark :
2183 * Status : UNTESTED STUB
2184 *
2185 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2186 *****************************************************************************/
2187BOOL WIN32API EnumDesktopsW(HWINSTA hWinSta,
2188 DESKTOPENUMPROCW lpEnumFunc,
2189 LPARAM lParam)
2190{
2191 dprintf(("USER32:EnumDesktopsW (%08xh,%08xh,%08x) not implemented.\n",
2192 hWinSta,
2193 lpEnumFunc,
2194 lParam));
2195
2196 return (FALSE);
2197}
2198/*****************************************************************************
2199 * Name : BOOL WIN32API EnumWindowStationsA
2200 * Purpose : The EnumWindowStations function enumerates all windowstations
2201 * in the system by passing the name of each window station, in
2202 * turn, to an application-defined callback function.
2203 * Parameters:
2204 * Variables : WINSTAENUMPROC lpEnumFunc points to application's callback function
2205 * LPARAM lParam 32-bit value to pass to the callback function
2206 * Result : If the function succeeds, the return value is TRUE.
2207 * If the function fails the return value is FALSE. To get extended
2208 * error information, call GetLastError.
2209 * Remark :
2210 * Status : UNTESTED STUB
2211 *
2212 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2213 *****************************************************************************/
2214BOOL WIN32API EnumWindowStationsA(WINSTAENUMPROCA lpEnumFunc,
2215 LPARAM lParam)
2216{
2217 dprintf(("USER32:EnumWindowStationsA (%08xh,%08x) not implemented.\n",
2218 lpEnumFunc,
2219 lParam));
2220
2221 return (FALSE);
2222}
2223/*****************************************************************************
2224 * Name : BOOL WIN32API EnumWindowStationsW
2225 * Purpose : The EnumWindowStations function enumerates all windowstations
2226 * in the system by passing the name of each window station, in
2227 * turn, to an application-defined callback function.
2228 * Parameters:
2229 * Variables : WINSTAENUMPROC lpEnumFunc points to application's callback function
2230 * LPARAM lParam 32-bit value to pass to the callback function
2231 * Result : If the function succeeds, the return value is TRUE.
2232 * If the function fails the return value is FALSE. To get extended
2233 * error information, call GetLastError.
2234 * Remark :
2235 * Status : UNTESTED STUB
2236 *
2237 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2238 *****************************************************************************/
2239BOOL WIN32API EnumWindowStationsW(WINSTAENUMPROCW lpEnumFunc,
2240 LPARAM lParam)
2241{
2242 dprintf(("USER32:EnumWindowStationsW (%08xh,%08x) not implemented.\n",
2243 lpEnumFunc,
2244 lParam));
2245
2246 return (FALSE);
2247}
2248/*****************************************************************************
2249 * Name : HWINSTA WIN32API GetProcessWindowStation
2250 * Purpose : The GetProcessWindowStation function returns a handle of the
2251 * window station associated with the calling process.
2252 * Parameters:
2253 * Variables :
2254 * Result : If the function succeeds, the return value is a handle of the
2255 * window station associated with the calling process.
2256 * If the function fails, the return value is NULL. This can occur
2257 * if the calling process is not an application written for Windows
2258 * NT. To get extended error information, call GetLastError.
2259 * Remark :
2260 * Status : UNTESTED STUB
2261 *
2262 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2263 *****************************************************************************/
2264HWINSTA WIN32API GetProcessWindowStation(VOID)
2265{
2266 dprintf(("USER32:GetProcessWindowStation () not implemented.\n"));
2267
2268 return (NULL);
2269}
2270/*****************************************************************************
2271 * Name : BOOL WIN32API GetUserObjectInformationA
2272 * Purpose : The GetUserObjectInformation function returns information about
2273 * a window station or desktop object.
2274 * Parameters: HANDLE hObj handle of object to get information for
2275 * int nIndex type of information to get
2276 * PVOID pvInfo points to buffer that receives the information
2277 * DWORD nLength size, in bytes, of pvInfo buffer
2278 * LPDWORD lpnLengthNeeded receives required size, in bytes, of pvInfo buffer
2279 * Variables :
2280 * Result : If the function succeeds, the return value is TRUE.
2281 * If the function fails, the return value is FALSE. To get extended
2282 * error information, call GetLastError.
2283 * Remark :
2284 * Status : UNTESTED STUB
2285 *
2286 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2287 *****************************************************************************/
2288BOOL WIN32API GetUserObjectInformationA(HANDLE hObj,
2289 int nIndex,
2290 PVOID pvInfo,
2291 DWORD nLength,
2292 LPDWORD lpnLengthNeeded)
2293{
2294 dprintf(("USER32:GetUserObjectInformationA (%08xh,%08xh,%08xh,%u,%08x) not implemented.\n",
2295 hObj,
2296 nIndex,
2297 pvInfo,
2298 nLength,
2299 lpnLengthNeeded));
2300
2301 return (FALSE);
2302}
2303/*****************************************************************************
2304 * Name : BOOL WIN32API GetUserObjectInformationW
2305 * Purpose : The GetUserObjectInformation function returns information about
2306 * a window station or desktop object.
2307 * Parameters: HANDLE hObj handle of object to get information for
2308 * int nIndex type of information to get
2309 * PVOID pvInfo points to buffer that receives the information
2310 * DWORD nLength size, in bytes, of pvInfo buffer
2311 * LPDWORD lpnLengthNeeded receives required size, in bytes, of pvInfo buffer
2312 * Variables :
2313 * Result : If the function succeeds, the return value is TRUE.
2314 * If the function fails, the return value is FALSE. To get extended
2315 * error information, call GetLastError.
2316 * Remark :
2317 * Status : UNTESTED STUB
2318 *
2319 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2320 *****************************************************************************/
2321BOOL WIN32API GetUserObjectInformationW(HANDLE hObj,
2322 int nIndex,
2323 PVOID pvInfo,
2324 DWORD nLength,
2325 LPDWORD lpnLengthNeeded)
2326{
2327 dprintf(("USER32:GetUserObjectInformationW (%08xh,%08xh,%08xh,%u,%08x) not implemented.\n",
2328 hObj,
2329 nIndex,
2330 pvInfo,
2331 nLength,
2332 lpnLengthNeeded));
2333
2334 return (FALSE);
2335}
2336/*****************************************************************************
2337 * Name : BOOL WIN32API GetUserObjectSecurity
2338 * Purpose : The GetUserObjectSecurity function retrieves security information
2339 * for the specified user object.
2340 * Parameters: HANDLE hObj handle of user object
2341 * SECURITY_INFORMATION * pSIRequested address of requested security information
2342 * LPSECURITY_DESCRIPTOR pSID address of security descriptor
2343 * DWORD nLength size of buffer for security descriptor
2344 * LPDWORD lpnLengthNeeded address of required size of buffer
2345 * Variables :
2346 * Result : If the function succeeds, the return value is TRUE.
2347 * If the function fails, the return value is FALSE. To get extended
2348 * error information, call GetLastError.
2349 * Remark :
2350 * Status : UNTESTED STUB
2351 *
2352 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2353 *****************************************************************************/
2354BOOL WIN32API GetUserObjectSecurity(HANDLE hObj,
2355 SECURITY_INFORMATION * pSIRequested,
2356 LPSECURITY_DESCRIPTOR pSID,
2357 DWORD nLength,
2358 LPDWORD lpnLengthNeeded)
2359{
2360 dprintf(("USER32:GetUserObjectSecurity (%08xh,%08xh,%08xh,%u,%08x) not implemented.\n",
2361 hObj,
2362 pSIRequested,
2363 pSID,
2364 nLength,
2365 lpnLengthNeeded));
2366
2367 return (FALSE);
2368}
2369/*****************************************************************************
2370 * Name : HDESK WIN32API OpenDesktopA
2371 * Purpose : The OpenDesktop function returns a handle to an existing desktop.
2372 * A desktop is a secure object contained within a window station
2373 * object. A desktop has a logical display surface and contains
2374 * windows, menus and hooks.
2375 * Parameters: LPCTSTR lpszDesktopName name of the desktop to open
2376 * DWORD dwFlags flags to control interaction with other applications
2377 * BOOL fInherit specifies whether returned handle is inheritable
2378 * DWORD dwDesiredAccess specifies access of returned handle
2379 * Variables :
2380 * Result : If the function succeeds, the return value is the handle to the
2381 * opened desktop.
2382 * If the function fails, the return value is NULL. To get extended
2383 * error information, call GetLastError.
2384 * Remark :
2385 * Status : UNTESTED STUB
2386 *
2387 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2388 *****************************************************************************/
2389HDESK WIN32API OpenDesktopA(LPCTSTR lpszDesktopName,
2390 DWORD dwFlags,
2391 BOOL fInherit,
2392 DWORD dwDesiredAccess)
2393{
2394 dprintf(("USER32:OpenDesktopA (%s,%08xh,%08xh,%08x) not implemented.\n",
2395 lpszDesktopName,
2396 dwFlags,
2397 fInherit,
2398 dwDesiredAccess));
2399
2400 return (NULL);
2401}
2402/*****************************************************************************
2403 * Name : HDESK WIN32API OpenDesktopW
2404 * Purpose : The OpenDesktop function returns a handle to an existing desktop.
2405 * A desktop is a secure object contained within a window station
2406 * object. A desktop has a logical display surface and contains
2407 * windows, menus and hooks.
2408 * Parameters: LPCTSTR lpszDesktopName name of the desktop to open
2409 * DWORD dwFlags flags to control interaction with other applications
2410 * BOOL fInherit specifies whether returned handle is inheritable
2411 * DWORD dwDesiredAccess specifies access of returned handle
2412 * Variables :
2413 * Result : If the function succeeds, the return value is the handle to the
2414 * opened desktop.
2415 * If the function fails, the return value is NULL. To get extended
2416 * error information, call GetLastError.
2417 * Remark :
2418 * Status : UNTESTED STUB
2419 *
2420 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2421 *****************************************************************************/
2422HDESK WIN32API OpenDesktopW(LPCTSTR lpszDesktopName,
2423 DWORD dwFlags,
2424 BOOL fInherit,
2425 DWORD dwDesiredAccess)
2426{
2427 dprintf(("USER32:OpenDesktopW (%s,%08xh,%08xh,%08x) not implemented.\n",
2428 lpszDesktopName,
2429 dwFlags,
2430 fInherit,
2431 dwDesiredAccess));
2432
2433 return (NULL);
2434}
2435/*****************************************************************************
2436 * Name : HDESK WIN32API OpenInputDesktop
2437 * Purpose : The OpenInputDesktop function returns a handle to the desktop
2438 * that receives user input. The input desktop is a desktop on the
2439 * window station associated with the logged-on user.
2440 * Parameters: DWORD dwFlags flags to control interaction with other applications
2441 * BOOL fInherit specifies whether returned handle is inheritable
2442 * DWORD dwDesiredAccess specifies access of returned handle
2443 * Variables :
2444 * Result : If the function succeeds, the return value is a handle of the
2445 * desktop that receives user input.
2446 * If the function fails, the return value is NULL. To get extended
2447 * error information, call GetLastError.
2448 * Remark :
2449 * Status : UNTESTED STUB
2450 *
2451 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2452 *****************************************************************************/
2453HDESK WIN32API OpenInputDesktop(DWORD dwFlags,
2454 BOOL fInherit,
2455 DWORD dwDesiredAccess)
2456{
2457 dprintf(("USER32:OpenInputDesktop (%08xh,%08xh,%08x) not implemented.\n",
2458 dwFlags,
2459 fInherit,
2460 dwDesiredAccess));
2461
2462 return (NULL);
2463}
2464/*****************************************************************************
2465 * Name : HWINSTA WIN32API OpenWindowStationA
2466 * Purpose : The OpenWindowStation function returns a handle to an existing
2467 * window station.
2468 * Parameters: LPCTSTR lpszWinStaName name of the window station to open
2469 * BOOL fInherit specifies whether returned handle is inheritable
2470 * DWORD dwDesiredAccess specifies access of returned handle
2471 * Variables :
2472 * Result : If the function succeeds, the return value is the handle to the
2473 * specified window station.
2474 * If the function fails, the return value is NULL. To get extended
2475 * error information, call GetLastError.
2476 * Remark :
2477 * Status : UNTESTED STUB
2478 *
2479 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2480 *****************************************************************************/
2481HWINSTA WIN32API OpenWindowStationA(LPCTSTR lpszWinStaName,
2482 BOOL fInherit,
2483 DWORD dwDesiredAccess)
2484{
2485 dprintf(("USER32:OpenWindowStatieonA (%s,%08xh,%08x) not implemented.\n",
2486 lpszWinStaName,
2487 fInherit,
2488 dwDesiredAccess));
2489
2490 return (NULL);
2491}
2492/*****************************************************************************
2493 * Name : HWINSTA WIN32API OpenWindowStationW
2494 * Purpose : The OpenWindowStation function returns a handle to an existing
2495 * window station.
2496 * Parameters: LPCTSTR lpszWinStaName name of the window station to open
2497 * BOOL fInherit specifies whether returned handle is inheritable
2498 * DWORD dwDesiredAccess specifies access of returned handle
2499 * Variables :
2500 * Result : If the function succeeds, the return value is the handle to the
2501 * specified window station.
2502 * If the function fails, the return value is NULL. To get extended
2503 * error information, call GetLastError.
2504
2505
2506 * Remark :
2507 * Status : UNTESTED STUB
2508 *
2509 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2510 *****************************************************************************/
2511HWINSTA WIN32API OpenWindowStationW(LPCTSTR lpszWinStaName,
2512 BOOL fInherit,
2513 DWORD dwDesiredAccess)
2514{
2515 dprintf(("USER32:OpenWindowStatieonW (%s,%08xh,%08x) not implemented.\n",
2516 lpszWinStaName,
2517 fInherit,
2518 dwDesiredAccess));
2519
2520 return (NULL);
2521}
2522/*****************************************************************************
2523 * Name : BOOL WIN32API SetProcessWindowStation
2524 * Purpose : The SetProcessWindowStation function assigns a window station
2525 * to the calling process. This enables the process to access
2526 * objects in the window station such as desktops, the clipboard,
2527 * and global atoms. All subsequent operations on the window station
2528 * use the access rights granted to hWinSta.
2529 * Parameters:
2530 * Variables :
2531 * Result : If the function succeeds, the return value is TRUE.
2532 * If the function fails, the return value is FALSE. To get extended
2533 * error information, call GetLastError.
2534 * Remark :
2535 * Status : UNTESTED STUB
2536 *
2537 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2538 *****************************************************************************/
2539BOOL WIN32API SetProcessWindowStation(HWINSTA hWinSta)
2540{
2541 dprintf(("USER32:SetProcessWindowStation (%08x) not implemented.\n",
2542 hWinSta));
2543
2544 return (FALSE);
2545}
2546/*****************************************************************************
2547 * Name : BOOL WIN32API SetThreadDesktop
2548 * Purpose : The SetThreadDesktop function assigns a desktop to the calling
2549 * thread. All subsequent operations on the desktop use the access
2550 * rights granted to hDesk.
2551 * Parameters: HDESK hDesk handle of the desktop to assign to this thread
2552 * Variables :
2553 * Result : If the function succeeds, the return value is TRUE.
2554 * If the function fails, the return value is FALSE. To get extended
2555 * error information, call GetLastError.
2556 * Remark :
2557 * Status : UNTESTED STUB
2558 *
2559 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2560 *****************************************************************************/
2561BOOL WIN32API SetThreadDesktop(HDESK hDesktop)
2562{
2563 dprintf(("USER32:SetThreadDesktop (%08x) not implemented.\n",
2564 hDesktop));
2565
2566 return (FALSE);
2567}
2568/*****************************************************************************
2569 * Name : BOOL WIN32API SetUserObjectInformationA
2570 * Purpose : The SetUserObjectInformation function sets information about a
2571 * window station or desktop object.
2572 * Parameters: HANDLE hObject handle of the object for which to set information
2573 * int nIndex type of information to set
2574 * PVOID lpvInfo points to a buffer that contains the information
2575 * DWORD cbInfo size, in bytes, of lpvInfo buffer
2576 * Variables :
2577 * Result : If the function succeeds, the return value is TRUE.
2578 * If the function fails the return value is FALSE. To get extended
2579 * error information, call GetLastError.
2580 * Remark :
2581 * Status : UNTESTED STUB
2582 *
2583 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2584 *****************************************************************************/
2585BOOL WIN32API SetUserObjectInformationA(HANDLE hObject,
2586 int nIndex,
2587 PVOID lpvInfo,
2588 DWORD cbInfo)
2589{
2590 dprintf(("USER32:SetUserObjectInformationA (%08xh,%u,%08xh,%08x) not implemented.\n",
2591 hObject,
2592 nIndex,
2593 lpvInfo,
2594 cbInfo));
2595
2596 return (FALSE);
2597}
2598/*****************************************************************************
2599 * Name : BOOL WIN32API SetUserObjectInformationW
2600 * Purpose : The SetUserObjectInformation function sets information about a
2601 * window station or desktop object.
2602 * Parameters: HANDLE hObject handle of the object for which to set information
2603 * int nIndex type of information to set
2604 * PVOID lpvInfo points to a buffer that contains the information
2605 * DWORD cbInfo size, in bytes, of lpvInfo buffer
2606 * Variables :
2607 * Result : If the function succeeds, the return value is TRUE.
2608 * If the function fails the return value is FALSE. To get extended
2609 * error information, call GetLastError.
2610 * Remark :
2611 * Status : UNTESTED STUB
2612 *
2613 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2614 *****************************************************************************/
2615BOOL WIN32API SetUserObjectInformationW(HANDLE hObject,
2616 int nIndex,
2617 PVOID lpvInfo,
2618 DWORD cbInfo)
2619{
2620 dprintf(("USER32:SetUserObjectInformationW (%08xh,%u,%08xh,%08x) not implemented.\n",
2621 hObject,
2622 nIndex,
2623 lpvInfo,
2624 cbInfo));
2625
2626 return (FALSE);
2627}
2628/*****************************************************************************
2629 * Name : BOOL WIN32API SetUserObjectSecurity
2630 * Purpose : The SetUserObjectSecurity function sets the security of a user
2631 * object. This can be, for example, a window or a DDE conversation
2632 * Parameters: HANDLE hObject handle of user object
2633 * SECURITY_INFORMATION * psi address of security information
2634 * LPSECURITY_DESCRIPTOR psd address of security descriptor
2635 * Variables :
2636 * Result : If the function succeeds, the return value is TRUE.
2637 * If the function fails, the return value is FALSE. To get extended
2638 * error information, call GetLastError.
2639 * Remark :
2640 * Status : UNTESTED STUB
2641 *
2642 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2643 *****************************************************************************/
2644BOOL WIN32API SetUserObjectSecurity(HANDLE hObject,
2645 SECURITY_INFORMATION * psi,
2646 LPSECURITY_DESCRIPTOR psd)
2647{
2648 dprintf(("USER32:SetUserObjectSecuroty (%08xh,%08xh,%08x) not implemented.\n",
2649 hObject,
2650 psi,
2651 psd));
2652
2653 return (FALSE);
2654}
2655/*****************************************************************************
2656 * Name : BOOL WIN32API SwitchDesktop
2657 * Purpose : The SwitchDesktop function makes a desktop visible and activates
2658 * it. This enables the desktop to receive input from the user. The
2659 * calling process must have DESKTOP_SWITCHDESKTOP access to the
2660 * desktop for the SwitchDesktop function to succeed.
2661 * Parameters:
2662 * Variables :
2663 * Result : If the function succeeds, the return value is TRUE.
2664 * If the function fails, the return value is FALSE. To get extended
2665 * error information, call GetLastError.
2666 * Remark :
2667 * Status : UNTESTED STUB
2668 *
2669 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2670 *****************************************************************************/
2671BOOL WIN32API SwitchDesktop(HDESK hDesktop)
2672{
2673 dprintf(("USER32:SwitchDesktop (%08x) not implemented.\n",
2674 hDesktop));
2675
2676 return (FALSE);
2677}
2678
2679/* Debugging Functions */
2680
2681/*****************************************************************************
2682 * Name : VOID WIN32API SetDebugErrorLevel
2683 * Purpose : The SetDebugErrorLevel function sets the minimum error level at
2684 * which Windows will generate debugging events and pass them to a debugger.
2685 * Parameters: DWORD dwLevel debugging error level
2686 * Variables :
2687 * Result :
2688 * Remark :
2689 * Status : UNTESTED STUB
2690 *
2691 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2692 *****************************************************************************/
2693VOID WIN32API SetDebugErrorLevel(DWORD dwLevel)
2694{
2695 dprintf(("USER32:SetDebugErrorLevel (%08x) not implemented.\n",
2696 dwLevel));
2697}
2698
2699/* Hook Functions */
2700
2701/*****************************************************************************
2702 * Name : BOOL WIN32API SetWindowsHookW
2703 * Purpose : The SetWindowsHook function is not implemented in the Win32 API.
2704 * Win32-based applications should use the SetWindowsHookEx function.
2705 * Parameters:
2706 * Variables :
2707 * Result :
2708 * Remark : ARGH ! MICROSOFT !
2709 * Status : UNTESTED STUB
2710 *
2711 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2712 *****************************************************************************/
2713HHOOK WIN32API SetWindowsHookW(int nFilterType, HOOKPROC pfnFilterProc)
2714
2715{
2716 return (FALSE);
2717}
2718
2719/* CB: move to ShowWindow() */
2720
2721/*****************************************************************************
2722 * Name : BOOL WIN32API ShowWindowAsync
2723 * Purpose : The ShowWindowAsync function sets the show state of a window
2724 * created by a different thread.
2725 * Parameters: HWND hwnd handle of window
2726 * int nCmdShow show state of window
2727 * Variables :
2728 * Result : If the window was previously visible, the return value is TRUE.
2729 * If the window was previously hidden, the return value is FALSE.
2730 * Remark :
2731 * Status : UNTESTED STUB
2732 *
2733 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2734 *****************************************************************************/
2735BOOL WIN32API ShowWindowAsync (HWND hWnd,
2736 int nCmdShow)
2737{
2738 dprintf(("USER32:ShowWindowAsync (%08xh,%08x) not implemented.\n",
2739 hWnd,
2740 nCmdShow));
2741
2742 return (FALSE);
2743}
2744
2745/* CB: move to MDI */
2746
2747/*****************************************************************************
2748 * Name : WORD WIN32API TileWindows
2749 * Purpose : The TileWindows function tiles the specified windows, or the child
2750 * windows of the specified parent window.
2751 * Parameters: HWND hwndParent handle of parent window
2752 * WORD wFlags types of windows not to arrange
2753 * LPCRECT lpRect rectangle to arrange windows in
2754 * WORD cChildrenb number of windows to arrange
2755 * const HWND *ahwndChildren array of window handles
2756 * Variables :
2757 * Result : If the function succeeds, the return value is the number of
2758 * windows arranged.
2759 * If the function fails, the return value is zero.
2760 * Remark :
2761 * Status : UNTESTED STUB
2762 *
2763 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2764 *****************************************************************************/
2765WORD WIN32API TileWindows(HWND hwndParent,
2766 UINT wFlags,
2767 const LPRECT lpRect,
2768 UINT cChildrenb,
2769 const HWND *ahwndChildren)
2770{
2771 dprintf(("USER32:TileWindows (%08xh,%08xh,%08xh,%08xh,%08x) not implemented.\n",
2772 hwndParent,
2773 wFlags,
2774 lpRect,
2775 cChildrenb,
2776 ahwndChildren));
2777
2778 return (0);
2779}
2780/*****************************************************************************
2781 * Name : BOOL WIN32API TileChildWindows
2782 * Purpose : Unknown
2783 * Parameters: Unknown
2784 * Variables :
2785 * Result :
2786 * Remark :
2787 * Status : UNTESTED UNKNOWN STUB
2788 *
2789 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2790 *****************************************************************************/
2791BOOL WIN32API TileChildWindows(DWORD x1,
2792 DWORD x2)
2793{
2794 dprintf(("USER32: TileChildWindows(%08xh,%08xh) not implemented.\n",
2795 x1,
2796 x2));
2797
2798 return (FALSE); /* default */
2799}
2800/*****************************************************************************
2801 * Name : BOOL WIN32API CascadeChildWindows
2802 * Purpose : Unknown
2803 * Parameters: Unknown
2804 * Variables :
2805 * Result :
2806 * Remark :
2807 * Status : UNTESTED UNKNOWN STUB
2808 *
2809 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2810 *****************************************************************************/
2811BOOL WIN32API CascadeChildWindows(DWORD x1,
2812 DWORD x2)
2813{
2814 dprintf(("USER32: CascadeChildWindows(%08xh,%08xh) not implemented.\n",
2815 x1,
2816 x2));
2817
2818 return (FALSE); /* default */
2819}
2820
2821/* Drag'n'drop */
2822
2823/*****************************************************************************
2824 * Name : BOOL WIN32API DragObject
2825 * Purpose : Unknown
2826 * Parameters: Unknown
2827 * Variables :
2828 * Result :
2829 * Remark :
2830 * Status : UNTESTED UNKNOWN STUB
2831 *
2832 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2833 *****************************************************************************/
2834DWORD WIN32API DragObject(HWND x1,HWND x2,UINT x3,DWORD x4,HCURSOR x5)
2835{
2836 dprintf(("USER32: DragObject(%08x,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
2837 x1,
2838 x2,
2839 x3,
2840 x4,
2841 x5));
2842
2843 return (FALSE); /* default */
2844}
2845
2846/* Unknown */
2847
2848/*****************************************************************************
2849 * Name : BOOL WIN32API SetShellWindow
2850 * Purpose : Unknown
2851 * Parameters: Unknown
2852 * Variables :
2853 * Result :
2854 * Remark :
2855 * Status : UNTESTED UNKNOWN STUB
2856 *
2857 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2858 *****************************************************************************/
2859BOOL WIN32API SetShellWindow(DWORD x1)
2860{
2861 dprintf(("USER32: SetShellWindow(%08x) not implemented.\n",
2862 x1));
2863
2864 return (FALSE); /* default */
2865}
2866/*****************************************************************************
2867 * Name : BOOL WIN32API PlaySoundEvent
2868 * Purpose : Unknown
2869 * Parameters: Unknown
2870 * Variables :
2871 * Result :
2872 * Remark :
2873 * Status : UNTESTED UNKNOWN STUB
2874 *
2875 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2876 *****************************************************************************/
2877BOOL WIN32API PlaySoundEvent(DWORD x1)
2878{
2879 dprintf(("USER32: PlaySoundEvent(%08x) not implemented.\n",
2880 x1));
2881
2882 return (FALSE); /* default */
2883}
2884/*****************************************************************************
2885 * Name : BOOL WIN32API SetSysColorsTemp
2886 * Purpose : Unknown
2887 * Parameters: Unknown
2888 * Variables :
2889 * Result :
2890 * Remark :
2891 * Status : UNTESTED UNKNOWN STUB
2892 *
2893 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2894 *****************************************************************************/
2895BOOL WIN32API SetSysColorsTemp(void)
2896{
2897 dprintf(("USER32: SetSysColorsTemp() not implemented.\n"));
2898
2899 return (FALSE); /* default */
2900}
2901/*****************************************************************************
2902 * Name : BOOL WIN32API RegisterNetworkCapabilities
2903 * Purpose : Unknown
2904 * Parameters: Unknown
2905 * Variables :
2906 * Result :
2907 * Remark :
2908 * Status : UNTESTED UNKNOWN STUB
2909 *
2910 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2911 *****************************************************************************/
2912BOOL WIN32API RegisterNetworkCapabilities(DWORD x1,
2913 DWORD x2)
2914{
2915 dprintf(("USER32: RegisterNetworkCapabilities(%08xh,%08xh) not implemented.\n",
2916 x1,
2917 x2));
2918
2919 return (FALSE); /* default */
2920}
2921/*****************************************************************************
2922 * Name : BOOL WIN32API EndTask
2923 * Purpose : Unknown
2924 * Parameters: Unknown
2925 * Variables :
2926 * Result :
2927 * Remark :
2928 * Status : UNTESTED UNKNOWN STUB
2929 *
2930 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2931 *****************************************************************************/
2932BOOL WIN32API EndTask(DWORD x1,
2933 DWORD x2,
2934 DWORD x3)
2935{
2936 dprintf(("USER32: EndTask(%08xh,%08xh,%08xh) not implemented.\n",
2937 x1,
2938 x2,
2939 x3));
2940
2941 return (FALSE); /* default */
2942}
2943/*****************************************************************************
2944 * Name : BOOL WIN32API GetNextQueueWindow
2945 * Purpose : Unknown
2946 * Parameters: Unknown
2947 * Variables :
2948 * Result :
2949 * Remark :
2950 * Status : UNTESTED UNKNOWN STUB
2951 *
2952 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2953 *****************************************************************************/
2954BOOL WIN32API GetNextQueueWindow(DWORD x1,
2955 DWORD x2)
2956{
2957 dprintf(("USER32: GetNextQueueWindow(%08xh,%08xh) not implemented.\n",
2958 x1,
2959 x2));
2960
2961 return (FALSE); /* default */
2962}
2963/*****************************************************************************
2964 * Name : BOOL WIN32API YieldTask
2965 * Purpose : Unknown
2966 * Parameters: Unknown
2967 * Variables :
2968 * Result :
2969 * Remark :
2970 * Status : UNTESTED UNKNOWN STUB
2971 *
2972 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2973 *****************************************************************************/
2974BOOL WIN32API YieldTask(void)
2975{
2976 dprintf(("USER32: YieldTask() not implemented.\n"));
2977
2978 return (FALSE); /* default */
2979}
2980/*****************************************************************************
2981 * Name : BOOL WIN32API WinOldAppHackoMatic
2982 * Purpose : Unknown
2983 * Parameters: Unknown
2984 * Variables :
2985 * Result :
2986 * Remark :
2987 * Status : UNTESTED UNKNOWN STUB
2988 *
2989 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2990 *****************************************************************************/
2991BOOL WIN32API WinOldAppHackoMatic(DWORD x1)
2992{
2993 dprintf(("USER32: WinOldAppHackoMatic(%08x) not implemented.\n",
2994 x1));
2995
2996 return (FALSE); /* default */
2997}
2998/*****************************************************************************
2999 * Name : BOOL WIN32API RegisterSystemThread
3000 * Purpose : Unknown
3001 * Parameters: Unknown
3002 * Variables :
3003 * Result :
3004 * Remark :
3005 * Status : UNTESTED UNKNOWN STUB
3006 *
3007 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3008 *****************************************************************************/
3009BOOL WIN32API RegisterSystemThread(DWORD x1,
3010 DWORD x2)
3011{
3012 dprintf(("USER32: RegisterSystemThread(%08xh,%08xh) not implemented.\n",
3013 x1,
3014 x2));
3015
3016 return (FALSE); /* default */
3017}
3018/*****************************************************************************
3019 * Name : BOOL WIN32API IsHungThread
3020 * Purpose : Unknown
3021 * Parameters: Unknown
3022 * Variables :
3023 * Result :
3024 * Remark :
3025 * Status : UNTESTED UNKNOWN STUB
3026 *
3027 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3028 *****************************************************************************/
3029BOOL WIN32API IsHungThread(DWORD x1)
3030{
3031 dprintf(("USER32: IsHungThread(%08xh) not implemented.\n",
3032 x1));
3033
3034 return (FALSE); /* default */
3035}
3036/*****************************************************************************
3037 * Name : BOOL WIN32API UserSignalProc
3038 * Purpose : Unknown
3039 * Parameters: Unknown
3040 * Variables :
3041 * Result :
3042 * Remark :
3043 * Status : UNTESTED UNKNOWN STUB
3044 *
3045 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3046 *****************************************************************************/
3047BOOL WIN32API UserSignalProc(DWORD x1,
3048 DWORD x2,
3049 DWORD x3,
3050 DWORD x4)
3051{
3052 dprintf(("USER32: SysErrorBox(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
3053 x1,
3054 x2,
3055 x3,
3056 x4));
3057
3058 return (FALSE); /* default */
3059}
3060/*****************************************************************************
3061 * Name : BOOL WIN32API GetShellWindow
3062 * Purpose : Unknown
3063 * Parameters: Unknown
3064 * Variables :
3065 * Result :
3066 * Remark :
3067 * Status : UNTESTED UNKNOWN STUB
3068 *
3069 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3070 *****************************************************************************/
3071HWND WIN32API GetShellWindow(void)
3072{
3073 dprintf(("USER32: GetShellWindow() not implemented.\n"));
3074
3075 return (0); /* default */
3076}
3077/***********************************************************************
3078 * RegisterTasklist32 [USER32.436]
3079 */
3080DWORD WIN32API RegisterTasklist (DWORD x)
3081{
3082 dprintf(("USER32: RegisterTasklist(%08xh) not implemented.\n",
3083 x));
3084
3085 return TRUE;
3086}
3087
3088
Note: See TracBrowser for help on using the repository browser.