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

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

Fix: parameter checking in RedrawWindow and temp fix for MsgWaitForMultipleObjects

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