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

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

MapDialogRect fix

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