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

Last change on this file since 2013 was 1963, checked in by phaller, 26 years ago

Fix: include path for misc.h

File size: 113.3 KB
Line 
1/* $Id: user32.cpp,v 1.58 1999-12-03 20:40:09 phaller 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_CXSCREEN:
685 rc = ScreenWidth;
686 break;
687
688 case SM_CYSCREEN:
689 rc = ScreenHeight;
690 break;
691
692 case SM_CXVSCROLL:
693 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CXVSCROLL);
694 break;
695
696 case SM_CYHSCROLL:
697 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CYHSCROLL);
698 break;
699
700 case SM_CYCAPTION:
701 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CYTITLEBAR);
702 break;
703
704 case SM_CXBORDER:
705 rc = 1;
706 break;
707
708 case SM_CYBORDER:
709 rc = 1;
710 break;
711
712//CB: todo: add missing metrics
713
714 case SM_CXICONSPACING: //TODO: size of grid cell for large icons
715 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CXICON);
716 //CB: return standard windows icon size?
717 //rc = 32;
718 break;
719 case SM_CYICONSPACING:
720 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CYICON);
721 //read SM_CXICONSPACING comment
722 //rc = 32;
723 break;
724 case SM_PENWINDOWS:
725 rc = FALSE;
726 break;
727 case SM_DBCSENABLED:
728 rc = FALSE;
729 break;
730 case SM_CXEDGE: //size of 3D window edge
731 rc = 1;
732 break;
733 case SM_CYEDGE:
734 rc = 1;
735 break;
736 case SM_CXMINSPACING: //can be SM_CXMINIMIZED or larger
737 //CB: replace with const
738 rc = O32_GetSystemMetrics(SM_CXMINIMIZED);
739 break;
740 case SM_CYMINSPACING:
741 //CB: replace with const
742 rc = GetSystemMetrics(SM_CYMINIMIZED);
743 break;
744 case SM_CXICON:
745 case SM_CYICON:
746 rc = 32; //CB: Win32: only 32x32, OS/2 32x32/40x40
747 // we must implement 32x32 for all screen resolutions
748 break;
749 case SM_CXSMICON: //recommended size of small icons (TODO: adjust to screen res.)
750 rc = 16;
751 break;
752 case SM_CYSMICON:
753 rc = 16;
754 break;
755 case SM_CYSMCAPTION: //size in pixels of a small caption (TODO: ????)
756 rc = 8;
757 break;
758 case SM_CXSMSIZE: //size of small caption buttons (pixels) (TODO: implement properly)
759 rc = 16;
760 break;
761 case SM_CYSMSIZE:
762 rc = 16;
763 break;
764 case SM_CXMENUSIZE: //TODO: size of menu bar buttons (such as MDI window close)
765 rc = 16;
766 break;
767 case SM_CYMENUSIZE:
768 rc = 16;
769 break;
770 case SM_ARRANGE:
771 rc = ARW_BOTTOMLEFT | ARW_LEFT;
772 break;
773 case SM_CXMINIMIZED:
774 break;
775 case SM_CYMINIMIZED:
776 break;
777 case SM_CXMAXTRACK: //max window size
778 case SM_CXMAXIMIZED: //max toplevel window size
779 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CXSCREEN);
780 break;
781 case SM_CYMAXTRACK:
782 case SM_CYMAXIMIZED:
783 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CYSCREEN);
784 break;
785 case SM_NETWORK:
786 rc = 0x01; //TODO: default = yes
787 break;
788 case SM_CLEANBOOT:
789 rc = 0; //normal boot
790 break;
791 case SM_CXDRAG: //nr of pixels before drag becomes a real one
792 rc = 2;
793 break;
794 case SM_CYDRAG:
795 rc = 2;
796 break;
797 case SM_SHOWSOUNDS: //show instead of play sound
798 rc = FALSE;
799 break;
800 case SM_CXMENUCHECK:
801 rc = 4; //TODO
802 break;
803 case SM_CYMENUCHECK:
804 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CYMENU);
805 break;
806 case SM_SLOWMACHINE:
807 rc = FALSE; //even a slow machine is fast with OS/2 :)
808 break;
809 case SM_MIDEASTENABLED:
810 rc = FALSE;
811 break;
812 case SM_MOUSEWHEELPRESENT:
813 rc = FALSE;
814 break;
815 case SM_XVIRTUALSCREEN:
816 rc = 0;
817 break;
818 case SM_YVIRTUALSCREEN:
819 rc = 0;
820 break;
821
822 case SM_CXVIRTUALSCREEN:
823 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CXSCREEN);
824 break;
825 case SM_CYVIRTUALSCREEN:
826 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CYSCREEN);
827 break;
828 case SM_CMONITORS:
829 rc = 1;
830 break;
831 case SM_SAMEDISPLAYFORMAT:
832 rc = TRUE;
833 break;
834 case SM_CMETRICS:
835 rc = 81;
836 //rc = O32_GetSystemMetrics(44); //Open32 changed this one
837 break;
838 default:
839 //better than nothing
840 rc = O32_GetSystemMetrics(nIndex);
841 break;
842 }
843 dprintf(("USER32: GetSystemMetrics %d returned %d\n", nIndex, rc));
844 return(rc);
845}
846//******************************************************************************
847/* Not support by Open32 (not included are the new win9x parameters):
848 case SPI_GETFASTTASKSWITCH:
849 case SPI_GETGRIDGRANULARITY:
850 case SPI_GETICONTITLELOGFONT:
851 case SPI_GETICONTITLEWRAP:
852 case SPI_GETMENUDROPALIGNMENT:
853 case SPI_ICONHORIZONTALSPACING:
854 case SPI_ICONVERTICALSPACING:
855 case SPI_LANGDRIVER:
856 case SPI_SETFASTTASKSWITCH:
857 case SPI_SETGRIDGRANULARITY:
858 case SPI_SETICONTITLELOGFONT:
859 case SPI_SETICONTITLEWRAP:
860 case SPI_SETMENUDROPALIGNMENT:
861 case SPI_GETSCREENSAVEACTIVE:
862 case SPI_GETSCREENSAVETIMEOUT:
863 case SPI_SETDESKPATTERN:
864 case SPI_SETDESKWALLPAPER:
865 case SPI_SETSCREENSAVEACTIVE:
866 case SPI_SETSCREENSAVETIMEOUT:
867*/
868//******************************************************************************
869BOOL WIN32API SystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
870{
871 BOOL rc = TRUE;
872 NONCLIENTMETRICSA *cmetric = (NONCLIENTMETRICSA *)pvParam;
873
874 switch(uiAction) {
875 case SPI_SCREENSAVERRUNNING:
876 *(BOOL *)pvParam = FALSE;
877 break;
878 case SPI_GETDRAGFULLWINDOWS:
879 *(BOOL *)pvParam = FALSE;
880 break;
881 case SPI_GETNONCLIENTMETRICS:
882 memset(cmetric, 0, sizeof(NONCLIENTMETRICSA));
883 cmetric->cbSize = sizeof(NONCLIENTMETRICSA);
884
885 //CB: fonts not handled by Open32, set to WarpSans
886 lstrcpyA(cmetric->lfCaptionFont.lfFaceName,"WarpSans");
887 cmetric->lfCaptionFont.lfHeight = 9;
888
889 lstrcpyA(cmetric->lfMenuFont.lfFaceName,"WarpSans");
890 cmetric->lfMenuFont.lfHeight = 9;
891
892 lstrcpyA(cmetric->lfStatusFont.lfFaceName,"WarpSans");
893 cmetric->lfStatusFont.lfHeight = 9;
894
895 lstrcpyA(cmetric->lfMessageFont.lfFaceName,"WarpSans");
896 cmetric->lfMessageFont.lfHeight = 9;
897
898 cmetric->iBorderWidth = GetSystemMetrics(SM_CXBORDER);
899 cmetric->iScrollWidth = GetSystemMetrics(SM_CXHSCROLL);
900 cmetric->iScrollHeight = GetSystemMetrics(SM_CYHSCROLL);
901 cmetric->iCaptionWidth = 32; //TODO
902 cmetric->iCaptionHeight = 16; //TODO
903 cmetric->iSmCaptionWidth = GetSystemMetrics(SM_CXSMSIZE);
904 cmetric->iSmCaptionHeight = GetSystemMetrics(SM_CYSMSIZE);
905 cmetric->iMenuWidth = 32; //TODO
906 cmetric->iMenuHeight = GetSystemMetrics(SM_CYMENU);
907 break;
908 case SPI_GETICONTITLELOGFONT:
909 {
910 LPLOGFONTA lpLogFont = (LPLOGFONTA)pvParam;
911
912 /* from now on we always have an alias for MS Sans Serif */
913 strcpy(lpLogFont->lfFaceName, "MS Sans Serif");
914 lpLogFont->lfHeight = -GetProfileIntA("Desktop","IconTitleSize", 8);
915 lpLogFont->lfWidth = 0;
916 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
917 lpLogFont->lfWeight = FW_NORMAL;
918 lpLogFont->lfItalic = FALSE;
919 lpLogFont->lfStrikeOut = FALSE;
920 lpLogFont->lfUnderline = FALSE;
921 lpLogFont->lfCharSet = ANSI_CHARSET;
922 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
923 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
924 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
925 break;
926 }
927 case SPI_GETBORDER:
928 *(INT *)pvParam = GetSystemMetrics( SM_CXFRAME );
929 break;
930
931 case SPI_GETWORKAREA:
932 SetRect( (RECT *)pvParam, 0, 0,
933 GetSystemMetrics( SM_CXSCREEN ),
934 GetSystemMetrics( SM_CYSCREEN )
935 );
936 break;
937
938 case 104: //TODO: Undocumented
939 rc = 16;
940 break;
941 default:
942 rc = O32_SystemParametersInfo(uiAction, uiParam, pvParam, fWinIni);
943 break;
944 }
945 dprintf(("USER32: SystemParametersInfoA %d, returned %d\n", uiAction, rc));
946 return(rc);
947}
948//******************************************************************************
949//TODO: Check for more options that have different structs for Unicode!!!!
950//******************************************************************************
951BOOL WIN32API SystemParametersInfoW(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
952{
953 BOOL rc;
954 NONCLIENTMETRICSW *clientMetricsW = (NONCLIENTMETRICSW *)pvParam;
955 NONCLIENTMETRICSA clientMetricsA = {0};
956 PVOID pvParamA;
957 UINT uiParamA;
958
959 switch(uiAction) {
960 case SPI_SETNONCLIENTMETRICS:
961 clientMetricsA.cbSize = sizeof(NONCLIENTMETRICSA);
962 clientMetricsA.iBorderWidth = clientMetricsW->iBorderWidth;
963 clientMetricsA.iScrollWidth = clientMetricsW->iScrollWidth;
964 clientMetricsA.iScrollHeight = clientMetricsW->iScrollHeight;
965 clientMetricsA.iCaptionWidth = clientMetricsW->iCaptionWidth;
966 clientMetricsA.iCaptionHeight = clientMetricsW->iCaptionHeight;
967 ConvertFontWA(&clientMetricsW->lfCaptionFont, &clientMetricsA.lfCaptionFont);
968 clientMetricsA.iSmCaptionWidth = clientMetricsW->iSmCaptionWidth;
969 clientMetricsA.iSmCaptionHeight = clientMetricsW->iSmCaptionHeight;
970 ConvertFontWA(&clientMetricsW->lfSmCaptionFont, &clientMetricsA.lfSmCaptionFont);
971 clientMetricsA.iMenuWidth = clientMetricsW->iMenuWidth;
972 clientMetricsA.iMenuHeight = clientMetricsW->iMenuHeight;
973 ConvertFontWA(&clientMetricsW->lfMenuFont, &clientMetricsA.lfMenuFont);
974 ConvertFontWA(&clientMetricsW->lfStatusFont, &clientMetricsA.lfStatusFont);
975 ConvertFontWA(&clientMetricsW->lfMessageFont, &clientMetricsA.lfMessageFont);
976 //no break
977 case SPI_GETNONCLIENTMETRICS:
978 uiParamA = sizeof(NONCLIENTMETRICSA);
979 pvParamA = &clientMetricsA;
980 break;
981 case SPI_GETICONTITLELOGFONT:
982 {
983 LPLOGFONTW lpLogFont = (LPLOGFONTW)pvParam;
984
985 /* from now on we always have an alias for MS Sans Serif */
986 lstrcpyW(lpLogFont->lfFaceName, (LPCWSTR)L"MS Sans Serif");
987 lpLogFont->lfHeight = -GetProfileIntA("Desktop","IconTitleSize", 8);
988 lpLogFont->lfWidth = 0;
989 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
990 lpLogFont->lfWeight = FW_NORMAL;
991 lpLogFont->lfItalic = FALSE;
992 lpLogFont->lfStrikeOut = FALSE;
993 lpLogFont->lfUnderline = FALSE;
994 lpLogFont->lfCharSet = ANSI_CHARSET;
995 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
996 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
997 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
998 return TRUE;
999 }
1000 default:
1001 pvParamA = pvParam;
1002 uiParamA = uiParam;
1003 break;
1004 }
1005 rc = SystemParametersInfoA(uiAction, uiParamA, pvParamA, fWinIni);
1006
1007 switch(uiAction) {
1008 case SPI_GETNONCLIENTMETRICS:
1009 clientMetricsW->cbSize = sizeof(*clientMetricsW);
1010 clientMetricsW->iBorderWidth = clientMetricsA.iBorderWidth;
1011 clientMetricsW->iScrollWidth = clientMetricsA.iScrollWidth;
1012 clientMetricsW->iScrollHeight = clientMetricsA.iScrollHeight;
1013 clientMetricsW->iCaptionWidth = clientMetricsA.iCaptionWidth;
1014 clientMetricsW->iCaptionHeight = clientMetricsA.iCaptionHeight;
1015 ConvertFontAW(&clientMetricsA.lfCaptionFont, &clientMetricsW->lfCaptionFont);
1016
1017 clientMetricsW->iSmCaptionWidth = clientMetricsA.iSmCaptionWidth;
1018 clientMetricsW->iSmCaptionHeight = clientMetricsA.iSmCaptionHeight;
1019 ConvertFontAW(&clientMetricsA.lfSmCaptionFont, &clientMetricsW->lfSmCaptionFont);
1020
1021 clientMetricsW->iMenuWidth = clientMetricsA.iMenuWidth;
1022 clientMetricsW->iMenuHeight = clientMetricsA.iMenuHeight;
1023 ConvertFontAW(&clientMetricsA.lfMenuFont, &clientMetricsW->lfMenuFont);
1024 ConvertFontAW(&clientMetricsA.lfStatusFont, &clientMetricsW->lfStatusFont);
1025 ConvertFontAW(&clientMetricsA.lfMessageFont, &clientMetricsW->lfMessageFont);
1026 break;
1027 }
1028#ifdef DEBUG
1029 WriteLog("USER32: SystemParametersInfoW %d, returned %d\n", uiAction, rc);
1030#endif
1031 return(rc);
1032}
1033
1034/* Process and Thread Functions */
1035
1036//******************************************************************************
1037//DWORD idAttach; /* thread to attach */
1038//DWORD idAttachTo; /* thread to attach to */
1039//BOOL fAttach; /* attach or detach */
1040//******************************************************************************
1041BOOL WIN32API AttachThreadInput(DWORD idAttach, DWORD idAttachTo, BOOL fAttach)
1042{
1043#ifdef DEBUG
1044 WriteLog("USER32: AttachThreadInput, not implemented\n");
1045#endif
1046 return(TRUE);
1047}
1048//******************************************************************************
1049//TODO:How can we emulate this one in OS/2???
1050//******************************************************************************
1051DWORD WIN32API WaitForInputIdle(HANDLE hProcess, DWORD dwTimeOut)
1052{
1053#ifdef DEBUG
1054 WriteLog("USER32: WaitForInputIdle (Not Implemented) %d\n", dwTimeOut);
1055#endif
1056
1057 if(dwTimeOut == INFINITE) return(0);
1058
1059// DosSleep(dwTimeOut/16);
1060 return(0);
1061}
1062
1063/* Help Functions */
1064
1065BOOL WIN32API WinHelpA( HWND hwnd, LPCSTR lpszHelp, UINT uCommand, DWORD dwData)
1066{
1067#ifdef DEBUG
1068 WriteLog("USER32: WinHelp not implemented %s\n", lpszHelp);
1069#endif
1070// hwnd = Win32Window::Win32ToOS2Handle(hwnd);
1071// return O32_WinHelp(arg1, arg2, arg3, arg4);
1072
1073 return(TRUE);
1074}
1075//******************************************************************************
1076//******************************************************************************
1077BOOL WIN32API WinHelpW( HWND arg1, LPCWSTR arg2, UINT arg3, DWORD arg4)
1078{
1079 char *astring = UnicodeToAsciiString((LPWSTR)arg2);
1080 BOOL rc;
1081
1082#ifdef DEBUG
1083 WriteLog("USER32: WinHelpW\n");
1084#endif
1085 rc = WinHelpA(arg1, astring, arg3, arg4);
1086 FreeAsciiString(astring);
1087 return rc;
1088}
1089
1090/* Keyboard and Input Functions */
1091
1092BOOL WIN32API ActivateKeyboardLayout(HKL hkl, UINT fuFlags)
1093{
1094#ifdef DEBUG
1095 WriteLog("USER32: ActivateKeyboardLayout, not implemented\n");
1096#endif
1097 return(TRUE);
1098}
1099//******************************************************************************
1100//SvL: 24-6-'97 - Added
1101//TODO: Not implemented
1102//******************************************************************************
1103WORD WIN32API GetAsyncKeyState(INT nVirtKey)
1104{
1105 dprintf2(("USER32: GetAsyncKeyState Not implemented\n"));
1106 return 0;
1107}
1108/*****************************************************************************
1109 * Name : UINT WIN32API GetKBCodePage
1110 * Purpose : The GetKBCodePage function is provided for compatibility with
1111 * earlier versions of Windows. In the Win32 application programming
1112 * interface (API) it just calls the GetOEMCP function.
1113 * Parameters:
1114 * Variables :
1115 * Result : If the function succeeds, the return value is an OEM code-page
1116 * identifier, or it is the default identifier if the registry
1117 * value is not readable. For a list of OEM code-page identifiers,
1118 * see GetOEMCP.
1119 * Remark :
1120 * Status : UNTESTED
1121 *
1122 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1123 *****************************************************************************/
1124
1125UINT WIN32API GetKBCodePage(VOID)
1126{
1127 return (GetOEMCP());
1128}
1129//******************************************************************************
1130//******************************************************************************
1131int WIN32API GetKeyNameTextA( LPARAM lParam, LPSTR lpString, int nSize)
1132{
1133#ifdef DEBUG
1134 WriteLog("USER32: GetKeyNameTextA\n");
1135#endif
1136 return O32_GetKeyNameText(lParam,lpString,nSize);
1137}
1138//******************************************************************************
1139//******************************************************************************
1140int WIN32API GetKeyNameTextW( LPARAM lParam, LPWSTR lpString, int nSize)
1141{
1142#ifdef DEBUG
1143 WriteLog("USER32: GetKeyNameTextW DOES NOT WORK\n");
1144#endif
1145 // NOTE: This will not work as is (needs UNICODE support)
1146 return 0;
1147// return O32_GetKeyNameText(arg1, arg2, arg3);
1148}
1149//******************************************************************************
1150//SvL: 24-6-'97 - Added
1151//******************************************************************************
1152SHORT WIN32API GetKeyState( int nVirtKey)
1153{
1154//SvL: Hehe. 32 MB logfile for Opera after a minute.
1155 dprintf2(("USER32: GetKeyState %d\n", nVirtKey));
1156 return O32_GetKeyState(nVirtKey);
1157}
1158/*****************************************************************************
1159 * Name : VOID WIN32API keybd_event
1160 * Purpose : The keybd_event function synthesizes a keystroke. The system
1161 * can use such a synthesized keystroke to generate a WM_KEYUP or
1162 * WM_KEYDOWN message. The keyboard driver's interrupt handler calls
1163 * the keybd_event function.
1164 * Parameters: BYTE bVk virtual-key code
1165
1166 * BYTE bScan hardware scan code
1167 * DWORD dwFlags flags specifying various function options
1168 * DWORD dwExtraInfo additional data associated with keystroke
1169 * Variables :
1170 * Result :
1171 * Remark :
1172 * Status : UNTESTED STUB
1173 *
1174 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1175 *****************************************************************************/
1176VOID WIN32API keybd_event (BYTE bVk,
1177 BYTE bScan,
1178 DWORD dwFlags,
1179 DWORD dwExtraInfo)
1180{
1181 dprintf(("USER32:keybd_event (%u,%u,%08xh,%08x) not implemented.\n",
1182 bVk,
1183 bScan,
1184 dwFlags,
1185 dwExtraInfo));
1186}
1187/*****************************************************************************
1188 * Name : HLK WIN32API LoadKeyboardLayoutA
1189 * Purpose : The LoadKeyboardLayout function loads a new keyboard layout into
1190 * the system. Several keyboard layouts can be loaded at a time, but
1191 * only one per process is active at a time. Loading multiple keyboard
1192 * layouts makes it possible to rapidly switch between layouts.
1193 * Parameters:
1194 * Variables :
1195 * Result : If the function succeeds, the return value is the handle of the
1196 * keyboard layout.
1197 * If the function fails, the return value is NULL. To get extended
1198 * error information, call GetLastError.
1199 * Remark :
1200 * Status : UNTESTED STUB
1201 *
1202 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1203 *****************************************************************************/
1204HKL WIN32API LoadKeyboardLayoutA(LPCTSTR pwszKLID,
1205 UINT Flags)
1206{
1207 dprintf(("USER32:LeadKeyboardLayoutA (%s,%u) not implemented.\n",
1208 pwszKLID,
1209 Flags));
1210
1211 return (NULL);
1212}
1213/*****************************************************************************
1214 * Name : HLK WIN32API LoadKeyboardLayoutW
1215 * Purpose : The LoadKeyboardLayout function loads a new keyboard layout into
1216 * the system. Several keyboard layouts can be loaded at a time, but
1217 * only one per process is active at a time. Loading multiple keyboard
1218 * layouts makes it possible to rapidly switch between layouts.
1219 * Parameters:
1220 * Variables :
1221 * Result : If the function succeeds, the return value is the handle of the
1222 * keyboard layout.
1223 * If the function fails, the return value is NULL. To get extended
1224 * error information, call GetLastError.
1225 * Remark :
1226 * Status : UNTESTED STUB
1227 *
1228 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1229 *****************************************************************************/
1230HKL WIN32API LoadKeyboardLayoutW(LPCWSTR pwszKLID,
1231 UINT Flags)
1232{
1233 dprintf(("USER32:LeadKeyboardLayoutW (%s,%u) not implemented.\n",
1234 pwszKLID,
1235 Flags));
1236
1237 return (NULL);
1238}
1239//******************************************************************************
1240//******************************************************************************
1241UINT WIN32API MapVirtualKeyA( UINT uCode, UINT uMapType)
1242{
1243#ifdef DEBUG
1244 WriteLog("USER32: MapVirtualKeyA\n");
1245#endif
1246 return O32_MapVirtualKey(uCode,uMapType);
1247}
1248//******************************************************************************
1249//******************************************************************************
1250UINT WIN32API MapVirtualKeyW( UINT uCode, UINT uMapType)
1251{
1252#ifdef DEBUG
1253 WriteLog("USER32: MapVirtualKeyW\n");
1254#endif
1255 // NOTE: This will not work as is (needs UNICODE support)
1256 return O32_MapVirtualKey(uCode,uMapType);
1257}
1258/*****************************************************************************
1259 * Name : UINT WIN32API MapVirtualKeyExA
1260 * Purpose : The MapVirtualKeyEx function translates (maps) a virtual-key
1261 * code into a scan code or character value, or translates a scan
1262 * code into a virtual-key code. The function translates the codes
1263 * using the input language and physical keyboard layout identified
1264 * by the given keyboard layout handle.
1265 * Parameters:
1266 * Variables :
1267 * Result : The return value is either a scan code, a virtual-key code, or
1268 * a character value, depending on the value of uCode and uMapType.
1269 * If there is no translation, the return value is zero.
1270 * Remark :
1271 * Status : UNTESTED STUB
1272 *
1273 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1274 *****************************************************************************/
1275UINT WIN32API MapVirtualKeyExA(UINT uCode,
1276 UINT uMapType,
1277 HKL dwhkl)
1278{
1279 dprintf(("USER32:MapVirtualKeyExA (%u,%u,%08x) not implemented.\n",
1280 uCode,
1281 uMapType,
1282 dwhkl));
1283
1284 return (0);
1285}
1286/*****************************************************************************
1287 * Name : UINT WIN32API MapVirtualKeyExW
1288 * Purpose : The MapVirtualKeyEx function translates (maps) a virtual-key
1289 * code into a scan code or character value, or translates a scan
1290 * code into a virtual-key code. The function translates the codes
1291 * using the input language and physical keyboard layout identified
1292 * by the given keyboard layout handle.
1293 * Parameters:
1294 * Variables :
1295 * Result : The return value is either a scan code, a virtual-key code, or
1296 * a character value, depending on the value of uCode and uMapType.
1297 * If there is no translation, the return value is zero.
1298 * Remark :
1299 * Status : UNTESTED STUB
1300
1301 *
1302 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1303 *****************************************************************************/
1304UINT WIN32API MapVirtualKeyExW(UINT uCode,
1305 UINT uMapType,
1306 HKL dwhkl)
1307{
1308 dprintf(("USER32:MapVirtualKeyExW (%u,%u,%08x) not implemented.\n",
1309 uCode,
1310 uMapType,
1311 dwhkl));
1312
1313 return (0);
1314}
1315/*****************************************************************************
1316 * Name : DWORD WIN32API OemKeyScan
1317 * Purpose : The OemKeyScan function maps OEM ASCII codes 0 through 0x0FF
1318 * into the OEM scan codes and shift states. The function provides
1319 * information that allows a program to send OEM text to another
1320 * program by simulating keyboard input.
1321 * Parameters:
1322 * Variables :
1323 * Result :
1324 * Remark :
1325 * Status : UNTESTED STUB
1326 *
1327 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1328 *****************************************************************************/
1329DWORD WIN32API OemKeyScan(WORD wOemChar)
1330{
1331 dprintf(("USER32:OemKeyScan (%u) not implemented.\n",
1332 wOemChar));
1333
1334 return (wOemChar);
1335}
1336//******************************************************************************
1337//******************************************************************************
1338BOOL WIN32API RegisterHotKey(HWND hwnd, int idHotKey, UINT fuModifiers, UINT uVirtKey)
1339{
1340#ifdef DEBUG
1341 WriteLog("USER32: RegisterHotKey, not implemented\n");
1342#endif
1343 hwnd = Win32Window::Win32ToOS2Handle(hwnd);
1344 return(TRUE);
1345}
1346/*****************************************************************************
1347 * Name : int WIN32API ToAscii
1348 * Purpose : The ToAscii function translates the specified virtual-key code
1349 * and keyboard state to the corresponding Windows character or characters.
1350 * Parameters: UINT uVirtKey virtual-key code
1351 * UINT uScanCode scan code
1352 * PBYTE lpbKeyState address of key-state array
1353 * LPWORD lpwTransKey buffer for translated key
1354 * UINT fuState active-menu flag
1355 * Variables :
1356 * Result : 0 The specified virtual key has no translation for the current
1357 * state of the keyboard.
1358 * 1 One Windows character was copied to the buffer.
1359 * 2 Two characters were copied to the buffer. This usually happens
1360 * when a dead-key character (accent or diacritic) stored in the
1361 * keyboard layout cannot be composed with the specified virtual
1362 * key to form a single character.
1363 * Remark :
1364 * Status : UNTESTED STUB
1365 *
1366 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1367 *****************************************************************************/
1368int WIN32API ToAscii(UINT uVirtKey,
1369 UINT uScanCode,
1370 PBYTE lpbKeyState,
1371 LPWORD lpwTransKey,
1372 UINT fuState)
1373{
1374 dprintf(("USER32:ToAscii (%u,%u,%08xh,%08xh,%u) not implemented.\n",
1375 uVirtKey,
1376 uScanCode,
1377 lpbKeyState,
1378 lpwTransKey,
1379 fuState));
1380
1381 return (0);
1382}
1383/*****************************************************************************
1384 * Name : int WIN32API ToAsciiEx
1385 * Purpose : The ToAscii function translates the specified virtual-key code
1386 * and keyboard state to the corresponding Windows character or characters.
1387 * Parameters: UINT uVirtKey virtual-key code
1388 * UINT uScanCode scan code
1389 * PBYTE lpbKeyState address of key-state array
1390 * LPWORD lpwTransKey buffer for translated key
1391 * UINT fuState active-menu flag
1392 * HLK hlk keyboard layout handle
1393 * Variables :
1394 * Result : 0 The specified virtual key has no translation for the current
1395 * state of the keyboard.
1396 * 1 One Windows character was copied to the buffer.
1397 * 2 Two characters were copied to the buffer. This usually happens
1398 * when a dead-key character (accent or diacritic) stored in the
1399 * keyboard layout cannot be composed with the specified virtual
1400 * key to form a single character.
1401 * Remark :
1402 * Status : UNTESTED STUB
1403 *
1404 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1405 *****************************************************************************/
1406int WIN32API ToAsciiEx(UINT uVirtKey,
1407 UINT uScanCode,
1408 PBYTE lpbKeyState,
1409 LPWORD lpwTransKey,
1410 UINT fuState,
1411 HKL hkl)
1412{
1413 dprintf(("USER32:ToAsciiEx (%u,%u,%08xh,%08xh,%u,%08x) not implemented.\n",
1414 uVirtKey,
1415 uScanCode,
1416 lpbKeyState,
1417 lpwTransKey,
1418 fuState,
1419 hkl));
1420
1421 return (0);
1422}
1423/*****************************************************************************
1424 * Name : int WIN32API ToUnicode
1425 * Purpose : The ToUnicode function translates the specified virtual-key code
1426 * and keyboard state to the corresponding Unicode character or characters.
1427 * Parameters: UINT wVirtKey virtual-key code
1428 * UINT wScanCode scan code
1429 * PBYTE lpKeyState address of key-state array
1430 * LPWSTR pwszBuff buffer for translated key
1431 * int cchBuff size of translated key buffer
1432 * UINT wFlags set of function-conditioning flags
1433 * Variables :
1434 * Result : - 1 The specified virtual key is a dead-key character (accent or
1435 * diacritic). This value is returned regardless of the keyboard
1436 * layout, even if several characters have been typed and are
1437 * stored in the keyboard state. If possible, even with Unicode
1438 * keyboard layouts, the function has written a spacing version of
1439 * the dead-key character to the buffer specified by pwszBuffer.
1440 * For example, the function writes the character SPACING ACUTE
1441 * (0x00B4), rather than the character NON_SPACING ACUTE (0x0301).
1442 * 0 The specified virtual key has no translation for the current
1443 * state of the keyboard. Nothing was written to the buffer
1444 * specified by pwszBuffer.
1445 * 1 One character was written to the buffer specified by pwszBuffer.
1446 * 2 or more Two or more characters were written to the buffer specified by
1447 * pwszBuff. The most common cause for this is that a dead-key
1448 * character (accent or diacritic) stored in the keyboard layout
1449 * could not be combined with the specified virtual key to form a
1450 * single character.
1451 * Remark :
1452 * Status : UNTESTED STUB
1453 *
1454 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1455 *****************************************************************************/
1456int WIN32API ToUnicode(UINT uVirtKey,
1457 UINT uScanCode,
1458 PBYTE lpKeyState,
1459 LPWSTR pwszBuff,
1460 int cchBuff,
1461 UINT wFlags)
1462{
1463 dprintf(("USER32:ToUnicode (%u,%u,%08xh,%08xh,%u,%08x) not implemented.\n",
1464 uVirtKey,
1465 uScanCode,
1466 lpKeyState,
1467 pwszBuff,
1468 cchBuff,
1469 wFlags));
1470
1471 return (0);
1472}
1473/*****************************************************************************
1474 * Name : BOOL WIN32API UnloadKeyboardLayout
1475 * Purpose : The UnloadKeyboardLayout function removes a keyboard layout.
1476 * Parameters: HKL hkl handle of keyboard layout
1477 * Variables :
1478 * Result : If the function succeeds, the return value is the handle of the
1479 * keyboard layout; otherwise, it is NULL. To get extended error
1480 * information, use the GetLastError function.
1481 * Remark :
1482 * Status : UNTESTED STUB
1483 *
1484 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1485 *****************************************************************************/
1486BOOL WIN32API UnloadKeyboardLayout (HKL hkl)
1487{
1488 dprintf(("USER32:UnloadKeyboardLayout (%08x) not implemented.\n",
1489 hkl));
1490
1491 return (0);
1492}
1493//******************************************************************************
1494//******************************************************************************
1495BOOL WIN32API UnregisterHotKey(HWND hwnd, int idHotKey)
1496{
1497#ifdef DEBUG
1498 WriteLog("USER32: UnregisterHotKey, not implemented\n");
1499#endif
1500 hwnd = Win32Window::Win32ToOS2Handle(hwnd);
1501
1502 return(TRUE);
1503}
1504//******************************************************************************
1505//SvL: 24-6-'97 - Added
1506//******************************************************************************
1507WORD WIN32API VkKeyScanA( char ch)
1508{
1509#ifdef DEBUG
1510 WriteLog("USER32: VkKeyScanA\n");
1511#endif
1512 return O32_VkKeyScan(ch);
1513}
1514//******************************************************************************
1515//******************************************************************************
1516WORD WIN32API VkKeyScanW( WCHAR wch)
1517{
1518#ifdef DEBUG
1519 WriteLog("USER32: VkKeyScanW\n");
1520#endif
1521 // NOTE: This will not work as is (needs UNICODE support)
1522 return O32_VkKeyScan((char)wch);
1523}
1524/*****************************************************************************
1525 * Name : SHORT WIN32API VkKeyScanExW
1526 * Purpose : The VkKeyScanEx function translates a character to the
1527 * corresponding virtual-key code and shift state. The function
1528 * translates the character using the input language and physical
1529 * keyboard layout identified by the given keyboard layout handle.
1530 * Parameters: UINT uChar character to translate
1531 * HKL hkl keyboard layout handle
1532 * Variables :
1533 * Result : see docs
1534 * Remark :
1535 * Status : UNTESTED STUB
1536 *
1537 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1538 *****************************************************************************/
1539WORD WIN32API VkKeyScanExW(WCHAR uChar,
1540 HKL hkl)
1541{
1542 dprintf(("USER32:VkKeyScanExW (%u,%08x) not implemented.\n",
1543 uChar,
1544 hkl));
1545
1546 return (uChar);
1547}
1548/*****************************************************************************
1549 * Name : SHORT WIN32API VkKeyScanExA
1550 * Purpose : The VkKeyScanEx function translates a character to the
1551 * corresponding virtual-key code and shift state. The function
1552 * translates the character using the input language and physical
1553 * keyboard layout identified by the given keyboard layout handle.
1554 * Parameters: UINT uChar character to translate
1555 * HKL hkl keyboard layout handle
1556 * Variables :
1557 * Result : see docs
1558 * Remark :
1559 * Status : UNTESTED STUB
1560 *
1561 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1562 *****************************************************************************/
1563WORD WIN32API VkKeyScanExA(CHAR uChar,
1564 HKL hkl)
1565{
1566 dprintf(("USER32:VkKeyScanExA (%u,%08x) not implemented.\n",
1567 uChar,
1568 hkl));
1569
1570 return (uChar);
1571}
1572
1573/* Button Functions */
1574
1575BOOL WIN32API CheckRadioButton( HWND hDlg, UINT nIDFirstButton, UINT nIDLastButton, UINT nIDCheckButton)
1576{
1577#ifdef DEBUG
1578 WriteLog("USER32: CheckRadioButton\n");
1579#endif
1580 //CB: check radio buttons in interval
1581 if (nIDFirstButton > nIDLastButton)
1582 {
1583 SetLastError(ERROR_INVALID_PARAMETER);
1584 return (FALSE);
1585 }
1586
1587 for (UINT x = nIDFirstButton;x <= nIDLastButton;x++)
1588 {
1589 SendDlgItemMessageA(hDlg,x,BM_SETCHECK,(x == nIDCheckButton) ? BST_CHECKED : BST_UNCHECKED,0);
1590 }
1591
1592 return (TRUE);
1593}
1594
1595/* Window Functions */
1596
1597/*****************************************************************************
1598 * Name : BOOL WIN32API AnyPopup
1599 * Purpose : The AnyPopup function indicates whether an owned, visible,
1600 * top-level pop-up, or overlapped window exists on the screen. The
1601 * function searches the entire Windows screen, not just the calling
1602 * application's client area.
1603 * Parameters: VOID
1604 * Variables :
1605 * Result : If a pop-up window exists, the return value is TRUE even if the
1606 * pop-up window is completely covered by other windows. Otherwise,
1607 * it is FALSE.
1608 * Remark : AnyPopup is a Windows version 1.x function and is retained for
1609 * compatibility purposes. It is generally not useful.
1610 * Status : UNTESTED STUB
1611 *
1612 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1613 *****************************************************************************/
1614BOOL WIN32API AnyPopup(VOID)
1615{
1616 dprintf(("USER32:AnyPopup() not implemented.\n"));
1617
1618 return (FALSE);
1619}
1620
1621//******************************************************************************
1622//******************************************************************************
1623/*****************************************************************************
1624 * Name : int WIN32API GetWindowRgn
1625 * Purpose : The GetWindowRgn function obtains a copy of the window region of a window.
1626 * Parameters: HWND hWnd handle to window whose window region is to be obtained
1627 * HRGN hRgn handle to region that receives a copy of the window region
1628 * Variables :
1629 * Result : NULLREGION, SIMPLEREGION, COMPLEXREGION, ERROR
1630 * Remark :
1631 * Status : UNTESTED STUB
1632 *
1633 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1634 *****************************************************************************/
1635
1636int WIN32API GetWindowRgn (HWND hWnd,
1637 HRGN hRgn)
1638{
1639 dprintf(("USER32:GetWindowRgn (%08xh,%08x) not implemented.\n",
1640 hWnd,
1641 hRgn));
1642 //Attention: Win32 hwnd handle!
1643
1644 return (NULLREGION);
1645}
1646//******************************************************************************
1647//TODO: Not complete
1648//******************************************************************************
1649BOOL WIN32API GrayStringA(HDC hdc, HBRUSH hBrush, GRAYSTRINGPROC lpOutputFunc,
1650 LPARAM lpData, int nCount, int X, int Y, int nWidth,
1651 int nHeight)
1652{
1653 BOOL rc;
1654 COLORREF curclr;
1655
1656#ifdef DEBUG
1657 WriteLog("USER32: GrayStringA, not completely implemented\n");
1658#endif
1659 if(lpOutputFunc == NULL && lpData == NULL) {
1660#ifdef DEBUG
1661 WriteLog("USER32: lpOutputFunc == NULL && lpData == NULL\n");
1662#endif
1663 return(FALSE);
1664 }
1665 if(lpOutputFunc) {
1666 return(lpOutputFunc(hdc, lpData, nCount));
1667 }
1668 curclr = SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
1669 rc = TextOutA(hdc, X, Y, (char *)lpData, nCount);
1670 SetTextColor(hdc, curclr);
1671
1672 return(rc);
1673}
1674//******************************************************************************
1675//******************************************************************************
1676BOOL WIN32API GrayStringW(HDC hdc, HBRUSH hBrush, GRAYSTRINGPROC lpOutputFunc,
1677 LPARAM lpData, int nCount, int X, int Y, int nWidth,
1678 int nHeight)
1679{
1680 BOOL rc;
1681 char *astring;
1682 COLORREF curclr;
1683
1684#ifdef DEBUG
1685 WriteLog("USER32: GrayStringW, not completely implemented\n");
1686#endif
1687
1688 if(lpOutputFunc == NULL && lpData == NULL) {
1689#ifdef DEBUG
1690 WriteLog("USER32: lpOutputFunc == NULL && lpData == NULL\n");
1691#endif
1692 return(FALSE);
1693 }
1694 if(nCount == 0)
1695 nCount = UniStrlen((UniChar*)lpData);
1696
1697 if(lpOutputFunc) {
1698 return(lpOutputFunc(hdc, lpData, nCount));
1699 }
1700 astring = UnicodeToAsciiString((LPWSTR)lpData);
1701
1702 curclr = SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
1703 rc = TextOutA(hdc, X, Y, astring, nCount);
1704 SetTextColor(hdc, curclr);
1705
1706 FreeAsciiString(astring);
1707 return(rc);
1708}
1709//******************************************************************************
1710//******************************************************************************
1711#if 0
1712BOOL WIN32API InvalidateRgn( HWND hWnd, HRGN hRgn, BOOL bErase)
1713{
1714#ifdef DEBUG
1715 WriteLog("USER32: InvalidateRgn\n");
1716#endif
1717 hWnd = Win32Window::Win32ToOS2Handle(hWnd);
1718
1719 return O32_InvalidateRgn(hWnd,hRgn,bErase);
1720}
1721#endif
1722/*****************************************************************************
1723 * Name : BOOL WIN32API PaintDesktop
1724 * Purpose : The PaintDesktop function fills the clipping region in the
1725 * specified device context with the desktop pattern or wallpaper.
1726 * The function is provided primarily for shell desktops.
1727 * Parameters:
1728 * Variables :
1729 * Result : If the function succeeds, the return value is TRUE.
1730 * If the function fails, the return value is FALSE.
1731 * Remark :
1732 * Status : UNTESTED STUB
1733 *
1734 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1735 *****************************************************************************/
1736BOOL WIN32API PaintDesktop(HDC hdc)
1737{
1738 dprintf(("USER32:PaintDesktop (%08x) not implemented.\n",
1739 hdc));
1740
1741 return (FALSE);
1742}
1743/*****************************************************************************
1744 * Name : int WIN32API SetWindowRgn
1745 * Purpose : The SetWindowRgn function sets the window region of a window. The
1746 * window region determines the area within the window where the
1747 * operating system permits drawing. The operating system does not
1748 * display any portion of a window that lies outside of the window region
1749 * Parameters: HWND hWnd handle to window whose window region is to be set
1750 * HRGN hRgn handle to region
1751 * BOOL bRedraw window redraw flag
1752 * Variables :
1753 * Result : If the function succeeds, the return value is non-zero.
1754 * If the function fails, the return value is zero.
1755 * Remark :
1756 * Status : UNTESTED STUB
1757 *
1758 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1759 *****************************************************************************/
1760
1761int WIN32API SetWindowRgn(HWND hWnd,
1762 HRGN hRgn,
1763 BOOL bRedraw)
1764{
1765 dprintf(("USER32:SetWindowRgn (%08xh,%08xh,%u) not implemented.\n",
1766 hWnd,
1767 hRgn,
1768 bRedraw));
1769 //Attention: Win32 hwnd handle!
1770
1771 return (0);
1772}
1773//******************************************************************************
1774//******************************************************************************
1775BOOL WIN32API ValidateRect( HWND hwnd, const RECT * lprc)
1776{
1777#ifdef DEBUG
1778 WriteLog("USER32: ValidateRect\n");
1779#endif
1780 hwnd = Win32Window::Win32ToOS2Handle(hwnd);
1781
1782 return O32_ValidateRect(hwnd,lprc);
1783}
1784//******************************************************************************
1785//******************************************************************************
1786BOOL WIN32API ValidateRgn( HWND hwnd, HRGN hrgn)
1787{
1788#ifdef DEBUG
1789 WriteLog("USER32: ValidateRgn\n");
1790#endif
1791 hwnd = Win32Window::Win32ToOS2Handle(hwnd);
1792
1793 return O32_ValidateRgn(hwnd,hrgn);
1794}
1795
1796/* Filled Shape Functions */
1797
1798
1799int WIN32API FillRect(HDC hDC, const RECT * lprc, HBRUSH hbr)
1800{
1801#ifdef DEBUG
1802 WriteLog("USER32: FillRect (%d,%d)(%d,%d) brush %X\n", lprc->left, lprc->top, lprc->right, lprc->bottom, hbr);
1803#endif
1804 return O32_FillRect(hDC,lprc,hbr);
1805}
1806//******************************************************************************
1807//******************************************************************************
1808int WIN32API FrameRect( HDC hDC, const RECT * lprc, HBRUSH hbr)
1809{
1810#ifdef DEBUG
1811 WriteLog("USER32: FrameRect\n");
1812#endif
1813 return O32_FrameRect(hDC,lprc,hbr);
1814}
1815//******************************************************************************
1816//******************************************************************************
1817BOOL WIN32API InvertRect( HDC hDC, const RECT * lprc)
1818{
1819#ifdef DEBUG
1820 WriteLog("USER32: InvertRect\n");
1821#endif
1822 return O32_InvertRect(hDC,lprc);
1823}
1824
1825/* System Information Functions */
1826
1827int WIN32API GetKeyboardType( int nTypeFlag)
1828{
1829#ifdef DEBUG
1830 WriteLog("USER32: GetKeyboardType\n");
1831#endif
1832 return O32_GetKeyboardType(nTypeFlag);
1833}
1834/*****************************************************************************
1835 * Name : HDESK WIN32API GetThreadDesktop
1836 * Purpose : The GetThreadDesktop function returns a handle to the desktop
1837 * associated with a specified thread.
1838 * Parameters: DWORD dwThreadId thread identifier
1839 * Variables :
1840 * Result : If the function succeeds, the return value is the handle of the
1841 * desktop associated with the specified thread.
1842 * Remark :
1843 * Status : UNTESTED STUB
1844 *
1845 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1846 *****************************************************************************/
1847HDESK WIN32API GetThreadDesktop(DWORD dwThreadId)
1848{
1849 dprintf(("USER32:GetThreadDesktop (%u) not implemented.\n",
1850 dwThreadId));
1851
1852 return (NULL);
1853}
1854
1855/* Message and Message Queue Functions */
1856
1857
1858/* Font and Text Functions */
1859
1860DWORD WIN32API GetTabbedTextExtentA( HDC hDC, LPCSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions)
1861{
1862 dprintf2(("USER32: GetTabbedTextExtentA %x %s", hDC, lpString));
1863 return O32_GetTabbedTextExtent(hDC,lpString,nCount,nTabPositions,lpnTabStopPositions);
1864}
1865//******************************************************************************
1866//******************************************************************************
1867DWORD WIN32API GetTabbedTextExtentW( HDC hDC, LPCWSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions)
1868{
1869 char *astring = UnicodeToAsciiString((LPWSTR)lpString);
1870 DWORD rc;
1871
1872 dprintf2(("USER32: GetTabbedTextExtentW %x %s", hDC, astring));
1873 rc = O32_GetTabbedTextExtent(hDC,astring,nCount,nTabPositions,lpnTabStopPositions);
1874 FreeAsciiString(astring);
1875 return rc;
1876}
1877//******************************************************************************
1878//******************************************************************************
1879LONG WIN32API TabbedTextOutA( HDC hdc, int x, int y, LPCSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin)
1880{
1881#ifdef DEBUG
1882 WriteLog("USER32: TabbedTextOutA\n");
1883#endif
1884 return O32_TabbedTextOut(hdc,x,y,lpString,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin);
1885}
1886//******************************************************************************
1887//******************************************************************************
1888LONG WIN32API TabbedTextOutW( HDC hdc, int x, int y, LPCWSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin)
1889{
1890 char *astring = UnicodeToAsciiString((LPWSTR)lpString);
1891 LONG rc;
1892
1893#ifdef DEBUG
1894 WriteLog("USER32: TabbedTextOutW\n");
1895#endif
1896 rc = O32_TabbedTextOut(hdc,x,y,astring,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin);
1897 FreeAsciiString(astring);
1898 return rc;
1899}
1900
1901/* Device Context Functions */
1902
1903
1904/* Window Station and Desktop Functions */
1905
1906/*****************************************************************************
1907 * Name : BOOL WIN32API CloseDesktop
1908 * Purpose : The CloseDesktop function closes an open handle of a desktop
1909 * object. A desktop is a secure object contained within a window
1910 * station object. A desktop has a logical display surface and
1911 * contains windows, menus and hooks.
1912 * Parameters: HDESK hDesktop
1913 * Variables :
1914 * Result : If the function succeeds, the return value is TRUE.
1915 * If the functions fails, the return value is FALSE. To get
1916 * extended error information, call GetLastError.
1917 * Remark :
1918 * Status : UNTESTED STUB
1919 *
1920 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1921 *****************************************************************************/
1922BOOL WIN32API CloseDesktop(HDESK hDesktop)
1923{
1924 dprintf(("USER32:CloseDesktop(%08x) not implemented.\n",
1925 hDesktop));
1926
1927 return (FALSE);
1928}
1929/*****************************************************************************
1930 * Name : BOOL WIN32API CloseWindowStation
1931 * Purpose : The CloseWindowStation function closes an open window station handle.
1932 * Parameters: HWINSTA hWinSta
1933 * Variables :
1934 * Result :
1935 * Remark : If the function succeeds, the return value is TRUE.
1936 * If the functions fails, the return value is FALSE. To get
1937 * extended error information, call GetLastError.
1938 * Status : UNTESTED STUB
1939 *
1940 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1941 *****************************************************************************/
1942BOOL WIN32API CloseWindowStation(HWINSTA hWinSta)
1943{
1944 dprintf(("USER32:CloseWindowStation(%08x) not implemented.\n",
1945 hWinSta));
1946
1947 return (FALSE);
1948}
1949/*****************************************************************************
1950 * Name : HDESK WIN32API CreateDesktopA
1951 * Purpose : The CreateDesktop function creates a new desktop on the window
1952 * station associated with the calling process.
1953 * Parameters: LPCTSTR lpszDesktop name of the new desktop
1954 * LPCTSTR lpszDevice name of display device to assign to the desktop
1955 * LPDEVMODE pDevMode reserved; must be NULL
1956 * DWORD dwFlags flags to control interaction with other applications
1957 * DWORD dwDesiredAccess specifies access of returned handle
1958 * LPSECURITY_ATTRIBUTES lpsa specifies security attributes of the desktop
1959 * Variables :
1960 * Result : If the function succeeds, the return value is a handle of the
1961 * newly created desktop.
1962 * If the function fails, the return value is NULL. To get extended
1963 * error information, call GetLastError.
1964 * Remark :
1965 * Status : UNTESTED STUB
1966 *
1967 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1968 *****************************************************************************/
1969HDESK WIN32API CreateDesktopA(LPCTSTR lpszDesktop,
1970 LPCTSTR lpszDevice,
1971 LPDEVMODEA pDevMode,
1972 DWORD dwFlags,
1973 DWORD dwDesiredAccess,
1974 LPSECURITY_ATTRIBUTES lpsa)
1975{
1976 dprintf(("USER32:CreateDesktopA(%s,%s,%08xh,%08xh,%08xh,%08x) not implemented.\n",
1977 lpszDesktop,
1978 lpszDevice,
1979 pDevMode,
1980 dwFlags,
1981 dwDesiredAccess,
1982 lpsa));
1983
1984 return (NULL);
1985}
1986/*****************************************************************************
1987 * Name : HDESK WIN32API CreateDesktopW
1988 * Purpose : The CreateDesktop function creates a new desktop on the window
1989 * station associated with the calling process.
1990 * Parameters: LPCTSTR lpszDesktop name of the new desktop
1991 * LPCTSTR lpszDevice name of display device to assign to the desktop
1992 * LPDEVMODE pDevMode reserved; must be NULL
1993 * DWORD dwFlags flags to control interaction with other applications
1994 * DWORD dwDesiredAccess specifies access of returned handle
1995 * LPSECURITY_ATTRIBUTES lpsa specifies security attributes of the desktop
1996 * Variables :
1997 * Result : If the function succeeds, the return value is a handle of the
1998 * newly created desktop.
1999 * If the function fails, the return value is NULL. To get extended
2000 * error information, call GetLastError.
2001 * Remark :
2002 * Status : UNTESTED STUB
2003 *
2004 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2005 *****************************************************************************/
2006HDESK WIN32API CreateDesktopW(LPCTSTR lpszDesktop,
2007 LPCTSTR lpszDevice,
2008 LPDEVMODEW pDevMode,
2009 DWORD dwFlags,
2010 DWORD dwDesiredAccess,
2011 LPSECURITY_ATTRIBUTES lpsa)
2012{
2013 dprintf(("USER32:CreateDesktopW(%s,%s,%08xh,%08xh,%08xh,%08x) not implemented.\n",
2014 lpszDesktop,
2015 lpszDevice,
2016 pDevMode,
2017 dwFlags,
2018 dwDesiredAccess,
2019 lpsa));
2020
2021 return (NULL);
2022}
2023/*****************************************************************************
2024 * Name : HWINSTA WIN32API CreateWindowStationA
2025 * Purpose : The CreateWindowStation function creates a window station object.
2026 * It returns a handle that can be used to access the window station.
2027 * A window station is a secure object that contains a set of global
2028 * atoms, a clipboard, and a set of desktop objects.
2029 * Parameters: LPTSTR lpwinsta name of the new window station
2030 * DWORD dwReserved reserved; must be NULL
2031 * DWORD dwDesiredAccess specifies access of returned handle
2032 * LPSECURITY_ATTRIBUTES lpsa specifies security attributes of the window station
2033 * Variables :
2034 * Result : If the function succeeds, the return value is the handle to the
2035 * newly created window station.
2036 * If the function fails, the return value is NULL. To get extended
2037 * error information, call GetLastError.
2038 * Remark :
2039 * Status : UNTESTED STUB
2040 *
2041 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2042 *****************************************************************************/
2043HWINSTA WIN32API CreateWindowStationA(LPTSTR lpWinSta,
2044 DWORD dwReserved,
2045 DWORD dwDesiredAccess,
2046 LPSECURITY_ATTRIBUTES lpsa)
2047{
2048 dprintf(("USER32:CreateWindowStationA(%s,%08xh,%08xh,%08x) not implemented.\n",
2049 lpWinSta,
2050 dwReserved,
2051 dwDesiredAccess,
2052 lpsa));
2053
2054 return (NULL);
2055}
2056/*****************************************************************************
2057 * Name : HWINSTA WIN32API CreateWindowStationW
2058 * Purpose : The CreateWindowStation function creates a window station object.
2059 * It returns a handle that can be used to access the window station.
2060 * A window station is a secure object that contains a set of global
2061 * atoms, a clipboard, and a set of desktop objects.
2062 * Parameters: LPTSTR lpwinsta name of the new window station
2063 * DWORD dwReserved reserved; must be NULL
2064 * DWORD dwDesiredAccess specifies access of returned handle
2065 * LPSECURITY_ATTRIBUTES lpsa specifies security attributes of the window station
2066 * Variables :
2067 * Result : If the function succeeds, the return value is the handle to the
2068 * newly created window station.
2069 * If the function fails, the return value is NULL. To get extended
2070 * error information, call GetLastError.
2071 * Remark :
2072 * Status : UNTESTED STUB
2073 *
2074 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2075 *****************************************************************************/
2076HWINSTA WIN32API CreateWindowStationW(LPWSTR lpWinSta,
2077 DWORD dwReserved,
2078 DWORD dwDesiredAccess,
2079 LPSECURITY_ATTRIBUTES lpsa)
2080{
2081 dprintf(("USER32:CreateWindowStationW(%s,%08xh,%08xh,%08x) not implemented.\n",
2082 lpWinSta,
2083 dwReserved,
2084 dwDesiredAccess,
2085 lpsa));
2086
2087 return (NULL);
2088}
2089/*****************************************************************************
2090 * Name : BOOL WIN32API EnumDesktopWindows
2091 * Purpose : The EnumDesktopWindows function enumerates all windows in a
2092 * desktop by passing the handle of each window, in turn, to an
2093 * application-defined callback function.
2094 * Parameters: HDESK hDesktop handle of desktop to enumerate
2095 * WNDENUMPROC lpfn points to application's callback function
2096 * LPARAM lParam 32-bit value to pass to the callback function
2097 * Variables :
2098 * Result : If the function succeeds, the return value is TRUE.
2099 * If the function fails, the return value is FALSE. To get
2100 * extended error information, call GetLastError.
2101 * Remark :
2102 * Status : UNTESTED STUB
2103 *
2104 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2105 *****************************************************************************/
2106BOOL WIN32API EnumDesktopWindows(HDESK hDesktop,
2107 WNDENUMPROC lpfn,
2108 LPARAM lParam)
2109{
2110 dprintf(("USER32:EnumDesktopWindows (%08xh,%08xh,%08x) not implemented.\n",
2111 hDesktop,
2112 lpfn,
2113 lParam));
2114
2115 return (FALSE);
2116}
2117/*****************************************************************************
2118 * Name : BOOL WIN32API EnumDesktopsA
2119 * Purpose : The EnumDesktops function enumerates all desktops in the window
2120 * station assigned to the calling process. The function does so by
2121 * passing the name of each desktop, in turn, to an application-
2122 * defined callback function.
2123 * Parameters: HWINSTA hwinsta handle of window station to enumerate
2124 * DESKTOPENUMPROC lpEnumFunc points to application's callback function
2125 * LPARAM lParam 32-bit value to pass to the callback function
2126 * Variables :
2127 * Result : If the function succeeds, the return value is TRUE.
2128 * If the function fails, the return value is FALSE. To get extended
2129 * error information, call GetLastError.
2130 * Remark :
2131 * Status : UNTESTED STUB
2132 *
2133 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2134 *****************************************************************************/
2135BOOL WIN32API EnumDesktopsA(HWINSTA hWinSta,
2136 DESKTOPENUMPROCA lpEnumFunc,
2137 LPARAM lParam)
2138{
2139 dprintf(("USER32:EnumDesktopsA (%08xh,%08xh,%08x) not implemented.\n",
2140 hWinSta,
2141 lpEnumFunc,
2142 lParam));
2143
2144 return (FALSE);
2145}
2146/*****************************************************************************
2147 * Name : BOOL WIN32API EnumDesktopsW
2148 * Purpose : The EnumDesktops function enumerates all desktops in the window
2149 * station assigned to the calling process. The function does so by
2150 * passing the name of each desktop, in turn, to an application-
2151 * defined callback function.
2152 * Parameters: HWINSTA hwinsta handle of window station to enumerate
2153 * DESKTOPENUMPROC lpEnumFunc points to application's callback function
2154 * LPARAM lParam 32-bit value to pass to the callback function
2155 * Variables :
2156 * Result : If the function succeeds, the return value is TRUE.
2157 * If the function fails, the return value is FALSE. To get extended
2158 * error information, call GetLastError.
2159 * Remark :
2160 * Status : UNTESTED STUB
2161 *
2162 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2163 *****************************************************************************/
2164BOOL WIN32API EnumDesktopsW(HWINSTA hWinSta,
2165 DESKTOPENUMPROCW lpEnumFunc,
2166 LPARAM lParam)
2167{
2168 dprintf(("USER32:EnumDesktopsW (%08xh,%08xh,%08x) not implemented.\n",
2169 hWinSta,
2170 lpEnumFunc,
2171 lParam));
2172
2173 return (FALSE);
2174}
2175/*****************************************************************************
2176 * Name : BOOL WIN32API EnumWindowStationsA
2177 * Purpose : The EnumWindowStations function enumerates all windowstations
2178 * in the system by passing the name of each window station, in
2179 * turn, to an application-defined callback function.
2180 * Parameters:
2181 * Variables : WINSTAENUMPROC lpEnumFunc points to application's callback function
2182 * LPARAM lParam 32-bit value to pass to the callback function
2183 * Result : If the function succeeds, the return value is TRUE.
2184 * If the function fails the return value is FALSE. To get extended
2185 * error information, call GetLastError.
2186 * Remark :
2187 * Status : UNTESTED STUB
2188 *
2189 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2190 *****************************************************************************/
2191BOOL WIN32API EnumWindowStationsA(WINSTAENUMPROCA lpEnumFunc,
2192 LPARAM lParam)
2193{
2194 dprintf(("USER32:EnumWindowStationsA (%08xh,%08x) not implemented.\n",
2195 lpEnumFunc,
2196 lParam));
2197
2198 return (FALSE);
2199}
2200/*****************************************************************************
2201 * Name : BOOL WIN32API EnumWindowStationsW
2202 * Purpose : The EnumWindowStations function enumerates all windowstations
2203 * in the system by passing the name of each window station, in
2204 * turn, to an application-defined callback function.
2205 * Parameters:
2206 * Variables : WINSTAENUMPROC lpEnumFunc points to application's callback function
2207 * LPARAM lParam 32-bit value to pass to the callback function
2208 * Result : If the function succeeds, the return value is TRUE.
2209 * If the function fails the return value is FALSE. To get extended
2210 * error information, call GetLastError.
2211 * Remark :
2212 * Status : UNTESTED STUB
2213 *
2214 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2215 *****************************************************************************/
2216BOOL WIN32API EnumWindowStationsW(WINSTAENUMPROCW lpEnumFunc,
2217 LPARAM lParam)
2218{
2219 dprintf(("USER32:EnumWindowStationsW (%08xh,%08x) not implemented.\n",
2220 lpEnumFunc,
2221 lParam));
2222
2223 return (FALSE);
2224}
2225/*****************************************************************************
2226 * Name : HWINSTA WIN32API GetProcessWindowStation
2227 * Purpose : The GetProcessWindowStation function returns a handle of the
2228 * window station associated with the calling process.
2229 * Parameters:
2230 * Variables :
2231 * Result : If the function succeeds, the return value is a handle of the
2232 * window station associated with the calling process.
2233 * If the function fails, the return value is NULL. This can occur
2234 * if the calling process is not an application written for Windows
2235 * NT. To get extended error information, call GetLastError.
2236 * Remark :
2237 * Status : UNTESTED STUB
2238 *
2239 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2240 *****************************************************************************/
2241HWINSTA WIN32API GetProcessWindowStation(VOID)
2242{
2243 dprintf(("USER32:GetProcessWindowStation () not implemented.\n"));
2244
2245 return (NULL);
2246}
2247/*****************************************************************************
2248 * Name : BOOL WIN32API GetUserObjectInformationA
2249 * Purpose : The GetUserObjectInformation function returns information about
2250 * a window station or desktop object.
2251 * Parameters: HANDLE hObj handle of object to get information for
2252 * int nIndex type of information to get
2253 * PVOID pvInfo points to buffer that receives the information
2254 * DWORD nLength size, in bytes, of pvInfo buffer
2255 * LPDWORD lpnLengthNeeded receives required size, in bytes, of pvInfo buffer
2256 * Variables :
2257 * Result : If the function succeeds, the return value is TRUE.
2258 * If the function fails, the return value is FALSE. To get extended
2259 * error information, call GetLastError.
2260 * Remark :
2261 * Status : UNTESTED STUB
2262 *
2263 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2264 *****************************************************************************/
2265BOOL WIN32API GetUserObjectInformationA(HANDLE hObj,
2266 int nIndex,
2267 PVOID pvInfo,
2268 DWORD nLength,
2269 LPDWORD lpnLengthNeeded)
2270{
2271 dprintf(("USER32:GetUserObjectInformationA (%08xh,%08xh,%08xh,%u,%08x) not implemented.\n",
2272 hObj,
2273 nIndex,
2274 pvInfo,
2275 nLength,
2276 lpnLengthNeeded));
2277
2278 return (FALSE);
2279}
2280/*****************************************************************************
2281 * Name : BOOL WIN32API GetUserObjectInformationW
2282 * Purpose : The GetUserObjectInformation function returns information about
2283 * a window station or desktop object.
2284 * Parameters: HANDLE hObj handle of object to get information for
2285 * int nIndex type of information to get
2286 * PVOID pvInfo points to buffer that receives the information
2287 * DWORD nLength size, in bytes, of pvInfo buffer
2288 * LPDWORD lpnLengthNeeded receives required size, in bytes, of pvInfo buffer
2289 * Variables :
2290 * Result : If the function succeeds, the return value is TRUE.
2291 * If the function fails, the return value is FALSE. To get extended
2292 * error information, call GetLastError.
2293 * Remark :
2294 * Status : UNTESTED STUB
2295 *
2296 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2297 *****************************************************************************/
2298BOOL WIN32API GetUserObjectInformationW(HANDLE hObj,
2299 int nIndex,
2300 PVOID pvInfo,
2301 DWORD nLength,
2302 LPDWORD lpnLengthNeeded)
2303{
2304 dprintf(("USER32:GetUserObjectInformationW (%08xh,%08xh,%08xh,%u,%08x) not implemented.\n",
2305 hObj,
2306 nIndex,
2307 pvInfo,
2308 nLength,
2309 lpnLengthNeeded));
2310
2311 return (FALSE);
2312}
2313/*****************************************************************************
2314 * Name : BOOL WIN32API GetUserObjectSecurity
2315 * Purpose : The GetUserObjectSecurity function retrieves security information
2316 * for the specified user object.
2317 * Parameters: HANDLE hObj handle of user object
2318 * SECURITY_INFORMATION * pSIRequested address of requested security information
2319 * LPSECURITY_DESCRIPTOR pSID address of security descriptor
2320 * DWORD nLength size of buffer for security descriptor
2321 * LPDWORD lpnLengthNeeded address of required size of buffer
2322 * Variables :
2323 * Result : If the function succeeds, the return value is TRUE.
2324 * If the function fails, the return value is FALSE. To get extended
2325 * error information, call GetLastError.
2326 * Remark :
2327 * Status : UNTESTED STUB
2328 *
2329 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2330 *****************************************************************************/
2331BOOL WIN32API GetUserObjectSecurity(HANDLE hObj,
2332 SECURITY_INFORMATION * pSIRequested,
2333 LPSECURITY_DESCRIPTOR pSID,
2334 DWORD nLength,
2335 LPDWORD lpnLengthNeeded)
2336{
2337 dprintf(("USER32:GetUserObjectSecurity (%08xh,%08xh,%08xh,%u,%08x) not implemented.\n",
2338 hObj,
2339 pSIRequested,
2340 pSID,
2341 nLength,
2342 lpnLengthNeeded));
2343
2344 return (FALSE);
2345}
2346/*****************************************************************************
2347 * Name : HDESK WIN32API OpenDesktopA
2348 * Purpose : The OpenDesktop function returns a handle to an existing desktop.
2349 * A desktop is a secure object contained within a window station
2350 * object. A desktop has a logical display surface and contains
2351 * windows, menus and hooks.
2352 * Parameters: LPCTSTR lpszDesktopName name of the desktop to open
2353 * DWORD dwFlags flags to control interaction with other applications
2354 * BOOL fInherit specifies whether returned handle is inheritable
2355 * DWORD dwDesiredAccess specifies access of returned handle
2356 * Variables :
2357 * Result : If the function succeeds, the return value is the handle to the
2358 * opened desktop.
2359 * If the function fails, the return value is NULL. To get extended
2360 * error information, call GetLastError.
2361 * Remark :
2362 * Status : UNTESTED STUB
2363 *
2364 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2365 *****************************************************************************/
2366HDESK WIN32API OpenDesktopA(LPCTSTR lpszDesktopName,
2367 DWORD dwFlags,
2368 BOOL fInherit,
2369 DWORD dwDesiredAccess)
2370{
2371 dprintf(("USER32:OpenDesktopA (%s,%08xh,%08xh,%08x) not implemented.\n",
2372 lpszDesktopName,
2373 dwFlags,
2374 fInherit,
2375 dwDesiredAccess));
2376
2377 return (NULL);
2378}
2379/*****************************************************************************
2380 * Name : HDESK WIN32API OpenDesktopW
2381 * Purpose : The OpenDesktop function returns a handle to an existing desktop.
2382 * A desktop is a secure object contained within a window station
2383 * object. A desktop has a logical display surface and contains
2384 * windows, menus and hooks.
2385 * Parameters: LPCTSTR lpszDesktopName name of the desktop to open
2386 * DWORD dwFlags flags to control interaction with other applications
2387 * BOOL fInherit specifies whether returned handle is inheritable
2388 * DWORD dwDesiredAccess specifies access of returned handle
2389 * Variables :
2390 * Result : If the function succeeds, the return value is the handle to the
2391 * opened desktop.
2392 * If the function fails, the return value is NULL. To get extended
2393 * error information, call GetLastError.
2394 * Remark :
2395 * Status : UNTESTED STUB
2396 *
2397 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2398 *****************************************************************************/
2399HDESK WIN32API OpenDesktopW(LPCTSTR lpszDesktopName,
2400 DWORD dwFlags,
2401 BOOL fInherit,
2402 DWORD dwDesiredAccess)
2403{
2404 dprintf(("USER32:OpenDesktopW (%s,%08xh,%08xh,%08x) not implemented.\n",
2405 lpszDesktopName,
2406 dwFlags,
2407 fInherit,
2408 dwDesiredAccess));
2409
2410 return (NULL);
2411}
2412/*****************************************************************************
2413 * Name : HDESK WIN32API OpenInputDesktop
2414 * Purpose : The OpenInputDesktop function returns a handle to the desktop
2415 * that receives user input. The input desktop is a desktop on the
2416 * window station associated with the logged-on user.
2417 * Parameters: DWORD dwFlags flags to control interaction with other applications
2418 * BOOL fInherit specifies whether returned handle is inheritable
2419 * DWORD dwDesiredAccess specifies access of returned handle
2420 * Variables :
2421 * Result : If the function succeeds, the return value is a handle of the
2422 * desktop that receives user input.
2423 * If the function fails, the return value is NULL. To get extended
2424 * error information, call GetLastError.
2425 * Remark :
2426 * Status : UNTESTED STUB
2427 *
2428 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2429 *****************************************************************************/
2430HDESK WIN32API OpenInputDesktop(DWORD dwFlags,
2431 BOOL fInherit,
2432 DWORD dwDesiredAccess)
2433{
2434 dprintf(("USER32:OpenInputDesktop (%08xh,%08xh,%08x) not implemented.\n",
2435 dwFlags,
2436 fInherit,
2437 dwDesiredAccess));
2438
2439 return (NULL);
2440}
2441/*****************************************************************************
2442 * Name : HWINSTA WIN32API OpenWindowStationA
2443 * Purpose : The OpenWindowStation function returns a handle to an existing
2444 * window station.
2445 * Parameters: LPCTSTR lpszWinStaName name of the window station to open
2446 * BOOL fInherit specifies whether returned handle is inheritable
2447 * DWORD dwDesiredAccess specifies access of returned handle
2448 * Variables :
2449 * Result : If the function succeeds, the return value is the handle to the
2450 * specified window station.
2451 * If the function fails, the return value is NULL. To get extended
2452 * error information, call GetLastError.
2453 * Remark :
2454 * Status : UNTESTED STUB
2455 *
2456 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2457 *****************************************************************************/
2458HWINSTA WIN32API OpenWindowStationA(LPCTSTR lpszWinStaName,
2459 BOOL fInherit,
2460 DWORD dwDesiredAccess)
2461{
2462 dprintf(("USER32:OpenWindowStatieonA (%s,%08xh,%08x) not implemented.\n",
2463 lpszWinStaName,
2464 fInherit,
2465 dwDesiredAccess));
2466
2467 return (NULL);
2468}
2469/*****************************************************************************
2470 * Name : HWINSTA WIN32API OpenWindowStationW
2471 * Purpose : The OpenWindowStation function returns a handle to an existing
2472 * window station.
2473 * Parameters: LPCTSTR lpszWinStaName name of the window station to open
2474 * BOOL fInherit specifies whether returned handle is inheritable
2475 * DWORD dwDesiredAccess specifies access of returned handle
2476 * Variables :
2477 * Result : If the function succeeds, the return value is the handle to the
2478 * specified window station.
2479 * If the function fails, the return value is NULL. To get extended
2480 * error information, call GetLastError.
2481
2482
2483 * Remark :
2484 * Status : UNTESTED STUB
2485 *
2486 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2487 *****************************************************************************/
2488HWINSTA WIN32API OpenWindowStationW(LPCTSTR lpszWinStaName,
2489 BOOL fInherit,
2490 DWORD dwDesiredAccess)
2491{
2492 dprintf(("USER32:OpenWindowStatieonW (%s,%08xh,%08x) not implemented.\n",
2493 lpszWinStaName,
2494 fInherit,
2495 dwDesiredAccess));
2496
2497 return (NULL);
2498}
2499/*****************************************************************************
2500 * Name : BOOL WIN32API SetProcessWindowStation
2501 * Purpose : The SetProcessWindowStation function assigns a window station
2502 * to the calling process. This enables the process to access
2503 * objects in the window station such as desktops, the clipboard,
2504 * and global atoms. All subsequent operations on the window station
2505 * use the access rights granted to hWinSta.
2506 * Parameters:
2507 * Variables :
2508 * Result : If the function succeeds, the return value is TRUE.
2509 * If the function fails, the return value is FALSE. To get extended
2510 * error information, call GetLastError.
2511 * Remark :
2512 * Status : UNTESTED STUB
2513 *
2514 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2515 *****************************************************************************/
2516BOOL WIN32API SetProcessWindowStation(HWINSTA hWinSta)
2517{
2518 dprintf(("USER32:SetProcessWindowStation (%08x) not implemented.\n",
2519 hWinSta));
2520
2521 return (FALSE);
2522}
2523/*****************************************************************************
2524 * Name : BOOL WIN32API SetThreadDesktop
2525 * Purpose : The SetThreadDesktop function assigns a desktop to the calling
2526 * thread. All subsequent operations on the desktop use the access
2527 * rights granted to hDesk.
2528 * Parameters: HDESK hDesk handle of the desktop to assign to this thread
2529 * Variables :
2530 * Result : If the function succeeds, the return value is TRUE.
2531 * If the function fails, the return value is FALSE. To get extended
2532 * error information, call GetLastError.
2533 * Remark :
2534 * Status : UNTESTED STUB
2535 *
2536 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2537 *****************************************************************************/
2538BOOL WIN32API SetThreadDesktop(HDESK hDesktop)
2539{
2540 dprintf(("USER32:SetThreadDesktop (%08x) not implemented.\n",
2541 hDesktop));
2542
2543 return (FALSE);
2544}
2545/*****************************************************************************
2546 * Name : BOOL WIN32API SetUserObjectInformationA
2547 * Purpose : The SetUserObjectInformation function sets information about a
2548 * window station or desktop object.
2549 * Parameters: HANDLE hObject handle of the object for which to set information
2550 * int nIndex type of information to set
2551 * PVOID lpvInfo points to a buffer that contains the information
2552 * DWORD cbInfo size, in bytes, of lpvInfo buffer
2553 * Variables :
2554 * Result : If the function succeeds, the return value is TRUE.
2555 * If the function fails the return value is FALSE. To get extended
2556 * error information, call GetLastError.
2557 * Remark :
2558 * Status : UNTESTED STUB
2559 *
2560 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2561 *****************************************************************************/
2562BOOL WIN32API SetUserObjectInformationA(HANDLE hObject,
2563 int nIndex,
2564 PVOID lpvInfo,
2565 DWORD cbInfo)
2566{
2567 dprintf(("USER32:SetUserObjectInformationA (%08xh,%u,%08xh,%08x) not implemented.\n",
2568 hObject,
2569 nIndex,
2570 lpvInfo,
2571 cbInfo));
2572
2573 return (FALSE);
2574}
2575/*****************************************************************************
2576 * Name : BOOL WIN32API SetUserObjectInformationW
2577 * Purpose : The SetUserObjectInformation function sets information about a
2578 * window station or desktop object.
2579 * Parameters: HANDLE hObject handle of the object for which to set information
2580 * int nIndex type of information to set
2581 * PVOID lpvInfo points to a buffer that contains the information
2582 * DWORD cbInfo size, in bytes, of lpvInfo buffer
2583 * Variables :
2584 * Result : If the function succeeds, the return value is TRUE.
2585 * If the function fails the return value is FALSE. To get extended
2586 * error information, call GetLastError.
2587 * Remark :
2588 * Status : UNTESTED STUB
2589 *
2590 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2591 *****************************************************************************/
2592BOOL WIN32API SetUserObjectInformationW(HANDLE hObject,
2593 int nIndex,
2594 PVOID lpvInfo,
2595 DWORD cbInfo)
2596{
2597 dprintf(("USER32:SetUserObjectInformationW (%08xh,%u,%08xh,%08x) not implemented.\n",
2598 hObject,
2599 nIndex,
2600 lpvInfo,
2601 cbInfo));
2602
2603 return (FALSE);
2604}
2605/*****************************************************************************
2606 * Name : BOOL WIN32API SetUserObjectSecurity
2607 * Purpose : The SetUserObjectSecurity function sets the security of a user
2608 * object. This can be, for example, a window or a DDE conversation
2609 * Parameters: HANDLE hObject handle of user object
2610 * SECURITY_INFORMATION * psi address of security information
2611 * LPSECURITY_DESCRIPTOR psd address of security descriptor
2612 * Variables :
2613 * Result : If the function succeeds, the return value is TRUE.
2614 * If the function fails, the return value is FALSE. To get extended
2615 * error information, call GetLastError.
2616 * Remark :
2617 * Status : UNTESTED STUB
2618 *
2619 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2620 *****************************************************************************/
2621BOOL WIN32API SetUserObjectSecurity(HANDLE hObject,
2622 SECURITY_INFORMATION * psi,
2623 LPSECURITY_DESCRIPTOR psd)
2624{
2625 dprintf(("USER32:SetUserObjectSecuroty (%08xh,%08xh,%08x) not implemented.\n",
2626 hObject,
2627 psi,
2628 psd));
2629
2630 return (FALSE);
2631}
2632/*****************************************************************************
2633 * Name : BOOL WIN32API SwitchDesktop
2634 * Purpose : The SwitchDesktop function makes a desktop visible and activates
2635 * it. This enables the desktop to receive input from the user. The
2636 * calling process must have DESKTOP_SWITCHDESKTOP access to the
2637 * desktop for the SwitchDesktop function to succeed.
2638 * Parameters:
2639 * Variables :
2640 * Result : If the function succeeds, the return value is TRUE.
2641 * If the function fails, the return value is FALSE. To get extended
2642 * error information, call GetLastError.
2643 * Remark :
2644 * Status : UNTESTED STUB
2645 *
2646 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2647 *****************************************************************************/
2648BOOL WIN32API SwitchDesktop(HDESK hDesktop)
2649{
2650 dprintf(("USER32:SwitchDesktop (%08x) not implemented.\n",
2651 hDesktop));
2652
2653 return (FALSE);
2654}
2655
2656/* Debugging Functions */
2657
2658/*****************************************************************************
2659 * Name : VOID WIN32API SetDebugErrorLevel
2660 * Purpose : The SetDebugErrorLevel function sets the minimum error level at
2661 * which Windows will generate debugging events and pass them to a debugger.
2662 * Parameters: DWORD dwLevel debugging error level
2663 * Variables :
2664 * Result :
2665 * Remark :
2666 * Status : UNTESTED STUB
2667 *
2668 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2669 *****************************************************************************/
2670VOID WIN32API SetDebugErrorLevel(DWORD dwLevel)
2671{
2672 dprintf(("USER32:SetDebugErrorLevel (%08x) not implemented.\n",
2673 dwLevel));
2674}
2675
2676/* Hook Functions */
2677
2678/*****************************************************************************
2679 * Name : BOOL WIN32API SetWindowsHookW
2680 * Purpose : The SetWindowsHook function is not implemented in the Win32 API.
2681 * Win32-based applications should use the SetWindowsHookEx function.
2682 * Parameters:
2683 * Variables :
2684 * Result :
2685 * Remark : ARGH ! MICROSOFT !
2686 * Status : UNTESTED STUB
2687 *
2688 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2689 *****************************************************************************/
2690HHOOK WIN32API SetWindowsHookW(int nFilterType, HOOKPROC pfnFilterProc)
2691
2692{
2693 return (FALSE);
2694}
2695
2696/* CB: move to ShowWindow() */
2697
2698/*****************************************************************************
2699 * Name : BOOL WIN32API ShowWindowAsync
2700 * Purpose : The ShowWindowAsync function sets the show state of a window
2701 * created by a different thread.
2702 * Parameters: HWND hwnd handle of window
2703 * int nCmdShow show state of window
2704 * Variables :
2705 * Result : If the window was previously visible, the return value is TRUE.
2706 * If the window was previously hidden, the return value is FALSE.
2707 * Remark :
2708 * Status : UNTESTED STUB
2709 *
2710 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2711 *****************************************************************************/
2712BOOL WIN32API ShowWindowAsync (HWND hWnd,
2713 int nCmdShow)
2714{
2715 dprintf(("USER32:ShowWindowAsync (%08xh,%08x) not implemented.\n",
2716 hWnd,
2717 nCmdShow));
2718
2719 return (FALSE);
2720}
2721
2722/* CB: move to MDI */
2723
2724/*****************************************************************************
2725 * Name : WORD WIN32API TileWindows
2726 * Purpose : The TileWindows function tiles the specified windows, or the child
2727 * windows of the specified parent window.
2728 * Parameters: HWND hwndParent handle of parent window
2729 * WORD wFlags types of windows not to arrange
2730 * LPCRECT lpRect rectangle to arrange windows in
2731 * WORD cChildrenb number of windows to arrange
2732 * const HWND *ahwndChildren array of window handles
2733 * Variables :
2734 * Result : If the function succeeds, the return value is the number of
2735 * windows arranged.
2736 * If the function fails, the return value is zero.
2737 * Remark :
2738 * Status : UNTESTED STUB
2739 *
2740 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2741 *****************************************************************************/
2742WORD WIN32API TileWindows(HWND hwndParent,
2743 UINT wFlags,
2744 const LPRECT lpRect,
2745 UINT cChildrenb,
2746 const HWND *ahwndChildren)
2747{
2748 dprintf(("USER32:TileWindows (%08xh,%08xh,%08xh,%08xh,%08x) not implemented.\n",
2749 hwndParent,
2750 wFlags,
2751 lpRect,
2752 cChildrenb,
2753 ahwndChildren));
2754
2755 return (0);
2756}
2757/*****************************************************************************
2758 * Name : BOOL WIN32API TileChildWindows
2759 * Purpose : Unknown
2760 * Parameters: Unknown
2761 * Variables :
2762 * Result :
2763 * Remark :
2764 * Status : UNTESTED UNKNOWN STUB
2765 *
2766 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2767 *****************************************************************************/
2768BOOL WIN32API TileChildWindows(DWORD x1,
2769 DWORD x2)
2770{
2771 dprintf(("USER32: TileChildWindows(%08xh,%08xh) not implemented.\n",
2772 x1,
2773 x2));
2774
2775 return (FALSE); /* default */
2776}
2777/*****************************************************************************
2778 * Name : BOOL WIN32API CascadeChildWindows
2779 * Purpose : Unknown
2780 * Parameters: Unknown
2781 * Variables :
2782 * Result :
2783 * Remark :
2784 * Status : UNTESTED UNKNOWN STUB
2785 *
2786 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2787 *****************************************************************************/
2788BOOL WIN32API CascadeChildWindows(DWORD x1,
2789 DWORD x2)
2790{
2791 dprintf(("USER32: CascadeChildWindows(%08xh,%08xh) not implemented.\n",
2792 x1,
2793 x2));
2794
2795 return (FALSE); /* default */
2796}
2797
2798/* Drag'n'drop */
2799
2800/*****************************************************************************
2801 * Name : BOOL WIN32API DragObject
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 *****************************************************************************/
2811DWORD WIN32API DragObject(HWND x1,HWND x2,UINT x3,DWORD x4,HCURSOR x5)
2812{
2813 dprintf(("USER32: DragObject(%08x,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
2814 x1,
2815 x2,
2816 x3,
2817 x4,
2818 x5));
2819
2820 return (FALSE); /* default */
2821}
2822
2823/* Unknown */
2824
2825/*****************************************************************************
2826 * Name : BOOL WIN32API SetShellWindow
2827 * Purpose : Unknown
2828 * Parameters: Unknown
2829 * Variables :
2830 * Result :
2831 * Remark :
2832 * Status : UNTESTED UNKNOWN STUB
2833 *
2834 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2835 *****************************************************************************/
2836BOOL WIN32API SetShellWindow(DWORD x1)
2837{
2838 dprintf(("USER32: SetShellWindow(%08x) not implemented.\n",
2839 x1));
2840
2841 return (FALSE); /* default */
2842}
2843/*****************************************************************************
2844 * Name : BOOL WIN32API PlaySoundEvent
2845 * Purpose : Unknown
2846 * Parameters: Unknown
2847 * Variables :
2848 * Result :
2849 * Remark :
2850 * Status : UNTESTED UNKNOWN STUB
2851 *
2852 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2853 *****************************************************************************/
2854BOOL WIN32API PlaySoundEvent(DWORD x1)
2855{
2856 dprintf(("USER32: PlaySoundEvent(%08x) not implemented.\n",
2857 x1));
2858
2859 return (FALSE); /* default */
2860}
2861/*****************************************************************************
2862 * Name : BOOL WIN32API SetSysColorsTemp
2863 * Purpose : Unknown
2864 * Parameters: Unknown
2865 * Variables :
2866 * Result :
2867 * Remark :
2868 * Status : UNTESTED UNKNOWN STUB
2869 *
2870 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2871 *****************************************************************************/
2872BOOL WIN32API SetSysColorsTemp(void)
2873{
2874 dprintf(("USER32: SetSysColorsTemp() not implemented.\n"));
2875
2876 return (FALSE); /* default */
2877}
2878/*****************************************************************************
2879 * Name : BOOL WIN32API RegisterNetworkCapabilities
2880 * Purpose : Unknown
2881 * Parameters: Unknown
2882 * Variables :
2883 * Result :
2884 * Remark :
2885 * Status : UNTESTED UNKNOWN STUB
2886 *
2887 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2888 *****************************************************************************/
2889BOOL WIN32API RegisterNetworkCapabilities(DWORD x1,
2890 DWORD x2)
2891{
2892 dprintf(("USER32: RegisterNetworkCapabilities(%08xh,%08xh) not implemented.\n",
2893 x1,
2894 x2));
2895
2896 return (FALSE); /* default */
2897}
2898/*****************************************************************************
2899 * Name : BOOL WIN32API EndTask
2900 * Purpose : Unknown
2901 * Parameters: Unknown
2902 * Variables :
2903 * Result :
2904 * Remark :
2905 * Status : UNTESTED UNKNOWN STUB
2906 *
2907 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2908 *****************************************************************************/
2909BOOL WIN32API EndTask(DWORD x1,
2910 DWORD x2,
2911 DWORD x3)
2912{
2913 dprintf(("USER32: EndTask(%08xh,%08xh,%08xh) not implemented.\n",
2914 x1,
2915 x2,
2916 x3));
2917
2918 return (FALSE); /* default */
2919}
2920/*****************************************************************************
2921 * Name : BOOL WIN32API GetNextQueueWindow
2922 * Purpose : Unknown
2923 * Parameters: Unknown
2924 * Variables :
2925 * Result :
2926 * Remark :
2927 * Status : UNTESTED UNKNOWN STUB
2928 *
2929 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2930 *****************************************************************************/
2931BOOL WIN32API GetNextQueueWindow(DWORD x1,
2932 DWORD x2)
2933{
2934 dprintf(("USER32: GetNextQueueWindow(%08xh,%08xh) not implemented.\n",
2935 x1,
2936 x2));
2937
2938 return (FALSE); /* default */
2939}
2940/*****************************************************************************
2941 * Name : BOOL WIN32API YieldTask
2942 * Purpose : Unknown
2943 * Parameters: Unknown
2944 * Variables :
2945 * Result :
2946 * Remark :
2947 * Status : UNTESTED UNKNOWN STUB
2948 *
2949 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2950 *****************************************************************************/
2951BOOL WIN32API YieldTask(void)
2952{
2953 dprintf(("USER32: YieldTask() not implemented.\n"));
2954
2955 return (FALSE); /* default */
2956}
2957/*****************************************************************************
2958 * Name : BOOL WIN32API WinOldAppHackoMatic
2959 * Purpose : Unknown
2960 * Parameters: Unknown
2961 * Variables :
2962 * Result :
2963 * Remark :
2964 * Status : UNTESTED UNKNOWN STUB
2965 *
2966 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2967 *****************************************************************************/
2968BOOL WIN32API WinOldAppHackoMatic(DWORD x1)
2969{
2970 dprintf(("USER32: WinOldAppHackoMatic(%08x) not implemented.\n",
2971 x1));
2972
2973 return (FALSE); /* default */
2974}
2975/*****************************************************************************
2976 * Name : BOOL WIN32API RegisterSystemThread
2977 * Purpose : Unknown
2978 * Parameters: Unknown
2979 * Variables :
2980 * Result :
2981 * Remark :
2982 * Status : UNTESTED UNKNOWN STUB
2983 *
2984 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
2985 *****************************************************************************/
2986BOOL WIN32API RegisterSystemThread(DWORD x1,
2987 DWORD x2)
2988{
2989 dprintf(("USER32: RegisterSystemThread(%08xh,%08xh) not implemented.\n",
2990 x1,
2991 x2));
2992
2993 return (FALSE); /* default */
2994}
2995/*****************************************************************************
2996 * Name : BOOL WIN32API IsHungThread
2997 * Purpose : Unknown
2998 * Parameters: Unknown
2999 * Variables :
3000 * Result :
3001 * Remark :
3002 * Status : UNTESTED UNKNOWN STUB
3003 *
3004 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3005 *****************************************************************************/
3006BOOL WIN32API IsHungThread(DWORD x1)
3007{
3008 dprintf(("USER32: IsHungThread(%08xh) not implemented.\n",
3009 x1));
3010
3011 return (FALSE); /* default */
3012}
3013/*****************************************************************************
3014 * Name : BOOL WIN32API UserSignalProc
3015 * Purpose : Unknown
3016 * Parameters: Unknown
3017 * Variables :
3018 * Result :
3019 * Remark :
3020 * Status : UNTESTED UNKNOWN STUB
3021 *
3022 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3023 *****************************************************************************/
3024BOOL WIN32API UserSignalProc(DWORD x1,
3025 DWORD x2,
3026 DWORD x3,
3027 DWORD x4)
3028{
3029 dprintf(("USER32: SysErrorBox(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
3030 x1,
3031 x2,
3032 x3,
3033 x4));
3034
3035 return (FALSE); /* default */
3036}
3037/*****************************************************************************
3038 * Name : BOOL WIN32API GetShellWindow
3039 * Purpose : Unknown
3040 * Parameters: Unknown
3041 * Variables :
3042 * Result :
3043 * Remark :
3044 * Status : UNTESTED UNKNOWN STUB
3045 *
3046 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3047 *****************************************************************************/
3048HWND WIN32API GetShellWindow(void)
3049{
3050 dprintf(("USER32: GetShellWindow() not implemented.\n"));
3051
3052 return (0); /* default */
3053}
3054/***********************************************************************
3055 * RegisterTasklist32 [USER32.436]
3056 */
3057DWORD WIN32API RegisterTasklist (DWORD x)
3058{
3059 dprintf(("USER32: RegisterTasklist(%08xh) not implemented.\n",
3060 x));
3061
3062 return TRUE;
3063}
3064
3065
Note: See TracBrowser for help on using the repository browser.