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

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

Fix: ExitWindowsEx with confirmation dialog

File size: 132.4 KB
Line 
1/* $Id: user32.cpp,v 1.45 1999-10-20 13:48:07 phaller Exp $ */
2
3/*
4 * Win32 misc user32 API functions for OS/2
5 *
6 * Copyright 1998 Sander van Leeuwen
7 * Copyright 1998 Patrick Haller
8 * Copyright 1998 Peter Fitzsimmons
9 * Copyright 1999 Christoph Bratschi
10 * Copyright 1999 Daniela Engert (dani@ngrt.de)
11 *
12 *
13 * Project Odin Software License can be found in LICENSE.TXT
14 *
15 */
16/*****************************************************************************
17 * Name : USER32.CPP
18 * Purpose : This module maps all Win32 functions contained in USER32.DLL
19 * to their OS/2-specific counterparts as far as possible.
20 *****************************************************************************/
21
22//Attention: many functions belong to other subsystems, move them to their
23// right place!
24
25#include <odin.h>
26#include <odinwrap.h>
27#include <os2sel.h>
28
29#include <os2win.h>
30#include "misc.h"
31
32#include "user32.h"
33#include <winicon.h>
34#include "syscolor.h"
35
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_CMETRICS:
954 //CB: replace with const
955 rc = O32_GetSystemMetrics(44); //Open32 changed this one
956 break;
957 default:
958 //better than nothing
959 rc = O32_GetSystemMetrics(nIndex);
960 break;
961 }
962#ifdef DEBUG
963 WriteLog("USER32: GetSystemMetrics %d returned %d\n", nIndex, rc);
964#endif
965 return(rc);
966}
967//******************************************************************************
968/* Not support by Open32 (not included are the new win9x parameters):
969 case SPI_GETFASTTASKSWITCH:
970 case SPI_GETGRIDGRANULARITY:
971 case SPI_GETICONTITLELOGFONT:
972 case SPI_GETICONTITLEWRAP:
973 case SPI_GETMENUDROPALIGNMENT:
974 case SPI_ICONHORIZONTALSPACING:
975 case SPI_ICONVERTICALSPACING:
976 case SPI_LANGDRIVER:
977 case SPI_SETFASTTASKSWITCH:
978 case SPI_SETGRIDGRANULARITY:
979 case SPI_SETICONTITLELOGFONT:
980 case SPI_SETICONTITLEWRAP:
981 case SPI_SETMENUDROPALIGNMENT:
982 case SPI_GETSCREENSAVEACTIVE:
983 case SPI_GETSCREENSAVETIMEOUT:
984 case SPI_SETDESKPATTERN:
985 case SPI_SETDESKWALLPAPER:
986 case SPI_SETSCREENSAVEACTIVE:
987 case SPI_SETSCREENSAVETIMEOUT:
988*/
989//******************************************************************************
990BOOL WIN32API SystemParametersInfoA(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
991{
992 BOOL rc = TRUE;
993 NONCLIENTMETRICSA *cmetric = (NONCLIENTMETRICSA *)pvParam;
994
995 switch(uiAction) {
996 case SPI_SCREENSAVERRUNNING:
997 *(BOOL *)pvParam = FALSE;
998 break;
999 case SPI_GETDRAGFULLWINDOWS:
1000 *(BOOL *)pvParam = FALSE;
1001 break;
1002 case SPI_GETNONCLIENTMETRICS:
1003 memset(cmetric, 0, sizeof(NONCLIENTMETRICSA));
1004 cmetric->cbSize = sizeof(NONCLIENTMETRICSA);
1005
1006 //CB: fonts not handled by Open32, set to WarpSans
1007 lstrcpyA(cmetric->lfCaptionFont.lfFaceName,"WarpSans");
1008 cmetric->lfCaptionFont.lfHeight = 9;
1009
1010 lstrcpyA(cmetric->lfMenuFont.lfFaceName,"WarpSans");
1011 cmetric->lfMenuFont.lfHeight = 9;
1012
1013 lstrcpyA(cmetric->lfStatusFont.lfFaceName,"WarpSans");
1014 cmetric->lfStatusFont.lfHeight = 9;
1015
1016 lstrcpyA(cmetric->lfMessageFont.lfFaceName,"WarpSans");
1017 cmetric->lfMessageFont.lfHeight = 9;
1018
1019 cmetric->iBorderWidth = GetSystemMetrics(SM_CXBORDER);
1020 cmetric->iScrollWidth = GetSystemMetrics(SM_CXHSCROLL);
1021 cmetric->iScrollHeight = GetSystemMetrics(SM_CYHSCROLL);
1022 cmetric->iCaptionWidth = 32; //TODO
1023 cmetric->iCaptionHeight = 16; //TODO
1024 cmetric->iSmCaptionWidth = GetSystemMetrics(SM_CXSMSIZE);
1025 cmetric->iSmCaptionHeight = GetSystemMetrics(SM_CYSMSIZE);
1026 cmetric->iMenuWidth = 32; //TODO
1027 cmetric->iMenuHeight = GetSystemMetrics(SM_CYMENU);
1028 break;
1029 case SPI_GETICONTITLELOGFONT:
1030 {
1031 LPLOGFONTA lpLogFont = (LPLOGFONTA)pvParam;
1032
1033 /* from now on we always have an alias for MS Sans Serif */
1034 strcpy(lpLogFont->lfFaceName, "MS Sans Serif");
1035 lpLogFont->lfHeight = -GetProfileIntA("Desktop","IconTitleSize", 8);
1036 lpLogFont->lfWidth = 0;
1037 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
1038 lpLogFont->lfWeight = FW_NORMAL;
1039 lpLogFont->lfItalic = FALSE;
1040 lpLogFont->lfStrikeOut = FALSE;
1041 lpLogFont->lfUnderline = FALSE;
1042 lpLogFont->lfCharSet = ANSI_CHARSET;
1043 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
1044 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
1045 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
1046 break;
1047 }
1048 case SPI_GETBORDER:
1049 *(INT *)pvParam = GetSystemMetrics( SM_CXFRAME );
1050 break;
1051
1052 case SPI_GETWORKAREA:
1053 SetRect( (RECT *)pvParam, 0, 0,
1054 GetSystemMetrics( SM_CXSCREEN ),
1055 GetSystemMetrics( SM_CYSCREEN )
1056 );
1057 break;
1058
1059 case 104: //TODO: Undocumented
1060 rc = 16;
1061 break;
1062 default:
1063 rc = O32_SystemParametersInfo(uiAction, uiParam, pvParam, fWinIni);
1064 break;
1065 }
1066#ifdef DEBUG
1067 WriteLog("USER32: SystemParametersInfoA %d, returned %d\n", uiAction, rc);
1068#endif
1069 return(rc);
1070}
1071//******************************************************************************
1072//TODO: Check for more options that have different structs for Unicode!!!!
1073//******************************************************************************
1074BOOL WIN32API SystemParametersInfoW(UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni)
1075{
1076 BOOL rc;
1077 NONCLIENTMETRICSW *clientMetricsW = (NONCLIENTMETRICSW *)pvParam;
1078 NONCLIENTMETRICSA clientMetricsA = {0};
1079 PVOID pvParamA;
1080 UINT uiParamA;
1081
1082 switch(uiAction) {
1083 case SPI_SETNONCLIENTMETRICS:
1084 clientMetricsA.cbSize = sizeof(NONCLIENTMETRICSA);
1085 clientMetricsA.iBorderWidth = clientMetricsW->iBorderWidth;
1086 clientMetricsA.iScrollWidth = clientMetricsW->iScrollWidth;
1087 clientMetricsA.iScrollHeight = clientMetricsW->iScrollHeight;
1088 clientMetricsA.iCaptionWidth = clientMetricsW->iCaptionWidth;
1089 clientMetricsA.iCaptionHeight = clientMetricsW->iCaptionHeight;
1090 ConvertFontWA(&clientMetricsW->lfCaptionFont, &clientMetricsA.lfCaptionFont);
1091 clientMetricsA.iSmCaptionWidth = clientMetricsW->iSmCaptionWidth;
1092 clientMetricsA.iSmCaptionHeight = clientMetricsW->iSmCaptionHeight;
1093 ConvertFontWA(&clientMetricsW->lfSmCaptionFont, &clientMetricsA.lfSmCaptionFont);
1094 clientMetricsA.iMenuWidth = clientMetricsW->iMenuWidth;
1095 clientMetricsA.iMenuHeight = clientMetricsW->iMenuHeight;
1096 ConvertFontWA(&clientMetricsW->lfMenuFont, &clientMetricsA.lfMenuFont);
1097 ConvertFontWA(&clientMetricsW->lfStatusFont, &clientMetricsA.lfStatusFont);
1098 ConvertFontWA(&clientMetricsW->lfMessageFont, &clientMetricsA.lfMessageFont);
1099 //no break
1100 case SPI_GETNONCLIENTMETRICS:
1101 uiParamA = sizeof(NONCLIENTMETRICSA);
1102 pvParamA = &clientMetricsA;
1103 break;
1104 case SPI_GETICONTITLELOGFONT:
1105 {
1106 LPLOGFONTW lpLogFont = (LPLOGFONTW)pvParam;
1107
1108 /* from now on we always have an alias for MS Sans Serif */
1109 lstrcpyW(lpLogFont->lfFaceName, (LPCWSTR)L"MS Sans Serif");
1110 lpLogFont->lfHeight = -GetProfileIntA("Desktop","IconTitleSize", 8);
1111 lpLogFont->lfWidth = 0;
1112 lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
1113 lpLogFont->lfWeight = FW_NORMAL;
1114 lpLogFont->lfItalic = FALSE;
1115 lpLogFont->lfStrikeOut = FALSE;
1116 lpLogFont->lfUnderline = FALSE;
1117 lpLogFont->lfCharSet = ANSI_CHARSET;
1118 lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
1119 lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
1120 lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
1121 return TRUE;
1122 }
1123 default:
1124 pvParamA = pvParam;
1125 uiParamA = uiParam;
1126 break;
1127 }
1128 rc = SystemParametersInfoA(uiAction, uiParamA, pvParamA, fWinIni);
1129
1130 switch(uiAction) {
1131 case SPI_GETNONCLIENTMETRICS:
1132 clientMetricsW->cbSize = sizeof(*clientMetricsW);
1133 clientMetricsW->iBorderWidth = clientMetricsA.iBorderWidth;
1134 clientMetricsW->iScrollWidth = clientMetricsA.iScrollWidth;
1135 clientMetricsW->iScrollHeight = clientMetricsA.iScrollHeight;
1136 clientMetricsW->iCaptionWidth = clientMetricsA.iCaptionWidth;
1137 clientMetricsW->iCaptionHeight = clientMetricsA.iCaptionHeight;
1138 ConvertFontAW(&clientMetricsA.lfCaptionFont, &clientMetricsW->lfCaptionFont);
1139
1140 clientMetricsW->iSmCaptionWidth = clientMetricsA.iSmCaptionWidth;
1141 clientMetricsW->iSmCaptionHeight = clientMetricsA.iSmCaptionHeight;
1142 ConvertFontAW(&clientMetricsA.lfSmCaptionFont, &clientMetricsW->lfSmCaptionFont);
1143
1144 clientMetricsW->iMenuWidth = clientMetricsA.iMenuWidth;
1145 clientMetricsW->iMenuHeight = clientMetricsA.iMenuHeight;
1146 ConvertFontAW(&clientMetricsA.lfMenuFont, &clientMetricsW->lfMenuFont);
1147 ConvertFontAW(&clientMetricsA.lfStatusFont, &clientMetricsW->lfStatusFont);
1148 ConvertFontAW(&clientMetricsA.lfMessageFont, &clientMetricsW->lfMessageFont);
1149 break;
1150 }
1151#ifdef DEBUG
1152 WriteLog("USER32: SystemParametersInfoW %d, returned %d\n", uiAction, rc);
1153#endif
1154 return(rc);
1155}
1156
1157/* Timer Functions */
1158
1159#if 0
1160BOOL WIN32API KillTimer(HWND hWnd, UINT uIDEvent)
1161{
1162#ifdef DEBUG
1163 WriteLog("USER32: KillTimer\n");
1164#endif
1165 hWnd = Win32Window::Win32ToOS2Handle(hWnd);
1166 //WinStopTimer
1167 //CB: replace
1168 return O32_KillTimer(hWnd,uIDEvent);
1169}
1170//******************************************************************************
1171//******************************************************************************
1172UINT WIN32API SetTimer( HWND hwnd, UINT idTimer, UINT uTimeout, TIMERPROC tmprc)
1173{
1174#ifdef DEBUG
1175 WriteLog("USER32: SetTimer INCORRECT CALLING CONVENTION FOR HANDLER!!!!!\n");
1176#endif
1177 hwnd = Win32Window::Win32ToOS2Handle(hwnd);
1178 //SvL: Write callback handler class for this one
1179 //CB: replace
1180 return O32_SetTimer(hwnd,idTimer,uTimeout,(TIMERPROC_O32)tmprc);
1181}
1182#endif
1183
1184/* Process and Thread Functions */
1185
1186//******************************************************************************
1187//DWORD idAttach; /* thread to attach */
1188//DWORD idAttachTo; /* thread to attach to */
1189//BOOL fAttach; /* attach or detach */
1190//******************************************************************************
1191BOOL WIN32API AttachThreadInput(DWORD idAttach, DWORD idAttachTo, BOOL fAttach)
1192{
1193#ifdef DEBUG
1194 WriteLog("USER32: AttachThreadInput, not implemented\n");
1195#endif
1196 return(TRUE);
1197}
1198//******************************************************************************
1199//TODO:How can we emulate this one in OS/2???
1200//******************************************************************************
1201DWORD WIN32API WaitForInputIdle(HANDLE hProcess, DWORD dwTimeOut)
1202{
1203#ifdef DEBUG
1204 WriteLog("USER32: WaitForInputIdle (Not Implemented) %d\n", dwTimeOut);
1205#endif
1206
1207 if(dwTimeOut == INFINITE) return(0);
1208
1209// DosSleep(dwTimeOut/16);
1210 return(0);
1211}
1212
1213/* Help Functions */
1214
1215DWORD WIN32API GetWindowContextHelpId(HWND hwnd)
1216{
1217#ifdef DEBUG
1218 WriteLog("USER32: GetWindowContextHelpId, not implemented\n");
1219#endif
1220 hwnd = Win32Window::Win32ToOS2Handle(hwnd);
1221
1222 return(0);
1223}
1224//******************************************************************************
1225//******************************************************************************
1226BOOL WIN32API SetWindowContextHelpId(HWND hwnd, DWORD dwContextHelpId)
1227{
1228#ifdef DEBUG
1229 WriteLog("USER32: SetWindowContextHelpId, not implemented\n");
1230#endif
1231 hwnd = Win32Window::Win32ToOS2Handle(hwnd);
1232
1233 return(TRUE);
1234}
1235//******************************************************************************
1236//******************************************************************************
1237BOOL WIN32API WinHelpA( HWND hwnd, LPCSTR lpszHelp, UINT uCommand, DWORD dwData)
1238{
1239#ifdef DEBUG
1240 WriteLog("USER32: WinHelp not implemented %s\n", lpszHelp);
1241#endif
1242// hwnd = Win32Window::Win32ToOS2Handle(hwnd);
1243// return O32_WinHelp(arg1, arg2, arg3, arg4);
1244
1245 return(TRUE);
1246}
1247//******************************************************************************
1248//******************************************************************************
1249BOOL WIN32API WinHelpW( HWND arg1, LPCWSTR arg2, UINT arg3, DWORD arg4)
1250{
1251 char *astring = UnicodeToAsciiString((LPWSTR)arg2);
1252 BOOL rc;
1253
1254#ifdef DEBUG
1255 WriteLog("USER32: WinHelpW\n");
1256#endif
1257 rc = WinHelpA(arg1, astring, arg3, arg4);
1258 FreeAsciiString(astring);
1259 return rc;
1260}
1261
1262/* Keyboard and Input Functions */
1263
1264BOOL WIN32API ActivateKeyboardLayout(HKL hkl, UINT fuFlags)
1265{
1266#ifdef DEBUG
1267 WriteLog("USER32: ActivateKeyboardLayout, not implemented\n");
1268#endif
1269 return(TRUE);
1270}
1271//******************************************************************************
1272//SvL: 24-6-'97 - Added
1273//TODO: Not implemented
1274//******************************************************************************
1275WORD WIN32API GetAsyncKeyState(INT nVirtKey)
1276{
1277#ifdef DEBUG
1278//// WriteLog("USER32: GetAsyncKeyState Not implemented\n");
1279#endif
1280 return 0;
1281}
1282/*****************************************************************************
1283 * Name : UINT WIN32API GetKBCodePage
1284 * Purpose : The GetKBCodePage function is provided for compatibility with
1285 * earlier versions of Windows. In the Win32 application programming
1286 * interface (API) it just calls the GetOEMCP function.
1287 * Parameters:
1288 * Variables :
1289 * Result : If the function succeeds, the return value is an OEM code-page
1290 * identifier, or it is the default identifier if the registry
1291 * value is not readable. For a list of OEM code-page identifiers,
1292 * see GetOEMCP.
1293 * Remark :
1294 * Status : UNTESTED
1295 *
1296 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1297 *****************************************************************************/
1298
1299UINT WIN32API GetKBCodePage(VOID)
1300{
1301 return (GetOEMCP());
1302}
1303/*****************************************************************************
1304 * Name : BOOL WIN32API GetKeyboardLayoutNameA
1305 * Purpose : The GetKeyboardLayoutName function retrieves the name of the
1306 * active keyboard layout.
1307 * Parameters: LPTSTR pwszKLID address of buffer for layout name
1308 * Variables :
1309 * Result : If the function succeeds, the return value is TRUE.
1310 * If the function fails, the return value is FALSE. To get extended
1311 * error information, call GetLastError.
1312 * Remark :
1313 * Status : UNTESTED STUB
1314 *
1315 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1316 *****************************************************************************/
1317// @@@PH Win32 BOOL's are casted to INTs
1318INT WIN32API GetKeyboardLayoutNameA(LPTSTR pwszKLID)
1319{
1320 dprintf(("USER32:GetKeyboardLayoutNameA (%08x) not implemented.",
1321 pwszKLID));
1322
1323 return(FALSE);
1324}
1325//******************************************************************************
1326//******************************************************************************
1327int WIN32API GetKeyboardLayoutList(int nBuff, HKL *lpList)
1328{
1329#ifdef DEBUG
1330 WriteLog("USER32: GetKeyboardLayoutList, not implemented\n");
1331#endif
1332 return(0);
1333}
1334//******************************************************************************
1335//******************************************************************************
1336HKL WIN32API GetKeyboardLayout(DWORD dwLayout)
1337{
1338#ifdef DEBUG
1339 WriteLog("USER32: GetKeyboardLayout, not implemented\n");
1340#endif
1341 return(0);
1342}
1343/*****************************************************************************
1344 * Name : BOOL WIN32API GetKeyboardLayoutNameW
1345 * Purpose : The GetKeyboardLayoutName function retrieves the name of the
1346 * active keyboard layout.
1347 * Parameters: LPTSTR pwszKLID address of buffer for layout name
1348 * Variables :
1349 * Result : If the function succeeds, the return value is TRUE.
1350 * If the function fails, the return value is FALSE. To get extended
1351 * error information, call GetLastError.
1352 * Remark :
1353 * Status : UNTESTED STUB
1354 *
1355 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1356 *****************************************************************************/
1357// @@@PH Win32 BOOL's are casted to INTs
1358INT WIN32API GetKeyboardLayoutNameW(LPWSTR pwszKLID)
1359{
1360 dprintf(("USER32:GetKeyboardLayoutNameW (%08x) not implemented.",
1361 pwszKLID));
1362
1363 return(FALSE);
1364}
1365//******************************************************************************
1366//******************************************************************************
1367BOOL WIN32API GetKeyboardState(PBYTE lpKeyState)
1368{
1369#ifdef DEBUG
1370 WriteLog("USER32: GetKeyboardState, not properly implemented\n");
1371#endif
1372 memset(lpKeyState, 0, 256);
1373 return(TRUE);
1374}
1375//******************************************************************************
1376//******************************************************************************
1377int WIN32API GetKeyNameTextA( LPARAM lParam, LPSTR lpString, int nSize)
1378{
1379#ifdef DEBUG
1380 WriteLog("USER32: GetKeyNameTextA\n");
1381#endif
1382 return O32_GetKeyNameText(lParam,lpString,nSize);
1383}
1384//******************************************************************************
1385//******************************************************************************
1386int WIN32API GetKeyNameTextW( LPARAM lParam, LPWSTR lpString, int nSize)
1387{
1388#ifdef DEBUG
1389 WriteLog("USER32: GetKeyNameTextW DOES NOT WORK\n");
1390#endif
1391 // NOTE: This will not work as is (needs UNICODE support)
1392 return 0;
1393// return O32_GetKeyNameText(arg1, arg2, arg3);
1394}
1395//******************************************************************************
1396//SvL: 24-6-'97 - Added
1397//******************************************************************************
1398SHORT WIN32API GetKeyState( int nVirtKey)
1399{
1400//SvL: Hehe. 32 MB logfile for Opera after a minute.
1401#ifdef DEBUG
1402// WriteLog("USER32: GetKeyState %d\n", nVirtKey);
1403#endif
1404 return O32_GetKeyState(nVirtKey);
1405}
1406/*****************************************************************************
1407 * Name : VOID WIN32API keybd_event
1408 * Purpose : The keybd_event function synthesizes a keystroke. The system
1409 * can use such a synthesized keystroke to generate a WM_KEYUP or
1410 * WM_KEYDOWN message. The keyboard driver's interrupt handler calls
1411 * the keybd_event function.
1412 * Parameters: BYTE bVk virtual-key code
1413
1414 * BYTE bScan hardware scan code
1415 * DWORD dwFlags flags specifying various function options
1416 * DWORD dwExtraInfo additional data associated with keystroke
1417 * Variables :
1418 * Result :
1419 * Remark :
1420 * Status : UNTESTED STUB
1421 *
1422 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1423 *****************************************************************************/
1424VOID WIN32API keybd_event (BYTE bVk,
1425 BYTE bScan,
1426 DWORD dwFlags,
1427 DWORD dwExtraInfo)
1428{
1429 dprintf(("USER32:keybd_event (%u,%u,%08xh,%08x) not implemented.\n",
1430 bVk,
1431 bScan,
1432 dwFlags,
1433 dwExtraInfo));
1434}
1435/*****************************************************************************
1436 * Name : HLK WIN32API LoadKeyboardLayoutA
1437 * Purpose : The LoadKeyboardLayout function loads a new keyboard layout into
1438 * the system. Several keyboard layouts can be loaded at a time, but
1439 * only one per process is active at a time. Loading multiple keyboard
1440 * layouts makes it possible to rapidly switch between layouts.
1441 * Parameters:
1442 * Variables :
1443 * Result : If the function succeeds, the return value is the handle of the
1444 * keyboard layout.
1445 * If the function fails, the return value is NULL. To get extended
1446 * error information, call GetLastError.
1447 * Remark :
1448 * Status : UNTESTED STUB
1449 *
1450 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1451 *****************************************************************************/
1452HKL WIN32API LoadKeyboardLayoutA(LPCTSTR pwszKLID,
1453 UINT Flags)
1454{
1455 dprintf(("USER32:LeadKeyboardLayoutA (%s,%u) not implemented.\n",
1456 pwszKLID,
1457 Flags));
1458
1459 return (NULL);
1460}
1461/*****************************************************************************
1462 * Name : HLK WIN32API LoadKeyboardLayoutW
1463 * Purpose : The LoadKeyboardLayout function loads a new keyboard layout into
1464 * the system. Several keyboard layouts can be loaded at a time, but
1465 * only one per process is active at a time. Loading multiple keyboard
1466 * layouts makes it possible to rapidly switch between layouts.
1467 * Parameters:
1468 * Variables :
1469 * Result : If the function succeeds, the return value is the handle of the
1470 * keyboard layout.
1471 * If the function fails, the return value is NULL. To get extended
1472 * error information, call GetLastError.
1473 * Remark :
1474 * Status : UNTESTED STUB
1475 *
1476 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1477 *****************************************************************************/
1478HKL WIN32API LoadKeyboardLayoutW(LPCWSTR pwszKLID,
1479 UINT Flags)
1480{
1481 dprintf(("USER32:LeadKeyboardLayoutW (%s,%u) not implemented.\n",
1482 pwszKLID,
1483 Flags));
1484
1485 return (NULL);
1486}
1487//******************************************************************************
1488//******************************************************************************
1489UINT WIN32API MapVirtualKeyA( UINT uCode, UINT uMapType)
1490{
1491#ifdef DEBUG
1492 WriteLog("USER32: MapVirtualKeyA\n");
1493#endif
1494 return O32_MapVirtualKey(uCode,uMapType);
1495}
1496//******************************************************************************
1497//******************************************************************************
1498UINT WIN32API MapVirtualKeyW( UINT uCode, UINT uMapType)
1499{
1500#ifdef DEBUG
1501 WriteLog("USER32: MapVirtualKeyW\n");
1502#endif
1503 // NOTE: This will not work as is (needs UNICODE support)
1504 return O32_MapVirtualKey(uCode,uMapType);
1505}
1506/*****************************************************************************
1507 * Name : UINT WIN32API MapVirtualKeyExA
1508 * Purpose : The MapVirtualKeyEx function translates (maps) a virtual-key
1509 * code into a scan code or character value, or translates a scan
1510 * code into a virtual-key code. The function translates the codes
1511 * using the input language and physical keyboard layout identified
1512 * by the given keyboard layout handle.
1513 * Parameters:
1514 * Variables :
1515 * Result : The return value is either a scan code, a virtual-key code, or
1516 * a character value, depending on the value of uCode and uMapType.
1517 * If there is no translation, the return value is zero.
1518 * Remark :
1519 * Status : UNTESTED STUB
1520 *
1521 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1522 *****************************************************************************/
1523UINT WIN32API MapVirtualKeyExA(UINT uCode,
1524 UINT uMapType,
1525 HKL dwhkl)
1526{
1527 dprintf(("USER32:MapVirtualKeyExA (%u,%u,%08x) not implemented.\n",
1528 uCode,
1529 uMapType,
1530 dwhkl));
1531
1532 return (0);
1533}
1534/*****************************************************************************
1535 * Name : UINT WIN32API MapVirtualKeyExW
1536 * Purpose : The MapVirtualKeyEx function translates (maps) a virtual-key
1537 * code into a scan code or character value, or translates a scan
1538 * code into a virtual-key code. The function translates the codes
1539 * using the input language and physical keyboard layout identified
1540 * by the given keyboard layout handle.
1541 * Parameters:
1542 * Variables :
1543 * Result : The return value is either a scan code, a virtual-key code, or
1544 * a character value, depending on the value of uCode and uMapType.
1545 * If there is no translation, the return value is zero.
1546 * Remark :
1547 * Status : UNTESTED STUB
1548
1549 *
1550 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1551 *****************************************************************************/
1552UINT WIN32API MapVirtualKeyExW(UINT uCode,
1553 UINT uMapType,
1554 HKL dwhkl)
1555{
1556 dprintf(("USER32:MapVirtualKeyExW (%u,%u,%08x) not implemented.\n",
1557 uCode,
1558 uMapType,
1559 dwhkl));
1560
1561 return (0);
1562}
1563/*****************************************************************************
1564 * Name : DWORD WIN32API OemKeyScan
1565 * Purpose : The OemKeyScan function maps OEM ASCII codes 0 through 0x0FF
1566 * into the OEM scan codes and shift states. The function provides
1567 * information that allows a program to send OEM text to another
1568 * program by simulating keyboard input.
1569 * Parameters:
1570 * Variables :
1571 * Result :
1572 * Remark :
1573 * Status : UNTESTED STUB
1574 *
1575 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1576 *****************************************************************************/
1577DWORD WIN32API OemKeyScan(WORD wOemChar)
1578{
1579 dprintf(("USER32:OemKeyScan (%u) not implemented.\n",
1580 wOemChar));
1581
1582 return (wOemChar);
1583}
1584//******************************************************************************
1585//******************************************************************************
1586BOOL WIN32API RegisterHotKey(HWND hwnd, int idHotKey, UINT fuModifiers, UINT uVirtKey)
1587{
1588#ifdef DEBUG
1589 WriteLog("USER32: RegisterHotKey, not implemented\n");
1590#endif
1591 hwnd = Win32Window::Win32ToOS2Handle(hwnd);
1592 return(TRUE);
1593}
1594//******************************************************************************
1595//******************************************************************************
1596BOOL WIN32API SetKeyboardState(PBYTE lpKeyState)
1597{
1598#ifdef DEBUG
1599 WriteLog("USER32: SetKeyboardState, not implemented\n");
1600#endif
1601 return(TRUE);
1602}
1603/*****************************************************************************
1604 * Name : int WIN32API ToAscii
1605 * Purpose : The ToAscii function translates the specified virtual-key code
1606 * and keyboard state to the corresponding Windows character or characters.
1607 * Parameters: UINT uVirtKey virtual-key code
1608 * UINT uScanCode scan code
1609 * PBYTE lpbKeyState address of key-state array
1610 * LPWORD lpwTransKey buffer for translated key
1611 * UINT fuState active-menu flag
1612 * Variables :
1613 * Result : 0 The specified virtual key has no translation for the current
1614 * state of the keyboard.
1615 * 1 One Windows character was copied to the buffer.
1616 * 2 Two characters were copied to the buffer. This usually happens
1617 * when a dead-key character (accent or diacritic) stored in the
1618 * keyboard layout cannot be composed with the specified virtual
1619 * key to form a single character.
1620 * Remark :
1621 * Status : UNTESTED STUB
1622 *
1623 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1624 *****************************************************************************/
1625int WIN32API ToAscii(UINT uVirtKey,
1626 UINT uScanCode,
1627 PBYTE lpbKeyState,
1628 LPWORD lpwTransKey,
1629 UINT fuState)
1630{
1631 dprintf(("USER32:ToAscii (%u,%u,%08xh,%08xh,%u) not implemented.\n",
1632 uVirtKey,
1633 uScanCode,
1634 lpbKeyState,
1635 lpwTransKey,
1636 fuState));
1637
1638 return (0);
1639}
1640/*****************************************************************************
1641 * Name : int WIN32API ToAsciiEx
1642 * Purpose : The ToAscii function translates the specified virtual-key code
1643 * and keyboard state to the corresponding Windows character or characters.
1644 * Parameters: UINT uVirtKey virtual-key code
1645 * UINT uScanCode scan code
1646 * PBYTE lpbKeyState address of key-state array
1647 * LPWORD lpwTransKey buffer for translated key
1648 * UINT fuState active-menu flag
1649 * HLK hlk keyboard layout handle
1650 * Variables :
1651 * Result : 0 The specified virtual key has no translation for the current
1652 * state of the keyboard.
1653 * 1 One Windows character was copied to the buffer.
1654 * 2 Two characters were copied to the buffer. This usually happens
1655 * when a dead-key character (accent or diacritic) stored in the
1656 * keyboard layout cannot be composed with the specified virtual
1657 * key to form a single character.
1658 * Remark :
1659 * Status : UNTESTED STUB
1660 *
1661 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1662 *****************************************************************************/
1663int WIN32API ToAsciiEx(UINT uVirtKey,
1664 UINT uScanCode,
1665 PBYTE lpbKeyState,
1666 LPWORD lpwTransKey,
1667 UINT fuState,
1668 HKL hkl)
1669{
1670 dprintf(("USER32:ToAsciiEx (%u,%u,%08xh,%08xh,%u,%08x) not implemented.\n",
1671 uVirtKey,
1672 uScanCode,
1673 lpbKeyState,
1674 lpwTransKey,
1675 fuState,
1676 hkl));
1677
1678 return (0);
1679}
1680/*****************************************************************************
1681 * Name : int WIN32API ToUnicode
1682 * Purpose : The ToUnicode function translates the specified virtual-key code
1683 * and keyboard state to the corresponding Unicode character or characters.
1684 * Parameters: UINT wVirtKey virtual-key code
1685 * UINT wScanCode scan code
1686 * PBYTE lpKeyState address of key-state array
1687 * LPWSTR pwszBuff buffer for translated key
1688 * int cchBuff size of translated key buffer
1689 * UINT wFlags set of function-conditioning flags
1690 * Variables :
1691 * Result : - 1 The specified virtual key is a dead-key character (accent or
1692 * diacritic). This value is returned regardless of the keyboard
1693 * layout, even if several characters have been typed and are
1694 * stored in the keyboard state. If possible, even with Unicode
1695 * keyboard layouts, the function has written a spacing version of
1696 * the dead-key character to the buffer specified by pwszBuffer.
1697 * For example, the function writes the character SPACING ACUTE
1698 * (0x00B4), rather than the character NON_SPACING ACUTE (0x0301).
1699 * 0 The specified virtual key has no translation for the current
1700 * state of the keyboard. Nothing was written to the buffer
1701 * specified by pwszBuffer.
1702 * 1 One character was written to the buffer specified by pwszBuffer.
1703 * 2 or more Two or more characters were written to the buffer specified by
1704 * pwszBuff. The most common cause for this is that a dead-key
1705 * character (accent or diacritic) stored in the keyboard layout
1706 * could not be combined with the specified virtual key to form a
1707 * single character.
1708 * Remark :
1709 * Status : UNTESTED STUB
1710 *
1711 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1712 *****************************************************************************/
1713int WIN32API ToUnicode(UINT uVirtKey,
1714 UINT uScanCode,
1715 PBYTE lpKeyState,
1716 LPWSTR pwszBuff,
1717 int cchBuff,
1718 UINT wFlags)
1719{
1720 dprintf(("USER32:ToUnicode (%u,%u,%08xh,%08xh,%u,%08x) not implemented.\n",
1721 uVirtKey,
1722 uScanCode,
1723 lpKeyState,
1724 pwszBuff,
1725 cchBuff,
1726 wFlags));
1727
1728 return (0);
1729}
1730/*****************************************************************************
1731 * Name : BOOL WIN32API UnloadKeyboardLayout
1732 * Purpose : The UnloadKeyboardLayout function removes a keyboard layout.
1733 * Parameters: HKL hkl handle of keyboard layout
1734 * Variables :
1735 * Result : If the function succeeds, the return value is the handle of the
1736 * keyboard layout; otherwise, it is NULL. To get extended error
1737 * information, use the GetLastError function.
1738 * Remark :
1739 * Status : UNTESTED STUB
1740 *
1741 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1742 *****************************************************************************/
1743BOOL WIN32API UnloadKeyboardLayout (HKL hkl)
1744{
1745 dprintf(("USER32:UnloadKeyboardLayout (%08x) not implemented.\n",
1746 hkl));
1747
1748 return (0);
1749}
1750//******************************************************************************
1751//******************************************************************************
1752BOOL WIN32API UnregisterHotKey(HWND hwnd, int idHotKey)
1753{
1754#ifdef DEBUG
1755 WriteLog("USER32: UnregisterHotKey, not implemented\n");
1756#endif
1757 hwnd = Win32Window::Win32ToOS2Handle(hwnd);
1758
1759 return(TRUE);
1760}
1761//******************************************************************************
1762//SvL: 24-6-'97 - Added
1763//******************************************************************************
1764WORD WIN32API VkKeyScanA( char ch)
1765{
1766#ifdef DEBUG
1767 WriteLog("USER32: VkKeyScanA\n");
1768#endif
1769 return O32_VkKeyScan(ch);
1770}
1771//******************************************************************************
1772//******************************************************************************
1773WORD WIN32API VkKeyScanW( WCHAR wch)
1774{
1775#ifdef DEBUG
1776 WriteLog("USER32: VkKeyScanW\n");
1777#endif
1778 // NOTE: This will not work as is (needs UNICODE support)
1779 return O32_VkKeyScan((char)wch);
1780}
1781/*****************************************************************************
1782 * Name : SHORT WIN32API VkKeyScanExW
1783 * Purpose : The VkKeyScanEx function translates a character to the
1784 * corresponding virtual-key code and shift state. The function
1785 * translates the character using the input language and physical
1786 * keyboard layout identified by the given keyboard layout handle.
1787 * Parameters: UINT uChar character to translate
1788 * HKL hkl keyboard layout handle
1789 * Variables :
1790 * Result : see docs
1791 * Remark :
1792 * Status : UNTESTED STUB
1793 *
1794 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1795 *****************************************************************************/
1796WORD WIN32API VkKeyScanExW(WCHAR uChar,
1797 HKL hkl)
1798{
1799 dprintf(("USER32:VkKeyScanExW (%u,%08x) not implemented.\n",
1800 uChar,
1801 hkl));
1802
1803 return (uChar);
1804}
1805/*****************************************************************************
1806 * Name : SHORT WIN32API VkKeyScanExA
1807 * Purpose : The VkKeyScanEx function translates a character to the
1808 * corresponding virtual-key code and shift state. The function
1809 * translates the character using the input language and physical
1810 * keyboard layout identified by the given keyboard layout handle.
1811 * Parameters: UINT uChar character to translate
1812 * HKL hkl keyboard layout handle
1813 * Variables :
1814 * Result : see docs
1815 * Remark :
1816 * Status : UNTESTED STUB
1817 *
1818 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1819 *****************************************************************************/
1820WORD WIN32API VkKeyScanExA(CHAR uChar,
1821 HKL hkl)
1822{
1823 dprintf(("USER32:VkKeyScanExA (%u,%08x) not implemented.\n",
1824 uChar,
1825 hkl));
1826
1827 return (uChar);
1828}
1829
1830/* Synchronization Functions */
1831ODINFUNCTION5(DWORD,MsgWaitForMultipleObjects,DWORD, nCount,
1832 LPHANDLE, pHandles,
1833 BOOL, fWaitAll,
1834 DWORD, dwMilliseconds,
1835 DWORD, dwWakeMask)
1836{
1837 // @@@PH that's a really difficult function to implement
1838
1839 // @@@PH this is a temporary bugfix for WINFILE.EXE
1840 if (nCount == 0)
1841 {
1842 // only listens to incoming thread messages.
1843 return (WAIT_OBJECT_0);
1844 }
1845
1846 return O32_MsgWaitForMultipleObjects(nCount,pHandles,fWaitAll,dwMilliseconds,dwWakeMask);
1847}
1848
1849/* Button Functions */
1850
1851BOOL WIN32API CheckRadioButton( HWND hDlg, UINT nIDFirstButton, UINT nIDLastButton, UINT nIDCheckButton)
1852{
1853#ifdef DEBUG
1854 WriteLog("USER32: CheckRadioButton\n");
1855#endif
1856 //CB: check radio buttons in interval
1857 if (nIDFirstButton > nIDLastButton)
1858 {
1859 SetLastError(ERROR_INVALID_PARAMETER);
1860 return (FALSE);
1861 }
1862
1863 for (UINT x = nIDFirstButton;x <= nIDLastButton;x++)
1864 {
1865 SendDlgItemMessageA(hDlg,x,BM_SETCHECK,(x == nIDCheckButton) ? BST_CHECKED : BST_UNCHECKED,0);
1866 }
1867
1868 return (TRUE);
1869}
1870
1871/* Window Functions */
1872
1873/*****************************************************************************
1874 * Name : BOOL WIN32API AnyPopup
1875 * Purpose : The AnyPopup function indicates whether an owned, visible,
1876 * top-level pop-up, or overlapped window exists on the screen. The
1877 * function searches the entire Windows screen, not just the calling
1878 * application's client area.
1879 * Parameters: VOID
1880 * Variables :
1881 * Result : If a pop-up window exists, the return value is TRUE even if the
1882 * pop-up window is completely covered by other windows. Otherwise,
1883 * it is FALSE.
1884 * Remark : AnyPopup is a Windows version 1.x function and is retained for
1885 * compatibility purposes. It is generally not useful.
1886 * Status : UNTESTED STUB
1887 *
1888 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1889 *****************************************************************************/
1890BOOL WIN32API AnyPopup(VOID)
1891{
1892 dprintf(("USER32:AnyPopup() not implemented.\n"));
1893
1894 return (FALSE);
1895}
1896//******************************************************************************
1897//******************************************************************************
1898HWND WIN32API GetForegroundWindow(void)
1899{
1900#ifdef DEBUG
1901 WriteLog("USER32: GetForegroundWindow\n");
1902#endif
1903 return Win32Window::OS2ToWin32Handle(O32_GetForegroundWindow());
1904}
1905//******************************************************************************
1906//******************************************************************************
1907HWND WIN32API GetLastActivePopup( HWND hWnd)
1908{
1909#ifdef DEBUG
1910 WriteLog("USER32: GetLastActivePopup\n");
1911#endif
1912 hWnd = Win32Window::Win32ToOS2Handle(hWnd);
1913
1914 return Win32Window::OS2ToWin32Handle(O32_GetLastActivePopup(hWnd));
1915}
1916//******************************************************************************
1917//******************************************************************************
1918DWORD WIN32API GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
1919{
1920#ifdef DEBUG
1921 WriteLog("USER32: GetWindowThreadProcessId\n");
1922#endif
1923 hWnd = Win32Window::Win32ToOS2Handle(hWnd);
1924
1925 return O32_GetWindowThreadProcessId(hWnd,lpdwProcessId);
1926}
1927
1928/* Painting and Drawing Functions */
1929
1930INT WIN32API ExcludeUpdateRgn( HDC hDC, HWND hWnd)
1931{
1932#ifdef DEBUG
1933 WriteLog("USER32: ExcludeUpdateRgn\n");
1934#endif
1935 hWnd = Win32Window::Win32ToOS2Handle(hWnd);
1936
1937 return O32_ExcludeUpdateRgn(hDC,hWnd);
1938}
1939//******************************************************************************
1940//******************************************************************************
1941/*****************************************************************************
1942 * Name : int WIN32API GetWindowRgn
1943 * Purpose : The GetWindowRgn function obtains a copy of the window region of a window.
1944 * Parameters: HWND hWnd handle to window whose window region is to be obtained
1945 * HRGN hRgn handle to region that receives a copy of the window region
1946 * Variables :
1947 * Result : NULLREGION, SIMPLEREGION, COMPLEXREGION, ERROR
1948 * Remark :
1949 * Status : UNTESTED STUB
1950 *
1951 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
1952 *****************************************************************************/
1953
1954int WIN32API GetWindowRgn (HWND hWnd,
1955 HRGN hRgn)
1956{
1957 dprintf(("USER32:GetWindowRgn (%08xh,%08x) not implemented.\n",
1958 hWnd,
1959 hRgn));
1960 //Attention: Win32 hwnd handle!
1961
1962 return (NULLREGION);
1963}
1964//******************************************************************************
1965//TODO: Not complete
1966//******************************************************************************
1967BOOL WIN32API GrayStringA(HDC hdc, HBRUSH hBrush, GRAYSTRINGPROC lpOutputFunc,
1968 LPARAM lpData, int nCount, int X, int Y, int nWidth,
1969 int nHeight)
1970{
1971 BOOL rc;
1972 COLORREF curclr;
1973
1974#ifdef DEBUG
1975 WriteLog("USER32: GrayStringA, not completely implemented\n");
1976#endif
1977 if(lpOutputFunc == NULL && lpData == NULL) {
1978#ifdef DEBUG
1979 WriteLog("USER32: lpOutputFunc == NULL && lpData == NULL\n");
1980#endif
1981 return(FALSE);
1982 }
1983 if(lpOutputFunc) {
1984 return(lpOutputFunc(hdc, lpData, nCount));
1985 }
1986 curclr = SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
1987 rc = TextOutA(hdc, X, Y, (char *)lpData, nCount);
1988 SetTextColor(hdc, curclr);
1989
1990 return(rc);
1991}
1992//******************************************************************************
1993//******************************************************************************
1994BOOL WIN32API GrayStringW(HDC hdc, HBRUSH hBrush, GRAYSTRINGPROC lpOutputFunc,
1995 LPARAM lpData, int nCount, int X, int Y, int nWidth,
1996 int nHeight)
1997{
1998 BOOL rc;
1999 char *astring;
2000 COLORREF curclr;
2001
2002#ifdef DEBUG
2003 WriteLog("USER32: GrayStringW, not completely implemented\n");
2004#endif
2005
2006 if(lpOutputFunc == NULL && lpData == NULL) {
2007#ifdef DEBUG
2008 WriteLog("USER32: lpOutputFunc == NULL && lpData == NULL\n");
2009#endif
2010 return(FALSE);
2011 }
2012 if(nCount == 0)
2013 nCount = UniStrlen((UniChar*)lpData);
2014
2015 if(lpOutputFunc) {
2016 return(lpOutputFunc(hdc, lpData, nCount));
2017 }
2018 astring = UnicodeToAsciiString((LPWSTR)lpData);
2019
2020 curclr = SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
2021 rc = TextOutA(hdc, X, Y, astring, nCount);
2022 SetTextColor(hdc, curclr);
2023
2024 FreeAsciiString(astring);
2025 return(rc);
2026}
2027//******************************************************************************
2028//******************************************************************************
2029#if 0
2030BOOL WIN32API InvalidateRgn( HWND hWnd, HRGN hRgn, BOOL bErase)
2031{
2032#ifdef DEBUG
2033 WriteLog("USER32: InvalidateRgn\n");
2034#endif
2035 hWnd = Win32Window::Win32ToOS2Handle(hWnd);
2036
2037 return O32_InvalidateRgn(hWnd,hRgn,bErase);
2038}
2039#endif
2040/*****************************************************************************
2041 * Name : BOOL WIN32API PaintDesktop
2042 * Purpose : The PaintDesktop function fills the clipping region in the
2043 * specified device context with the desktop pattern or wallpaper.
2044 * The function is provided primarily for shell desktops.
2045 * Parameters:
2046 * Variables :
2047 * Result : If the function succeeds, the return value is TRUE.
2048 * If the function fails, the return value is FALSE.
2049 * Remark :
2050 * Status : UNTESTED STUB
2051 *
2052 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2053 *****************************************************************************/
2054BOOL WIN32API PaintDesktop(HDC hdc)
2055{
2056 dprintf(("USER32:PaintDesktop (%08x) not implemented.\n",
2057 hdc));
2058
2059 return (FALSE);
2060}
2061/*****************************************************************************
2062 * Name : int WIN32API SetWindowRgn
2063 * Purpose : The SetWindowRgn function sets the window region of a window. The
2064 * window region determines the area within the window where the
2065 * operating system permits drawing. The operating system does not
2066 * display any portion of a window that lies outside of the window region
2067 * Parameters: HWND hWnd handle to window whose window region is to be set
2068 * HRGN hRgn handle to region
2069 * BOOL bRedraw window redraw flag
2070 * Variables :
2071 * Result : If the function succeeds, the return value is non-zero.
2072 * If the function fails, the return value is zero.
2073 * Remark :
2074 * Status : UNTESTED STUB
2075 *
2076 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2077 *****************************************************************************/
2078
2079int WIN32API SetWindowRgn(HWND hWnd,
2080 HRGN hRgn,
2081 BOOL bRedraw)
2082{
2083 dprintf(("USER32:SetWindowRgn (%08xh,%08xh,%u) not implemented.\n",
2084 hWnd,
2085 hRgn,
2086 bRedraw));
2087 //Attention: Win32 hwnd handle!
2088
2089 return (0);
2090}
2091//******************************************************************************
2092//******************************************************************************
2093BOOL WIN32API ValidateRect( HWND hwnd, const RECT * lprc)
2094{
2095#ifdef DEBUG
2096 WriteLog("USER32: ValidateRect\n");
2097#endif
2098 hwnd = Win32Window::Win32ToOS2Handle(hwnd);
2099
2100 return O32_ValidateRect(hwnd,lprc);
2101}
2102//******************************************************************************
2103//******************************************************************************
2104BOOL WIN32API ValidateRgn( HWND hwnd, HRGN hrgn)
2105{
2106#ifdef DEBUG
2107 WriteLog("USER32: ValidateRgn\n");
2108#endif
2109 hwnd = Win32Window::Win32ToOS2Handle(hwnd);
2110
2111 return O32_ValidateRgn(hwnd,hrgn);
2112}
2113
2114/* Filled Shape Functions */
2115
2116
2117int WIN32API FillRect(HDC hDC, const RECT * lprc, HBRUSH hbr)
2118{
2119#ifdef DEBUG
2120 WriteLog("USER32: FillRect (%d,%d)(%d,%d) brush %X\n", lprc->left, lprc->top, lprc->right, lprc->bottom, hbr);
2121#endif
2122 return O32_FillRect(hDC,lprc,hbr);
2123}
2124//******************************************************************************
2125//******************************************************************************
2126int WIN32API FrameRect( HDC hDC, const RECT * lprc, HBRUSH hbr)
2127{
2128#ifdef DEBUG
2129 WriteLog("USER32: FrameRect\n");
2130#endif
2131 return O32_FrameRect(hDC,lprc,hbr);
2132}
2133//******************************************************************************
2134//******************************************************************************
2135BOOL WIN32API InvertRect( HDC hDC, const RECT * lprc)
2136{
2137#ifdef DEBUG
2138 WriteLog("USER32: InvertRect\n");
2139#endif
2140 return O32_InvertRect(hDC,lprc);
2141}
2142
2143/* System Information Functions */
2144
2145int WIN32API GetKeyboardType( int nTypeFlag)
2146{
2147#ifdef DEBUG
2148 WriteLog("USER32: GetKeyboardType\n");
2149#endif
2150 return O32_GetKeyboardType(nTypeFlag);
2151}
2152/*****************************************************************************
2153 * Name : HDESK WIN32API GetThreadDesktop
2154 * Purpose : The GetThreadDesktop function returns a handle to the desktop
2155 * associated with a specified thread.
2156 * Parameters: DWORD dwThreadId thread identifier
2157 * Variables :
2158 * Result : If the function succeeds, the return value is the handle of the
2159 * desktop associated with the specified thread.
2160 * Remark :
2161 * Status : UNTESTED STUB
2162 *
2163 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2164 *****************************************************************************/
2165HDESK WIN32API GetThreadDesktop(DWORD dwThreadId)
2166{
2167 dprintf(("USER32:GetThreadDesktop (%u) not implemented.\n",
2168 dwThreadId));
2169
2170 return (NULL);
2171}
2172
2173/* Message and Message Queue Functions */
2174
2175/*****************************************************************************
2176 * Name : BOOL WIN32API GetInputState
2177 * Purpose : The GetInputState function determines whether there are
2178 * mouse-button or keyboard messages in the calling thread's message queue.
2179 * Parameters:
2180 * Variables :
2181 * Result : If the queue contains one or more new mouse-button or keyboard
2182 * messages, the return value is TRUE.
2183 * If the function fails, the return value is FALSE.
2184 * Remark :
2185 * Status : UNTESTED STUB
2186 *
2187 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2188 *****************************************************************************/
2189BOOL WIN32API GetInputState(VOID)
2190{
2191 dprintf(("USER32:GetInputState () not implemented.\n"));
2192
2193 return (FALSE);
2194}
2195//******************************************************************************
2196//******************************************************************************
2197DWORD WIN32API GetQueueStatus( UINT flags)
2198{
2199#ifdef DEBUG
2200 WriteLog("USER32: GetQueueStatus\n");
2201#endif
2202 return O32_GetQueueStatus(flags);
2203}
2204
2205/* Font and Text Functions */
2206
2207DWORD WIN32API GetTabbedTextExtentA( HDC hDC, LPCSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions)
2208{
2209#ifdef DEBUG
2210 WriteLog("USER32: GetTabbedTextExtentA\n");
2211#endif
2212 return O32_GetTabbedTextExtent(hDC,lpString,nCount,nTabPositions,lpnTabStopPositions);
2213}
2214//******************************************************************************
2215//******************************************************************************
2216DWORD WIN32API GetTabbedTextExtentW( HDC hDC, LPCWSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions)
2217{
2218 char *astring = UnicodeToAsciiString((LPWSTR)lpString);
2219 DWORD rc;
2220
2221#ifdef DEBUG
2222 WriteLog("USER32: GetTabbedTextExtentW\n");
2223#endif
2224 rc = O32_GetTabbedTextExtent(hDC,astring,nCount,nTabPositions,lpnTabStopPositions);
2225 FreeAsciiString(astring);
2226 return rc;
2227}
2228//******************************************************************************
2229//******************************************************************************
2230LONG WIN32API TabbedTextOutA( HDC hdc, int x, int y, LPCSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin)
2231{
2232#ifdef DEBUG
2233 WriteLog("USER32: TabbedTextOutA\n");
2234#endif
2235 return O32_TabbedTextOut(hdc,x,y,lpString,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin);
2236}
2237//******************************************************************************
2238//******************************************************************************
2239LONG WIN32API TabbedTextOutW( HDC hdc, int x, int y, LPCWSTR lpString, int nCount, int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin)
2240{
2241 char *astring = UnicodeToAsciiString((LPWSTR)lpString);
2242 LONG rc;
2243
2244#ifdef DEBUG
2245 WriteLog("USER32: TabbedTextOutW\n");
2246#endif
2247 rc = O32_TabbedTextOut(hdc,x,y,astring,nCount,nTabPositions,lpnTabStopPositions,nTabOrigin);
2248 FreeAsciiString(astring);
2249 return rc;
2250}
2251
2252/* Dialog Box Functions */
2253
2254BOOL WIN32API MapDialogRect( HWND hDlg, PRECT lpRect)
2255{
2256#ifdef DEBUG
2257 WriteLog("USER32: MapDialogRect\n");
2258#endif
2259 hDlg = Win32Window::Win32ToOS2Handle(hDlg);
2260
2261 return O32_MapDialogRect(hDlg,lpRect);
2262}
2263
2264/* Coordinate Space and Transformation Functions */
2265
2266int WIN32API MapWindowPoints( HWND hWndFrom, HWND hWndTo, LPPOINT lpPoints, UINT cPoints)
2267{
2268#ifdef DEBUG
2269 WriteLog("USER32: MapWindowPoints\n");
2270#endif
2271 hWndFrom = Win32Window::Win32ToOS2Handle(hWndFrom);
2272 hWndTo = Win32Window::Win32ToOS2Handle(hWndTo);
2273
2274 return O32_MapWindowPoints(hWndFrom,hWndTo,lpPoints,cPoints);
2275}
2276//******************************************************************************
2277//******************************************************************************
2278BOOL WIN32API ScreenToClient (HWND hwnd, LPPOINT pt)
2279{
2280 Win32BaseWindow *wnd;
2281 PRECT rcl;
2282
2283 dprintf(("ScreenToClient %x (%d,%d)\n", hwnd, pt->x, pt->y));
2284
2285 if (!hwnd) return (TRUE);
2286 wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
2287 if (!wnd) return (TRUE);
2288
2289 rcl = wnd->getClientRect();
2290 pt->y = ScreenHeight - pt->y;
2291 OSLibWinMapWindowPoints (OSLIB_HWND_DESKTOP, wnd->getOS2WindowHandle(), (OSLIBPOINT *)pt, 1);
2292 pt->y = (rcl->bottom - rcl->top) - pt->y;
2293 dprintf(("ScreenToClient %x returned (%d,%d)\n", hwnd, pt->x, pt->y));
2294 return (TRUE);
2295}
2296
2297/* Icon Functions */
2298int WIN32API LookupIconIdFromDirectory(PBYTE presbits, BOOL fIcon)
2299{
2300#ifdef DEBUG
2301 WriteLog("USER32: LookupIconIdFromDirectory, not implemented\n");
2302#endif
2303 return(0);
2304}
2305//******************************************************************************
2306//******************************************************************************
2307int WIN32API LookupIconIdFromDirectoryEx(PBYTE presbits, BOOL fIcon,
2308 int cxDesired, int cyDesired,
2309 UINT Flags)
2310{
2311#ifdef DEBUG
2312 WriteLog("USER32: LookupIconIdFromDirectoryEx, not implemented\n");
2313#endif
2314 return(0);
2315}
2316
2317/* Device Context Functions */
2318
2319BOOL WIN32API GetMonitorInfoA(HMONITOR,LPMONITORINFO)
2320{
2321#ifdef DEBUG
2322 WriteLog("USER32: GetMonitorInfoA not supported!!\n");
2323#endif
2324 return(FALSE);
2325}
2326//******************************************************************************
2327//******************************************************************************
2328BOOL WIN32API GetMonitorInfoW(HMONITOR,LPMONITORINFO)
2329{
2330#ifdef DEBUG
2331 WriteLog("USER32: GetMonitorInfoW not supported!!\n");
2332#endif
2333 return(FALSE);
2334}
2335//******************************************************************************
2336//******************************************************************************
2337HMONITOR WIN32API MonitorFromWindow(HWND hwnd, DWORD dwFlags)
2338{
2339#ifdef DEBUG
2340 WriteLog("USER32: MonitorFromWindow not correctly supported??\n");
2341#endif
2342 //Attention: Win32 hwnd!
2343
2344 return(0);
2345}
2346//******************************************************************************
2347//******************************************************************************
2348HMONITOR WIN32API MonitorFromRect(LPRECT rect, DWORD dwFlags)
2349{
2350#ifdef DEBUG
2351 WriteLog("USER32: MonitorFromRect not correctly supported??\n");
2352#endif
2353 return(0);
2354}
2355//******************************************************************************
2356//******************************************************************************
2357HMONITOR WIN32API MonitorFromPoint(POINT point, DWORD dwflags)
2358{
2359#ifdef DEBUG
2360 WriteLog("USER32: MonitorFromPoint not correctly supported??\n");
2361#endif
2362 return(0);
2363}
2364//******************************************************************************
2365//******************************************************************************
2366BOOL WIN32API EnumDisplayMonitors(HDC,LPRECT,MONITORENUMPROC,LPARAM)
2367{
2368#ifdef DEBUG
2369 WriteLog("USER32: EnumDisplayMonitors not supported??\n");
2370#endif
2371 return(FALSE);
2372}
2373//******************************************************************************
2374//******************************************************************************
2375BOOL WIN32API EnumDisplaySettingsA(LPCSTR lpszDeviceName, DWORD iModeNum,
2376 LPDEVMODEA lpDevMode)
2377{
2378#ifdef DEBUG
2379 WriteLog("USER32: EnumDisplaySettingsA FAKED\n");
2380#endif
2381 switch(iModeNum) {
2382 case 0:
2383 lpDevMode->dmBitsPerPel = 16;
2384 lpDevMode->dmPelsWidth = 768;
2385 lpDevMode->dmPelsHeight = 1024;
2386 lpDevMode->dmDisplayFlags = 0;
2387 lpDevMode->dmDisplayFrequency = 70;
2388 break;
2389 case 1:
2390 lpDevMode->dmBitsPerPel = 16;
2391 lpDevMode->dmPelsWidth = 640;
2392 lpDevMode->dmPelsHeight = 480;
2393 lpDevMode->dmDisplayFlags = 0;
2394 lpDevMode->dmDisplayFrequency = 70;
2395 break;
2396 default:
2397 return(FALSE);
2398 }
2399 return(TRUE);
2400}
2401/*****************************************************************************
2402 * Name : BOOL WIN32API EnumDisplaySettingsW
2403 * Purpose : The EnumDisplaySettings function obtains information about one
2404 * of a display device's graphics modes. You can obtain information
2405 * for all of a display device's graphics modes by making a series
2406 * of calls to this function.
2407 * Parameters: LPCTSTR lpszDeviceName specifies the display device
2408 * DWORD iModeNum specifies the graphics mode
2409 * LPDEVMODE lpDevMode points to structure to receive settings
2410 * Variables :
2411 * Result : If the function succeeds, the return value is TRUE.
2412 * If the function fails, the return value is FALSE.
2413 * Remark :
2414 * Status : UNTESTED STUB
2415 *
2416 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2417 *****************************************************************************/
2418BOOL WIN32API EnumDisplaySettingsW(LPCSTR lpszDeviceName,
2419 DWORD iModeNum,
2420 LPDEVMODEW lpDevMode)
2421{
2422 dprintf(("USER32:EnumDisplaySettingsW (%s,%08xh,%08x) not implemented.\n",
2423 lpszDeviceName,
2424 iModeNum,
2425 lpDevMode));
2426
2427 return (EnumDisplaySettingsA(lpszDeviceName,
2428 iModeNum,
2429 (LPDEVMODEA)lpDevMode));
2430}
2431//******************************************************************************
2432//******************************************************************************
2433LONG WIN32API ChangeDisplaySettingsA(LPDEVMODEA lpDevMode, DWORD dwFlags)
2434{
2435#ifdef DEBUG
2436 if(lpDevMode) {
2437 WriteLog("USER32: ChangeDisplaySettingsA FAKED %X\n", dwFlags);
2438 WriteLog("USER32: ChangeDisplaySettingsA lpDevMode->dmBitsPerPel %d\n", lpDevMode->dmBitsPerPel);
2439 WriteLog("USER32: ChangeDisplaySettingsA lpDevMode->dmPelsWidth %d\n", lpDevMode->dmPelsWidth);
2440 WriteLog("USER32: ChangeDisplaySettingsA lpDevMode->dmPelsHeight %d\n", lpDevMode->dmPelsHeight);
2441 }
2442#endif
2443 return(DISP_CHANGE_SUCCESSFUL);
2444}
2445/*****************************************************************************
2446 * Name : LONG WIN32API ChangeDisplaySettingsW
2447 * Purpose : The ChangeDisplaySettings function changes the display settings
2448 * to the specified graphics mode.
2449 * Parameters: LPDEVMODEW lpDevModeW
2450 * DWORD dwFlags
2451 * Variables :
2452 * Result : DISP_CHANGE_SUCCESSFUL The settings change was successful.
2453 * DISP_CHANGE_RESTART The computer must be restarted in order for the graphics mode to work.
2454 * DISP_CHANGE_BADFLAGS An invalid set of flags was passed in.
2455 * DISP_CHANGE_FAILED The display driver failed the specified graphics mode.
2456 * DISP_CHANGE_BADMODE The graphics mode is not supported.
2457 * DISP_CHANGE_NOTUPDATED Unable to write settings to the registry.
2458 * Remark :
2459 * Status : UNTESTED STUB
2460 *
2461 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2462 *****************************************************************************/
2463LONG WIN32API ChangeDisplaySettingsW(LPDEVMODEW lpDevMode,
2464 DWORD dwFlags)
2465{
2466 dprintf(("USER32:ChangeDisplaySettingsW(%08xh,%08x) not implemented.\n",
2467 lpDevMode,
2468 dwFlags));
2469
2470 return (ChangeDisplaySettingsA((LPDEVMODEA)lpDevMode,
2471 dwFlags));
2472}
2473
2474/* Window Station and Desktop Functions */
2475
2476/*****************************************************************************
2477 * Name : BOOL WIN32API CloseDesktop
2478 * Purpose : The CloseDesktop function closes an open handle of a desktop
2479 * object. A desktop is a secure object contained within a window
2480 * station object. A desktop has a logical display surface and
2481 * contains windows, menus and hooks.
2482 * Parameters: HDESK hDesktop
2483 * Variables :
2484 * Result : If the function succeeds, the return value is TRUE.
2485 * If the functions fails, the return value is FALSE. To get
2486 * extended error information, call GetLastError.
2487 * Remark :
2488 * Status : UNTESTED STUB
2489 *
2490 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2491 *****************************************************************************/
2492BOOL WIN32API CloseDesktop(HDESK hDesktop)
2493{
2494 dprintf(("USER32:CloseDesktop(%08x) not implemented.\n",
2495 hDesktop));
2496
2497 return (FALSE);
2498}
2499/*****************************************************************************
2500 * Name : BOOL WIN32API CloseWindowStation
2501 * Purpose : The CloseWindowStation function closes an open window station handle.
2502 * Parameters: HWINSTA hWinSta
2503 * Variables :
2504 * Result :
2505 * Remark : If the function succeeds, the return value is TRUE.
2506 * If the functions fails, the return value is FALSE. To get
2507 * extended error information, call GetLastError.
2508 * Status : UNTESTED STUB
2509 *
2510 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2511 *****************************************************************************/
2512BOOL WIN32API CloseWindowStation(HWINSTA hWinSta)
2513{
2514 dprintf(("USER32:CloseWindowStation(%08x) not implemented.\n",
2515 hWinSta));
2516
2517 return (FALSE);
2518}
2519/*****************************************************************************
2520 * Name : HDESK WIN32API CreateDesktopA
2521 * Purpose : The CreateDesktop function creates a new desktop on the window
2522 * station associated with the calling process.
2523 * Parameters: LPCTSTR lpszDesktop name of the new desktop
2524 * LPCTSTR lpszDevice name of display device to assign to the desktop
2525 * LPDEVMODE pDevMode reserved; must be NULL
2526 * DWORD dwFlags flags to control interaction with other applications
2527 * DWORD dwDesiredAccess specifies access of returned handle
2528 * LPSECURITY_ATTRIBUTES lpsa specifies security attributes of the desktop
2529 * Variables :
2530 * Result : If the function succeeds, the return value is a handle of the
2531 * newly created desktop.
2532 * If the function fails, the return value is NULL. To get extended
2533 * error information, call GetLastError.
2534 * Remark :
2535 * Status : UNTESTED STUB
2536 *
2537 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2538 *****************************************************************************/
2539HDESK WIN32API CreateDesktopA(LPCTSTR lpszDesktop,
2540 LPCTSTR lpszDevice,
2541 LPDEVMODEA pDevMode,
2542 DWORD dwFlags,
2543 DWORD dwDesiredAccess,
2544 LPSECURITY_ATTRIBUTES lpsa)
2545{
2546 dprintf(("USER32:CreateDesktopA(%s,%s,%08xh,%08xh,%08xh,%08x) not implemented.\n",
2547 lpszDesktop,
2548 lpszDevice,
2549 pDevMode,
2550 dwFlags,
2551 dwDesiredAccess,
2552 lpsa));
2553
2554 return (NULL);
2555}
2556/*****************************************************************************
2557 * Name : HDESK WIN32API CreateDesktopW
2558 * Purpose : The CreateDesktop function creates a new desktop on the window
2559 * station associated with the calling process.
2560 * Parameters: LPCTSTR lpszDesktop name of the new desktop
2561 * LPCTSTR lpszDevice name of display device to assign to the desktop
2562 * LPDEVMODE pDevMode reserved; must be NULL
2563 * DWORD dwFlags flags to control interaction with other applications
2564 * DWORD dwDesiredAccess specifies access of returned handle
2565 * LPSECURITY_ATTRIBUTES lpsa specifies security attributes of the desktop
2566 * Variables :
2567 * Result : If the function succeeds, the return value is a handle of the
2568 * newly created desktop.
2569 * If the function fails, the return value is NULL. To get extended
2570 * error information, call GetLastError.
2571 * Remark :
2572 * Status : UNTESTED STUB
2573 *
2574 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2575 *****************************************************************************/
2576HDESK WIN32API CreateDesktopW(LPCTSTR lpszDesktop,
2577 LPCTSTR lpszDevice,
2578 LPDEVMODEW pDevMode,
2579 DWORD dwFlags,
2580 DWORD dwDesiredAccess,
2581 LPSECURITY_ATTRIBUTES lpsa)
2582{
2583 dprintf(("USER32:CreateDesktopW(%s,%s,%08xh,%08xh,%08xh,%08x) not implemented.\n",
2584 lpszDesktop,
2585 lpszDevice,
2586 pDevMode,
2587 dwFlags,
2588 dwDesiredAccess,
2589 lpsa));
2590
2591 return (NULL);
2592}
2593/*****************************************************************************
2594 * Name : HWINSTA WIN32API CreateWindowStationA
2595 * Purpose : The CreateWindowStation function creates a window station object.
2596 * It returns a handle that can be used to access the window station.
2597 * A window station is a secure object that contains a set of global
2598 * atoms, a clipboard, and a set of desktop objects.
2599 * Parameters: LPTSTR lpwinsta name of the new window station
2600 * DWORD dwReserved reserved; must be NULL
2601 * DWORD dwDesiredAccess specifies access of returned handle
2602 * LPSECURITY_ATTRIBUTES lpsa specifies security attributes of the window station
2603 * Variables :
2604 * Result : If the function succeeds, the return value is the handle to the
2605 * newly created window station.
2606 * If the function fails, the return value is NULL. To get extended
2607 * error information, call GetLastError.
2608 * Remark :
2609 * Status : UNTESTED STUB
2610 *
2611 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2612 *****************************************************************************/
2613HWINSTA WIN32API CreateWindowStationA(LPTSTR lpWinSta,
2614 DWORD dwReserved,
2615 DWORD dwDesiredAccess,
2616 LPSECURITY_ATTRIBUTES lpsa)
2617{
2618 dprintf(("USER32:CreateWindowStationA(%s,%08xh,%08xh,%08x) not implemented.\n",
2619 lpWinSta,
2620 dwReserved,
2621 dwDesiredAccess,
2622 lpsa));
2623
2624 return (NULL);
2625}
2626/*****************************************************************************
2627 * Name : HWINSTA WIN32API CreateWindowStationW
2628 * Purpose : The CreateWindowStation function creates a window station object.
2629 * It returns a handle that can be used to access the window station.
2630 * A window station is a secure object that contains a set of global
2631 * atoms, a clipboard, and a set of desktop objects.
2632 * Parameters: LPTSTR lpwinsta name of the new window station
2633 * DWORD dwReserved reserved; must be NULL
2634 * DWORD dwDesiredAccess specifies access of returned handle
2635 * LPSECURITY_ATTRIBUTES lpsa specifies security attributes of the window station
2636 * Variables :
2637 * Result : If the function succeeds, the return value is the handle to the
2638 * newly created window station.
2639 * If the function fails, the return value is NULL. To get extended
2640 * error information, call GetLastError.
2641 * Remark :
2642 * Status : UNTESTED STUB
2643 *
2644 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2645 *****************************************************************************/
2646HWINSTA WIN32API CreateWindowStationW(LPWSTR lpWinSta,
2647 DWORD dwReserved,
2648 DWORD dwDesiredAccess,
2649 LPSECURITY_ATTRIBUTES lpsa)
2650{
2651 dprintf(("USER32:CreateWindowStationW(%s,%08xh,%08xh,%08x) not implemented.\n",
2652 lpWinSta,
2653 dwReserved,
2654 dwDesiredAccess,
2655 lpsa));
2656
2657 return (NULL);
2658}
2659/*****************************************************************************
2660 * Name : BOOL WIN32API EnumDesktopWindows
2661 * Purpose : The EnumDesktopWindows function enumerates all windows in a
2662 * desktop by passing the handle of each window, in turn, to an
2663 * application-defined callback function.
2664 * Parameters: HDESK hDesktop handle of desktop to enumerate
2665 * WNDENUMPROC lpfn points to application's callback function
2666 * LPARAM lParam 32-bit value to pass to the callback function
2667 * Variables :
2668 * Result : If the function succeeds, the return value is TRUE.
2669 * If the function fails, the return value is FALSE. To get
2670 * extended error information, call GetLastError.
2671 * Remark :
2672 * Status : UNTESTED STUB
2673 *
2674 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2675 *****************************************************************************/
2676BOOL WIN32API EnumDesktopWindows(HDESK hDesktop,
2677 WNDENUMPROC lpfn,
2678 LPARAM lParam)
2679{
2680 dprintf(("USER32:EnumDesktopWindows (%08xh,%08xh,%08x) not implemented.\n",
2681 hDesktop,
2682 lpfn,
2683 lParam));
2684
2685 return (FALSE);
2686}
2687/*****************************************************************************
2688 * Name : BOOL WIN32API EnumDesktopsA
2689 * Purpose : The EnumDesktops function enumerates all desktops in the window
2690 * station assigned to the calling process. The function does so by
2691 * passing the name of each desktop, in turn, to an application-
2692 * defined callback function.
2693 * Parameters: HWINSTA hwinsta handle of window station to enumerate
2694 * DESKTOPENUMPROC lpEnumFunc points to application's callback function
2695 * LPARAM lParam 32-bit value to pass to the callback function
2696 * Variables :
2697 * Result : If the function succeeds, the return value is TRUE.
2698 * If the function fails, the return value is FALSE. To get extended
2699 * error information, call GetLastError.
2700 * Remark :
2701 * Status : UNTESTED STUB
2702 *
2703 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2704 *****************************************************************************/
2705BOOL WIN32API EnumDesktopsA(HWINSTA hWinSta,
2706 DESKTOPENUMPROCA lpEnumFunc,
2707 LPARAM lParam)
2708{
2709 dprintf(("USER32:EnumDesktopsA (%08xh,%08xh,%08x) not implemented.\n",
2710 hWinSta,
2711 lpEnumFunc,
2712 lParam));
2713
2714 return (FALSE);
2715}
2716/*****************************************************************************
2717 * Name : BOOL WIN32API EnumDesktopsW
2718 * Purpose : The EnumDesktops function enumerates all desktops in the window
2719 * station assigned to the calling process. The function does so by
2720 * passing the name of each desktop, in turn, to an application-
2721 * defined callback function.
2722 * Parameters: HWINSTA hwinsta handle of window station to enumerate
2723 * DESKTOPENUMPROC lpEnumFunc points to application's callback function
2724 * LPARAM lParam 32-bit value to pass to the callback function
2725 * Variables :
2726 * Result : If the function succeeds, the return value is TRUE.
2727 * If the function fails, the return value is FALSE. To get extended
2728 * error information, call GetLastError.
2729 * Remark :
2730 * Status : UNTESTED STUB
2731 *
2732 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2733 *****************************************************************************/
2734BOOL WIN32API EnumDesktopsW(HWINSTA hWinSta,
2735 DESKTOPENUMPROCW lpEnumFunc,
2736 LPARAM lParam)
2737{
2738 dprintf(("USER32:EnumDesktopsW (%08xh,%08xh,%08x) not implemented.\n",
2739 hWinSta,
2740 lpEnumFunc,
2741 lParam));
2742
2743 return (FALSE);
2744}
2745/*****************************************************************************
2746 * Name : BOOL WIN32API EnumWindowStationsA
2747 * Purpose : The EnumWindowStations function enumerates all windowstations
2748 * in the system by passing the name of each window station, in
2749 * turn, to an application-defined callback function.
2750 * Parameters:
2751 * Variables : WINSTAENUMPROC lpEnumFunc points to application's callback function
2752 * LPARAM lParam 32-bit value to pass to the callback function
2753 * Result : If the function succeeds, the return value is TRUE.
2754 * If the function fails the return value is FALSE. To get extended
2755 * error information, call GetLastError.
2756 * Remark :
2757 * Status : UNTESTED STUB
2758 *
2759 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2760 *****************************************************************************/
2761BOOL WIN32API EnumWindowStationsA(WINSTAENUMPROCA lpEnumFunc,
2762 LPARAM lParam)
2763{
2764 dprintf(("USER32:EnumWindowStationsA (%08xh,%08x) not implemented.\n",
2765 lpEnumFunc,
2766 lParam));
2767
2768 return (FALSE);
2769}
2770/*****************************************************************************
2771 * Name : BOOL WIN32API EnumWindowStationsW
2772 * Purpose : The EnumWindowStations function enumerates all windowstations
2773 * in the system by passing the name of each window station, in
2774 * turn, to an application-defined callback function.
2775 * Parameters:
2776 * Variables : WINSTAENUMPROC lpEnumFunc points to application's callback function
2777 * LPARAM lParam 32-bit value to pass to the callback function
2778 * Result : If the function succeeds, the return value is TRUE.
2779 * If the function fails the return value is FALSE. To get extended
2780 * error information, call GetLastError.
2781 * Remark :
2782 * Status : UNTESTED STUB
2783 *
2784 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2785 *****************************************************************************/
2786BOOL WIN32API EnumWindowStationsW(WINSTAENUMPROCW lpEnumFunc,
2787 LPARAM lParam)
2788{
2789 dprintf(("USER32:EnumWindowStationsW (%08xh,%08x) not implemented.\n",
2790 lpEnumFunc,
2791 lParam));
2792
2793 return (FALSE);
2794}
2795/*****************************************************************************
2796 * Name : HWINSTA WIN32API GetProcessWindowStation
2797 * Purpose : The GetProcessWindowStation function returns a handle of the
2798 * window station associated with the calling process.
2799 * Parameters:
2800 * Variables :
2801 * Result : If the function succeeds, the return value is a handle of the
2802 * window station associated with the calling process.
2803 * If the function fails, the return value is NULL. This can occur
2804 * if the calling process is not an application written for Windows
2805 * NT. To get extended error information, call GetLastError.
2806 * Remark :
2807 * Status : UNTESTED STUB
2808 *
2809 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2810 *****************************************************************************/
2811HWINSTA WIN32API GetProcessWindowStation(VOID)
2812{
2813 dprintf(("USER32:GetProcessWindowStation () not implemented.\n"));
2814
2815 return (NULL);
2816}
2817/*****************************************************************************
2818 * Name : BOOL WIN32API GetUserObjectInformationA
2819 * Purpose : The GetUserObjectInformation function returns information about
2820 * a window station or desktop object.
2821 * Parameters: HANDLE hObj handle of object to get information for
2822 * int nIndex type of information to get
2823 * PVOID pvInfo points to buffer that receives the information
2824 * DWORD nLength size, in bytes, of pvInfo buffer
2825 * LPDWORD lpnLengthNeeded receives required size, in bytes, of pvInfo buffer
2826 * Variables :
2827 * Result : If the function succeeds, the return value is TRUE.
2828 * If the function fails, the return value is FALSE. To get extended
2829 * error information, call GetLastError.
2830 * Remark :
2831 * Status : UNTESTED STUB
2832 *
2833 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2834 *****************************************************************************/
2835BOOL WIN32API GetUserObjectInformationA(HANDLE hObj,
2836 int nIndex,
2837 PVOID pvInfo,
2838 DWORD nLength,
2839 LPDWORD lpnLengthNeeded)
2840{
2841 dprintf(("USER32:GetUserObjectInformationA (%08xh,%08xh,%08xh,%u,%08x) not implemented.\n",
2842 hObj,
2843 nIndex,
2844 pvInfo,
2845 nLength,
2846 lpnLengthNeeded));
2847
2848 return (FALSE);
2849}
2850/*****************************************************************************
2851 * Name : BOOL WIN32API GetUserObjectInformationW
2852 * Purpose : The GetUserObjectInformation function returns information about
2853 * a window station or desktop object.
2854 * Parameters: HANDLE hObj handle of object to get information for
2855 * int nIndex type of information to get
2856 * PVOID pvInfo points to buffer that receives the information
2857 * DWORD nLength size, in bytes, of pvInfo buffer
2858 * LPDWORD lpnLengthNeeded receives required size, in bytes, of pvInfo buffer
2859 * Variables :
2860 * Result : If the function succeeds, the return value is TRUE.
2861 * If the function fails, the return value is FALSE. To get extended
2862 * error information, call GetLastError.
2863 * Remark :
2864 * Status : UNTESTED STUB
2865 *
2866 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2867 *****************************************************************************/
2868BOOL WIN32API GetUserObjectInformationW(HANDLE hObj,
2869 int nIndex,
2870 PVOID pvInfo,
2871 DWORD nLength,
2872 LPDWORD lpnLengthNeeded)
2873{
2874 dprintf(("USER32:GetUserObjectInformationW (%08xh,%08xh,%08xh,%u,%08x) not implemented.\n",
2875 hObj,
2876 nIndex,
2877 pvInfo,
2878 nLength,
2879 lpnLengthNeeded));
2880
2881 return (FALSE);
2882}
2883/*****************************************************************************
2884 * Name : BOOL WIN32API GetUserObjectSecurity
2885 * Purpose : The GetUserObjectSecurity function retrieves security information
2886 * for the specified user object.
2887 * Parameters: HANDLE hObj handle of user object
2888 * SECURITY_INFORMATION * pSIRequested address of requested security information
2889 * LPSECURITY_DESCRIPTOR pSID address of security descriptor
2890 * DWORD nLength size of buffer for security descriptor
2891 * LPDWORD lpnLengthNeeded address of required size of buffer
2892 * Variables :
2893 * Result : If the function succeeds, the return value is TRUE.
2894 * If the function fails, the return value is FALSE. To get extended
2895 * error information, call GetLastError.
2896 * Remark :
2897 * Status : UNTESTED STUB
2898 *
2899 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2900 *****************************************************************************/
2901BOOL WIN32API GetUserObjectSecurity(HANDLE hObj,
2902 SECURITY_INFORMATION * pSIRequested,
2903 LPSECURITY_DESCRIPTOR pSID,
2904 DWORD nLength,
2905 LPDWORD lpnLengthNeeded)
2906{
2907 dprintf(("USER32:GetUserObjectSecurity (%08xh,%08xh,%08xh,%u,%08x) not implemented.\n",
2908 hObj,
2909 pSIRequested,
2910 pSID,
2911 nLength,
2912 lpnLengthNeeded));
2913
2914 return (FALSE);
2915}
2916/*****************************************************************************
2917 * Name : HDESK WIN32API OpenDesktopA
2918 * Purpose : The OpenDesktop function returns a handle to an existing desktop.
2919 * A desktop is a secure object contained within a window station
2920 * object. A desktop has a logical display surface and contains
2921 * windows, menus and hooks.
2922 * Parameters: LPCTSTR lpszDesktopName name of the desktop to open
2923 * DWORD dwFlags flags to control interaction with other applications
2924 * BOOL fInherit specifies whether returned handle is inheritable
2925 * DWORD dwDesiredAccess specifies access of returned handle
2926 * Variables :
2927 * Result : If the function succeeds, the return value is the handle to the
2928 * opened desktop.
2929 * If the function fails, the return value is NULL. To get extended
2930 * error information, call GetLastError.
2931 * Remark :
2932 * Status : UNTESTED STUB
2933 *
2934 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2935 *****************************************************************************/
2936HDESK WIN32API OpenDesktopA(LPCTSTR lpszDesktopName,
2937 DWORD dwFlags,
2938 BOOL fInherit,
2939 DWORD dwDesiredAccess)
2940{
2941 dprintf(("USER32:OpenDesktopA (%s,%08xh,%08xh,%08x) not implemented.\n",
2942 lpszDesktopName,
2943 dwFlags,
2944 fInherit,
2945 dwDesiredAccess));
2946
2947 return (NULL);
2948}
2949/*****************************************************************************
2950 * Name : HDESK WIN32API OpenDesktopW
2951 * Purpose : The OpenDesktop function returns a handle to an existing desktop.
2952 * A desktop is a secure object contained within a window station
2953 * object. A desktop has a logical display surface and contains
2954 * windows, menus and hooks.
2955 * Parameters: LPCTSTR lpszDesktopName name of the desktop to open
2956 * DWORD dwFlags flags to control interaction with other applications
2957 * BOOL fInherit specifies whether returned handle is inheritable
2958 * DWORD dwDesiredAccess specifies access of returned handle
2959 * Variables :
2960 * Result : If the function succeeds, the return value is the handle to the
2961 * opened desktop.
2962 * If the function fails, the return value is NULL. To get extended
2963 * error information, call GetLastError.
2964 * Remark :
2965 * Status : UNTESTED STUB
2966 *
2967 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2968 *****************************************************************************/
2969HDESK WIN32API OpenDesktopW(LPCTSTR lpszDesktopName,
2970 DWORD dwFlags,
2971 BOOL fInherit,
2972 DWORD dwDesiredAccess)
2973{
2974 dprintf(("USER32:OpenDesktopW (%s,%08xh,%08xh,%08x) not implemented.\n",
2975 lpszDesktopName,
2976 dwFlags,
2977 fInherit,
2978 dwDesiredAccess));
2979
2980 return (NULL);
2981}
2982/*****************************************************************************
2983 * Name : HDESK WIN32API OpenInputDesktop
2984 * Purpose : The OpenInputDesktop function returns a handle to the desktop
2985 * that receives user input. The input desktop is a desktop on the
2986 * window station associated with the logged-on user.
2987 * Parameters: DWORD dwFlags flags to control interaction with other applications
2988 * BOOL fInherit specifies whether returned handle is inheritable
2989 * DWORD dwDesiredAccess specifies access of returned handle
2990 * Variables :
2991 * Result : If the function succeeds, the return value is a handle of the
2992 * desktop that receives user input.
2993 * If the function fails, the return value is NULL. To get extended
2994 * error information, call GetLastError.
2995 * Remark :
2996 * Status : UNTESTED STUB
2997 *
2998 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2999 *****************************************************************************/
3000HDESK WIN32API OpenInputDesktop(DWORD dwFlags,
3001 BOOL fInherit,
3002 DWORD dwDesiredAccess)
3003{
3004 dprintf(("USER32:OpenInputDesktop (%08xh,%08xh,%08x) not implemented.\n",
3005 dwFlags,
3006 fInherit,
3007 dwDesiredAccess));
3008
3009 return (NULL);
3010}
3011/*****************************************************************************
3012 * Name : HWINSTA WIN32API OpenWindowStationA
3013 * Purpose : The OpenWindowStation function returns a handle to an existing
3014 * window station.
3015 * Parameters: LPCTSTR lpszWinStaName name of the window station to open
3016 * BOOL fInherit specifies whether returned handle is inheritable
3017 * DWORD dwDesiredAccess specifies access of returned handle
3018 * Variables :
3019 * Result : If the function succeeds, the return value is the handle to the
3020 * specified window station.
3021 * If the function fails, the return value is NULL. To get extended
3022 * error information, call GetLastError.
3023 * Remark :
3024 * Status : UNTESTED STUB
3025 *
3026 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3027 *****************************************************************************/
3028HWINSTA WIN32API OpenWindowStationA(LPCTSTR lpszWinStaName,
3029 BOOL fInherit,
3030 DWORD dwDesiredAccess)
3031{
3032 dprintf(("USER32:OpenWindowStatieonA (%s,%08xh,%08x) not implemented.\n",
3033 lpszWinStaName,
3034 fInherit,
3035 dwDesiredAccess));
3036
3037 return (NULL);
3038}
3039/*****************************************************************************
3040 * Name : HWINSTA WIN32API OpenWindowStationW
3041 * Purpose : The OpenWindowStation function returns a handle to an existing
3042 * window station.
3043 * Parameters: LPCTSTR lpszWinStaName name of the window station to open
3044 * BOOL fInherit specifies whether returned handle is inheritable
3045 * DWORD dwDesiredAccess specifies access of returned handle
3046 * Variables :
3047 * Result : If the function succeeds, the return value is the handle to the
3048 * specified window station.
3049 * If the function fails, the return value is NULL. To get extended
3050 * error information, call GetLastError.
3051
3052
3053 * Remark :
3054 * Status : UNTESTED STUB
3055 *
3056 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3057 *****************************************************************************/
3058HWINSTA WIN32API OpenWindowStationW(LPCTSTR lpszWinStaName,
3059 BOOL fInherit,
3060 DWORD dwDesiredAccess)
3061{
3062 dprintf(("USER32:OpenWindowStatieonW (%s,%08xh,%08x) not implemented.\n",
3063 lpszWinStaName,
3064 fInherit,
3065 dwDesiredAccess));
3066
3067 return (NULL);
3068}
3069/*****************************************************************************
3070 * Name : BOOL WIN32API SetProcessWindowStation
3071 * Purpose : The SetProcessWindowStation function assigns a window station
3072 * to the calling process. This enables the process to access
3073 * objects in the window station such as desktops, the clipboard,
3074 * and global atoms. All subsequent operations on the window station
3075 * use the access rights granted to hWinSta.
3076 * Parameters:
3077 * Variables :
3078 * Result : If the function succeeds, the return value is TRUE.
3079 * If the function fails, the return value is FALSE. To get extended
3080 * error information, call GetLastError.
3081 * Remark :
3082 * Status : UNTESTED STUB
3083 *
3084 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3085 *****************************************************************************/
3086BOOL WIN32API SetProcessWindowStation(HWINSTA hWinSta)
3087{
3088 dprintf(("USER32:SetProcessWindowStation (%08x) not implemented.\n",
3089 hWinSta));
3090
3091 return (FALSE);
3092}
3093/*****************************************************************************
3094 * Name : BOOL WIN32API SetThreadDesktop
3095 * Purpose : The SetThreadDesktop function assigns a desktop to the calling
3096 * thread. All subsequent operations on the desktop use the access
3097 * rights granted to hDesk.
3098 * Parameters: HDESK hDesk handle of the desktop to assign to this thread
3099 * Variables :
3100 * Result : If the function succeeds, the return value is TRUE.
3101 * If the function fails, the return value is FALSE. To get extended
3102 * error information, call GetLastError.
3103 * Remark :
3104 * Status : UNTESTED STUB
3105 *
3106 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3107 *****************************************************************************/
3108BOOL WIN32API SetThreadDesktop(HDESK hDesktop)
3109{
3110 dprintf(("USER32:SetThreadDesktop (%08x) not implemented.\n",
3111 hDesktop));
3112
3113 return (FALSE);
3114}
3115/*****************************************************************************
3116 * Name : BOOL WIN32API SetUserObjectInformationA
3117 * Purpose : The SetUserObjectInformation function sets information about a
3118 * window station or desktop object.
3119 * Parameters: HANDLE hObject handle of the object for which to set information
3120 * int nIndex type of information to set
3121 * PVOID lpvInfo points to a buffer that contains the information
3122 * DWORD cbInfo size, in bytes, of lpvInfo buffer
3123 * Variables :
3124 * Result : If the function succeeds, the return value is TRUE.
3125 * If the function fails the return value is FALSE. To get extended
3126 * error information, call GetLastError.
3127 * Remark :
3128 * Status : UNTESTED STUB
3129 *
3130 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3131 *****************************************************************************/
3132BOOL WIN32API SetUserObjectInformationA(HANDLE hObject,
3133 int nIndex,
3134 PVOID lpvInfo,
3135 DWORD cbInfo)
3136{
3137 dprintf(("USER32:SetUserObjectInformationA (%08xh,%u,%08xh,%08x) not implemented.\n",
3138 hObject,
3139 nIndex,
3140 lpvInfo,
3141 cbInfo));
3142
3143 return (FALSE);
3144}
3145/*****************************************************************************
3146 * Name : BOOL WIN32API SetUserObjectInformationW
3147 * Purpose : The SetUserObjectInformation function sets information about a
3148 * window station or desktop object.
3149 * Parameters: HANDLE hObject handle of the object for which to set information
3150 * int nIndex type of information to set
3151 * PVOID lpvInfo points to a buffer that contains the information
3152 * DWORD cbInfo size, in bytes, of lpvInfo buffer
3153 * Variables :
3154 * Result : If the function succeeds, the return value is TRUE.
3155 * If the function fails the return value is FALSE. To get extended
3156 * error information, call GetLastError.
3157 * Remark :
3158 * Status : UNTESTED STUB
3159 *
3160 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3161 *****************************************************************************/
3162BOOL WIN32API SetUserObjectInformationW(HANDLE hObject,
3163 int nIndex,
3164 PVOID lpvInfo,
3165 DWORD cbInfo)
3166{
3167 dprintf(("USER32:SetUserObjectInformationW (%08xh,%u,%08xh,%08x) not implemented.\n",
3168 hObject,
3169 nIndex,
3170 lpvInfo,
3171 cbInfo));
3172
3173 return (FALSE);
3174}
3175/*****************************************************************************
3176 * Name : BOOL WIN32API SetUserObjectSecurity
3177 * Purpose : The SetUserObjectSecurity function sets the security of a user
3178 * object. This can be, for example, a window or a DDE conversation
3179 * Parameters: HANDLE hObject handle of user object
3180 * SECURITY_INFORMATION * psi address of security information
3181 * LPSECURITY_DESCRIPTOR psd address of security descriptor
3182 * Variables :
3183 * Result : If the function succeeds, the return value is TRUE.
3184 * If the function fails, the return value is FALSE. To get extended
3185 * error information, call GetLastError.
3186 * Remark :
3187 * Status : UNTESTED STUB
3188 *
3189 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3190 *****************************************************************************/
3191BOOL WIN32API SetUserObjectSecurity(HANDLE hObject,
3192 SECURITY_INFORMATION * psi,
3193 LPSECURITY_DESCRIPTOR psd)
3194{
3195 dprintf(("USER32:SetUserObjectSecuroty (%08xh,%08xh,%08x) not implemented.\n",
3196 hObject,
3197 psi,
3198 psd));
3199
3200 return (FALSE);
3201}
3202/*****************************************************************************
3203 * Name : BOOL WIN32API SwitchDesktop
3204 * Purpose : The SwitchDesktop function makes a desktop visible and activates
3205 * it. This enables the desktop to receive input from the user. The
3206 * calling process must have DESKTOP_SWITCHDESKTOP access to the
3207 * desktop for the SwitchDesktop function to succeed.
3208 * Parameters:
3209 * Variables :
3210 * Result : If the function succeeds, the return value is TRUE.
3211 * If the function fails, the return value is FALSE. To get extended
3212 * error information, call GetLastError.
3213 * Remark :
3214 * Status : UNTESTED STUB
3215 *
3216 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3217 *****************************************************************************/
3218BOOL WIN32API SwitchDesktop(HDESK hDesktop)
3219{
3220 dprintf(("USER32:SwitchDesktop (%08x) not implemented.\n",
3221 hDesktop));
3222
3223 return (FALSE);
3224}
3225
3226/* Debugging Functions */
3227
3228/*****************************************************************************
3229 * Name : VOID WIN32API SetDebugErrorLevel
3230 * Purpose : The SetDebugErrorLevel function sets the minimum error level at
3231 * which Windows will generate debugging events and pass them to a debugger.
3232 * Parameters: DWORD dwLevel debugging error level
3233 * Variables :
3234 * Result :
3235 * Remark :
3236 * Status : UNTESTED STUB
3237 *
3238 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3239 *****************************************************************************/
3240VOID WIN32API SetDebugErrorLevel(DWORD dwLevel)
3241{
3242 dprintf(("USER32:SetDebugErrorLevel (%08x) not implemented.\n",
3243 dwLevel));
3244}
3245
3246/* Hook Functions */
3247
3248/*****************************************************************************
3249 * Name : BOOL WIN32API SetWindowsHookW
3250 * Purpose : The SetWindowsHook function is not implemented in the Win32 API.
3251 * Win32-based applications should use the SetWindowsHookEx function.
3252 * Parameters:
3253 * Variables :
3254 * Result :
3255 * Remark : ARGH ! MICROSOFT !
3256 * Status : UNTESTED STUB
3257 *
3258 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3259 *****************************************************************************/
3260HHOOK WIN32API SetWindowsHookW(int nFilterType, HOOKPROC pfnFilterProc)
3261
3262{
3263 return (FALSE);
3264}
3265
3266/* CB: move to ShowWindow() */
3267
3268/*****************************************************************************
3269 * Name : BOOL WIN32API ShowWindowAsync
3270 * Purpose : The ShowWindowAsync function sets the show state of a window
3271 * created by a different thread.
3272 * Parameters: HWND hwnd handle of window
3273 * int nCmdShow show state of window
3274 * Variables :
3275 * Result : If the window was previously visible, the return value is TRUE.
3276 * If the window was previously hidden, the return value is FALSE.
3277 * Remark :
3278 * Status : UNTESTED STUB
3279 *
3280 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3281 *****************************************************************************/
3282BOOL WIN32API ShowWindowAsync (HWND hWnd,
3283 int nCmdShow)
3284{
3285 dprintf(("USER32:ShowWindowAsync (%08xh,%08x) not implemented.\n",
3286 hWnd,
3287 nCmdShow));
3288
3289 return (FALSE);
3290}
3291
3292/* CB: move to MDI */
3293
3294/*****************************************************************************
3295 * Name : WORD WIN32API TileWindows
3296 * Purpose : The TileWindows function tiles the specified windows, or the child
3297 * windows of the specified parent window.
3298 * Parameters: HWND hwndParent handle of parent window
3299 * WORD wFlags types of windows not to arrange
3300 * LPCRECT lpRect rectangle to arrange windows in
3301 * WORD cChildrenb number of windows to arrange
3302 * const HWND *ahwndChildren array of window handles
3303 * Variables :
3304 * Result : If the function succeeds, the return value is the number of
3305 * windows arranged.
3306 * If the function fails, the return value is zero.
3307 * Remark :
3308 * Status : UNTESTED STUB
3309 *
3310 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3311 *****************************************************************************/
3312WORD WIN32API TileWindows(HWND hwndParent,
3313 UINT wFlags,
3314 const LPRECT lpRect,
3315 UINT cChildrenb,
3316 const HWND *ahwndChildren)
3317{
3318 dprintf(("USER32:TileWindows (%08xh,%08xh,%08xh,%08xh,%08x) not implemented.\n",
3319 hwndParent,
3320 wFlags,
3321 lpRect,
3322 cChildrenb,
3323 ahwndChildren));
3324
3325 return (0);
3326}
3327/*****************************************************************************
3328 * Name : BOOL WIN32API TileChildWindows
3329 * Purpose : Unknown
3330 * Parameters: Unknown
3331 * Variables :
3332 * Result :
3333 * Remark :
3334 * Status : UNTESTED UNKNOWN STUB
3335 *
3336 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3337 *****************************************************************************/
3338BOOL WIN32API TileChildWindows(DWORD x1,
3339 DWORD x2)
3340{
3341 dprintf(("USER32: TileChildWindows(%08xh,%08xh) not implemented.\n",
3342 x1,
3343 x2));
3344
3345 return (FALSE); /* default */
3346}
3347/*****************************************************************************
3348 * Name : BOOL WIN32API CascadeChildWindows
3349 * Purpose : Unknown
3350 * Parameters: Unknown
3351 * Variables :
3352 * Result :
3353 * Remark :
3354 * Status : UNTESTED UNKNOWN STUB
3355 *
3356 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3357 *****************************************************************************/
3358BOOL WIN32API CascadeChildWindows(DWORD x1,
3359 DWORD x2)
3360{
3361 dprintf(("USER32: CascadeChildWindows(%08xh,%08xh) not implemented.\n",
3362 x1,
3363 x2));
3364
3365 return (FALSE); /* default */
3366}
3367
3368/* Drag'n'drop */
3369
3370/*****************************************************************************
3371 * Name : BOOL WIN32API DragObject
3372 * Purpose : Unknown
3373 * Parameters: Unknown
3374 * Variables :
3375 * Result :
3376 * Remark :
3377 * Status : UNTESTED UNKNOWN STUB
3378 *
3379 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3380 *****************************************************************************/
3381DWORD WIN32API DragObject(HWND x1,HWND x2,UINT x3,DWORD x4,HCURSOR x5)
3382{
3383 dprintf(("USER32: DragObject(%08x,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
3384 x1,
3385 x2,
3386 x3,
3387 x4,
3388 x5));
3389
3390 return (FALSE); /* default */
3391}
3392
3393/* Unknown */
3394
3395/*****************************************************************************
3396 * Name : BOOL WIN32API SetShellWindow
3397 * Purpose : Unknown
3398 * Parameters: Unknown
3399 * Variables :
3400 * Result :
3401 * Remark :
3402 * Status : UNTESTED UNKNOWN STUB
3403 *
3404 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3405 *****************************************************************************/
3406BOOL WIN32API SetShellWindow(DWORD x1)
3407{
3408 dprintf(("USER32: SetShellWindow(%08x) not implemented.\n",
3409 x1));
3410
3411 return (FALSE); /* default */
3412}
3413/*****************************************************************************
3414 * Name : BOOL WIN32API PlaySoundEvent
3415 * Purpose : Unknown
3416 * Parameters: Unknown
3417 * Variables :
3418 * Result :
3419 * Remark :
3420 * Status : UNTESTED UNKNOWN STUB
3421 *
3422 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3423 *****************************************************************************/
3424BOOL WIN32API PlaySoundEvent(DWORD x1)
3425{
3426 dprintf(("USER32: PlaySoundEvent(%08x) not implemented.\n",
3427 x1));
3428
3429 return (FALSE); /* default */
3430}
3431/*****************************************************************************
3432 * Name : BOOL WIN32API SetSysColorsTemp
3433 * Purpose : Unknown
3434 * Parameters: Unknown
3435 * Variables :
3436 * Result :
3437 * Remark :
3438 * Status : UNTESTED UNKNOWN STUB
3439 *
3440 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3441 *****************************************************************************/
3442BOOL WIN32API SetSysColorsTemp(void)
3443{
3444 dprintf(("USER32: SetSysColorsTemp() not implemented.\n"));
3445
3446 return (FALSE); /* default */
3447}
3448/*****************************************************************************
3449 * Name : BOOL WIN32API RegisterNetworkCapabilities
3450 * Purpose : Unknown
3451 * Parameters: Unknown
3452 * Variables :
3453 * Result :
3454 * Remark :
3455 * Status : UNTESTED UNKNOWN STUB
3456 *
3457 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3458 *****************************************************************************/
3459BOOL WIN32API RegisterNetworkCapabilities(DWORD x1,
3460 DWORD x2)
3461{
3462 dprintf(("USER32: RegisterNetworkCapabilities(%08xh,%08xh) not implemented.\n",
3463 x1,
3464 x2));
3465
3466 return (FALSE); /* default */
3467}
3468/*****************************************************************************
3469 * Name : BOOL WIN32API EndTask
3470 * Purpose : Unknown
3471 * Parameters: Unknown
3472 * Variables :
3473 * Result :
3474 * Remark :
3475 * Status : UNTESTED UNKNOWN STUB
3476 *
3477 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3478 *****************************************************************************/
3479BOOL WIN32API EndTask(DWORD x1,
3480 DWORD x2,
3481 DWORD x3)
3482{
3483 dprintf(("USER32: EndTask(%08xh,%08xh,%08xh) not implemented.\n",
3484 x1,
3485 x2,
3486 x3));
3487
3488 return (FALSE); /* default */
3489}
3490/*****************************************************************************
3491 * Name : BOOL WIN32API GetNextQueueWindow
3492 * Purpose : Unknown
3493 * Parameters: Unknown
3494 * Variables :
3495 * Result :
3496 * Remark :
3497 * Status : UNTESTED UNKNOWN STUB
3498 *
3499 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3500 *****************************************************************************/
3501BOOL WIN32API GetNextQueueWindow(DWORD x1,
3502 DWORD x2)
3503{
3504 dprintf(("USER32: GetNextQueueWindow(%08xh,%08xh) not implemented.\n",
3505 x1,
3506 x2));
3507
3508 return (FALSE); /* default */
3509}
3510/*****************************************************************************
3511 * Name : BOOL WIN32API YieldTask
3512 * Purpose : Unknown
3513 * Parameters: Unknown
3514 * Variables :
3515 * Result :
3516 * Remark :
3517 * Status : UNTESTED UNKNOWN STUB
3518 *
3519 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3520 *****************************************************************************/
3521BOOL WIN32API YieldTask(void)
3522{
3523 dprintf(("USER32: YieldTask() not implemented.\n"));
3524
3525 return (FALSE); /* default */
3526}
3527/*****************************************************************************
3528 * Name : BOOL WIN32API WinOldAppHackoMatic
3529 * Purpose : Unknown
3530 * Parameters: Unknown
3531 * Variables :
3532 * Result :
3533 * Remark :
3534 * Status : UNTESTED UNKNOWN STUB
3535 *
3536 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3537 *****************************************************************************/
3538BOOL WIN32API WinOldAppHackoMatic(DWORD x1)
3539{
3540 dprintf(("USER32: WinOldAppHackoMatic(%08x) not implemented.\n",
3541 x1));
3542
3543 return (FALSE); /* default */
3544}
3545/*****************************************************************************
3546 * Name : BOOL WIN32API RegisterSystemThread
3547 * Purpose : Unknown
3548 * Parameters: Unknown
3549 * Variables :
3550 * Result :
3551 * Remark :
3552 * Status : UNTESTED UNKNOWN STUB
3553 *
3554 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3555 *****************************************************************************/
3556BOOL WIN32API RegisterSystemThread(DWORD x1,
3557 DWORD x2)
3558{
3559 dprintf(("USER32: RegisterSystemThread(%08xh,%08xh) not implemented.\n",
3560 x1,
3561 x2));
3562
3563 return (FALSE); /* default */
3564}
3565/*****************************************************************************
3566 * Name : BOOL WIN32API IsHungThread
3567 * Purpose : Unknown
3568 * Parameters: Unknown
3569 * Variables :
3570 * Result :
3571 * Remark :
3572 * Status : UNTESTED UNKNOWN STUB
3573 *
3574 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3575 *****************************************************************************/
3576BOOL WIN32API IsHungThread(DWORD x1)
3577{
3578 dprintf(("USER32: IsHungThread(%08xh) not implemented.\n",
3579 x1));
3580
3581 return (FALSE); /* default */
3582}
3583/*****************************************************************************
3584 * Name : BOOL WIN32API UserSignalProc
3585 * Purpose : Unknown
3586 * Parameters: Unknown
3587 * Variables :
3588 * Result :
3589 * Remark :
3590 * Status : UNTESTED UNKNOWN STUB
3591 *
3592 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3593 *****************************************************************************/
3594BOOL WIN32API UserSignalProc(DWORD x1,
3595 DWORD x2,
3596 DWORD x3,
3597 DWORD x4)
3598{
3599 dprintf(("USER32: SysErrorBox(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
3600 x1,
3601 x2,
3602 x3,
3603 x4));
3604
3605 return (FALSE); /* default */
3606}
3607/*****************************************************************************
3608 * Name : BOOL WIN32API GetShellWindow
3609 * Purpose : Unknown
3610 * Parameters: Unknown
3611 * Variables :
3612 * Result :
3613 * Remark :
3614 * Status : UNTESTED UNKNOWN STUB
3615 *
3616 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3617 *****************************************************************************/
3618HWND WIN32API GetShellWindow(void)
3619{
3620 dprintf(("USER32: GetShellWindow() not implemented.\n"));
3621
3622 return (0); /* default */
3623}
3624/***********************************************************************
3625 * RegisterTasklist32 [USER32.436]
3626 */
3627DWORD WIN32API RegisterTasklist (DWORD x)
3628{
3629 dprintf(("USER32: RegisterTasklist(%08xh) not implemented.\n",
3630 x));
3631
3632 return TRUE;
3633}
3634
3635
Note: See TracBrowser for help on using the repository browser.