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

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

GetSystemMetrics, timer and scrollbar fixes

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