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

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

Window rectange fixes + partly implemented CopyImage

File size: 132.9 KB
Line 
1/* $Id: user32.cpp,v 1.42 1999-10-14 19:31:31 sandervl Exp $ */
2
3/*
4 * Win32 misc user32 API functions for OS/2
5 *
6 * Copyright 1998 Sander van Leeuwen
7 * Copyright 1998 Patrick Haller
8 * Copyright 1998 Peter Fitzsimmons
9 * Copyright 1999 Christoph Bratschi
10 * Copyright 1999 Daniela Engert (dani@ngrt.de)
11 *
12 *
13 * Project Odin Software License can be found in LICENSE.TXT
14 *
15 */
16/*****************************************************************************
17 * Name : USER32.CPP
18 * Purpose : This module maps all Win32 functions contained in USER32.DLL
19 * to their OS/2-specific counterparts as far as possible.
20 *****************************************************************************/
21
22//Attention: many functions belong to other subsystems, move them to their
23// right place!
24
25#include <odin.h>
26#include <odinwrap.h>
27#include <os2sel.h>
28
29#include <os2win.h>
30#include "misc.h"
31
32#include "user32.h"
33#include <winicon.h>
34#include "syscolor.h"
35
36#include <wchar.h>
37#include <stdlib.h>
38#include <string.h>
39#include <oslibwin.h>
40#include <win32wnd.h>
41#include <winuser.h>
42
43//undocumented stuff
44// WIN32API CalcChildScroll
45// WIN32API CascadeChildWindows
46// WIN32API ClientThreadConnect
47// WIN32API DragObject
48// WIN32API DrawFrame
49// WIN32API EditWndProc
50// WIN32API EndTask
51// WIN32API GetInputDesktop
52// WIN32API GetNextQueueWindow
53// WIN32API GetShellWindow
54// WIN32API InitSharedTable
55// WIN32API InitTask
56// WIN32API IsHungThread
57// WIN32API LockWindowStation
58// WIN32API ModifyAccess
59// WIN32API PlaySoundEvent
60// WIN32API RegisterLogonProcess
61// WIN32API RegisterNetworkCapabilities
62// WIN32API RegisterSystemThread
63// WIN32API SetDeskWallpaper
64// WIN32API SetDesktopBitmap
65// WIN32API SetInternalWindowPos
66// WIN32API SetLogonNotifyWindow
67// WIN32API SetShellWindow
68// WIN32API SetSysColorsTemp
69// WIN32API SetWindowFullScreenState
70// WIN32API SwitchToThisWindow
71// WIN32API SysErrorBox
72// WIN32API TileChildWindows
73// WIN32API UnlockWindowStation
74// WIN32API UserClientDllInitialize
75// WIN32API UserSignalProc
76// WIN32API WinOldAppHackoMatic
77// WIN32API WNDPROC_CALLBACK
78// WIN32API YieldTask
79
80ODINDEBUGCHANNEL(USER32-USER32)
81
82
83/* Coordinate Transformation */
84
85inline void OS2ToWin32ScreenPos(POINT *dest,POINT *source)
86{
87 dest->x = source->x;
88 dest->y = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CYSCREEN)-1-source->y;
89}
90
91inline void Win32ToOS2ScreenPos(POINT *dest,POINT *source)
92{
93 OS2ToWin32ScreenPos(dest,source); //transform back
94}
95
96/* Rectangle Functions - parts from wine/windows/rect.c */
97
98BOOL WIN32API CopyRect( PRECT lprcDst, const RECT * lprcSrc)
99{
100// ddprintf(("USER32: CopyRect\n"));
101 if (!lprcDst || !lprcSrc) {
102 SetLastError(ERROR_INVALID_PARAMETER);
103 return FALSE;
104 }
105
106 memcpy(lprcDst,lprcSrc,sizeof(RECT));
107
108 return TRUE;
109}
110//******************************************************************************
111//******************************************************************************
112BOOL WIN32API EqualRect( const RECT *lprc1, const RECT *lprc2)
113{
114#ifdef DEBUG
115 WriteLog("USER32: EqualRect\n");
116#endif
117 if (!lprc1 || !lprc2)
118 {
119 SetLastError(ERROR_INVALID_PARAMETER);
120 return FALSE;
121 }
122
123 return (lprc1->left == lprc2->left &&
124 lprc1->right == lprc2->right &&
125 lprc1->top == lprc2->top &&
126 lprc1->bottom == lprc2->bottom);
127}
128//******************************************************************************
129//******************************************************************************
130BOOL WIN32API InflateRect( PRECT lprc, int dx, int dy)
131{
132#ifdef DEBUG
133 WriteLog("USER32: InflateRect\n");
134#endif
135 if (!lprc)
136 {
137 SetLastError(ERROR_INVALID_PARAMETER);
138 return FALSE;
139 }
140
141 lprc->left -= dx;
142 lprc->right += dx;
143 lprc->top -= dy;
144 lprc->bottom += dy;
145
146 return TRUE;
147}
148//******************************************************************************
149//******************************************************************************
150BOOL WIN32API IntersectRect( PRECT lprcDst, const RECT * lprcSrc1, const RECT * lprcSrc2)
151{
152#ifdef DEBUG
153//// WriteLog("USER32: IntersectRect\n");
154#endif
155 if (!lprcDst || !lprcSrc1 || !lprcSrc2)
156 {
157 SetLastError(ERROR_INVALID_PARAMETER);
158 return FALSE;
159 }
160
161 if (IsRectEmpty(lprcSrc1) || IsRectEmpty(lprcSrc2) ||
162 (lprcSrc1->left >= lprcSrc2->right) || (lprcSrc2->left >= lprcSrc1->right) ||
163 (lprcSrc1->top >= lprcSrc2->bottom) || (lprcSrc2->top >= lprcSrc1->bottom))
164 {
165 SetLastError(ERROR_INVALID_PARAMETER);
166 SetRectEmpty(lprcDst);
167 return FALSE;
168 }
169 lprcDst->left = MAX(lprcSrc1->left,lprcSrc2->left);
170 lprcDst->right = MIN(lprcSrc1->right,lprcSrc2->right);
171 lprcDst->top = MAX(lprcSrc1->top,lprcSrc2->top);
172 lprcDst->bottom = MIN(lprcSrc1->bottom,lprcSrc2->bottom);
173
174 return TRUE;
175}
176//******************************************************************************
177//******************************************************************************
178BOOL WIN32API IsRectEmpty( const RECT * lprc)
179{
180 if (!lprc)
181 {
182 SetLastError(ERROR_INVALID_PARAMETER);
183 return FALSE;
184 }
185
186 return (lprc->left == lprc->right || lprc->top == lprc->bottom);
187}
188//******************************************************************************
189//******************************************************************************
190BOOL WIN32API OffsetRect( PRECT lprc, int x, int y)
191{
192#ifdef DEBUG
193//// WriteLog("USER32: OffsetRect\n");
194#endif
195 if (!lprc)
196 {
197 SetLastError(ERROR_INVALID_PARAMETER);
198 return FALSE;
199 }
200
201 lprc->left += x;
202 lprc->right += x;
203 lprc->top += y;
204 lprc->bottom += y;
205
206 return TRUE;
207}
208//******************************************************************************
209//******************************************************************************
210BOOL WIN32API PtInRect( const RECT *lprc, POINT pt)
211{
212#ifdef DEBUG1
213 WriteLog("USER32: PtInRect\n");
214#endif
215 if (!lprc)
216 {
217 SetLastError(ERROR_INVALID_PARAMETER);
218 return FALSE;
219 }
220
221 return (pt.x >= lprc->left &&
222 pt.x < lprc->right &&
223 pt.y >= lprc->top &&
224 pt.y < lprc->bottom);
225}
226//******************************************************************************
227//******************************************************************************
228BOOL WIN32API SetRect( PRECT lprc, int nLeft, int nTop, int nRight, int nBottom)
229{
230 if (!lprc)
231 {
232 SetLastError(ERROR_INVALID_PARAMETER);
233 return FALSE;
234 }
235
236 lprc->left = nLeft;
237 lprc->top = nTop;
238 lprc->right = nRight;
239 lprc->bottom = nBottom;
240
241 return TRUE;
242}
243//******************************************************************************
244//******************************************************************************
245BOOL WIN32API SetRectEmpty( PRECT lprc)
246{
247 if (!lprc)
248 {
249 SetLastError(ERROR_INVALID_PARAMETER);
250 return FALSE;
251 }
252
253 lprc->left = lprc->right = lprc->top = lprc->bottom = 0;
254
255 return TRUE;
256}
257//******************************************************************************
258//******************************************************************************
259BOOL WIN32API SubtractRect( PRECT lprcDest, const RECT * lprcSrc1, const RECT * lprcSrc2)
260{
261#ifdef DEBUG
262 WriteLog("USER32: SubtractRect");
263#endif
264 RECT tmp;
265
266 if (!lprcDest || !lprcSrc1 || !lprcSrc2)
267 {
268 SetLastError(ERROR_INVALID_PARAMETER);
269 return FALSE;
270 }
271
272 if (IsRectEmpty(lprcSrc1))
273 {
274 SetLastError(ERROR_INVALID_PARAMETER);
275 SetRectEmpty(lprcDest);
276 return FALSE;
277 }
278 *lprcDest = *lprcSrc1;
279 if (IntersectRect(&tmp,lprcSrc1,lprcSrc2))
280 {
281 if (EqualRect(&tmp,lprcDest))
282 {
283 SetRectEmpty(lprcDest);
284 return FALSE;
285 }
286 if ((tmp.top == lprcDest->top) && (tmp.bottom == lprcDest->bottom))
287 {
288 if (tmp.left == lprcDest->left) lprcDest->left = tmp.right;
289 else if (tmp.right == lprcDest->right) lprcDest->right = tmp.left;
290 }
291 else if ((tmp.left == lprcDest->left) && (tmp.right == lprcDest->right))
292 {
293 if (tmp.top == lprcDest->top) lprcDest->top = tmp.bottom;
294 else if (tmp.bottom == lprcDest->bottom) lprcDest->bottom = tmp.top;
295 }
296 }
297
298 return TRUE;
299}
300//******************************************************************************
301//******************************************************************************
302BOOL WIN32API UnionRect( PRECT lprcDst, const RECT *lprcSrc1, const RECT *lprcSrc2)
303{
304#ifdef DEBUG
305 WriteLog("USER32: UnionRect\n");
306#endif
307 if (!lprcDst || !lprcSrc1 || !lprcSrc2)
308 {
309 SetLastError(ERROR_INVALID_PARAMETER);
310 return FALSE;
311 }
312
313 if (IsRectEmpty(lprcSrc1))
314 {
315 if (IsRectEmpty(lprcSrc2))
316 {
317 SetLastError(ERROR_INVALID_PARAMETER);
318 SetRectEmpty(lprcDst);
319 return FALSE;
320 }
321 else *lprcDst = *lprcSrc2;
322 }
323 else
324 {
325 if (IsRectEmpty(lprcSrc2)) *lprcDst = *lprcSrc1;
326 else
327 {
328 lprcDst->left = MIN(lprcSrc1->left,lprcSrc2->left);
329 lprcDst->right = MAX(lprcSrc1->right,lprcSrc2->right);
330 lprcDst->top = MIN(lprcSrc1->top,lprcSrc2->top);
331 lprcDst->bottom = MAX(lprcSrc1->bottom,lprcSrc2->bottom);
332 }
333 }
334
335 return TRUE;
336}
337
338/* String Manipulation Functions */
339
340int __cdecl wsprintfA(char *lpOut, LPCSTR lpFmt, ...)
341{
342 int rc;
343 va_list argptr;
344
345#ifdef DEBUG
346 WriteLog("USER32: wsprintfA\n");
347 WriteLog("USER32: %s\n", lpFmt);
348#endif
349 va_start(argptr, lpFmt);
350 rc = O32_wvsprintf(lpOut, (char *)lpFmt, argptr);
351 va_end(argptr);
352#ifdef DEBUG
353 WriteLog("USER32: %s\n", lpOut);
354#endif
355 return(rc);
356}
357//******************************************************************************
358//******************************************************************************
359int __cdecl wsprintfW(LPWSTR lpOut, LPCWSTR lpFmt, ...)
360{
361 int rc;
362 char *lpFmtA;
363 char szOut[512];
364 va_list argptr;
365
366 dprintf(("USER32: wsprintfW(%08xh,%08xh).\n",
367 lpOut,
368 lpFmt));
369
370 lpFmtA = UnicodeToAsciiString((LPWSTR)lpFmt);
371
372 /* @@@PH 98/07/13 transform "%s" to "%ls" does the unicode magic */
373 {
374 PCHAR pszTemp;
375 PCHAR pszTemp1;
376 ULONG ulStrings;
377 ULONG ulIndex; /* temporary string counter */
378
379 for (ulStrings = 0, /* determine number of placeholders */
380 pszTemp = lpFmtA;
381
382 (pszTemp != NULL) &&
383 (*pszTemp != 0);
384
385 ulStrings++)
386 {
387 pszTemp = strstr(pszTemp,
388 "%s");
389 if (pszTemp != NULL) /* skip 2 characters */
390 {
391 pszTemp++;
392 pszTemp++;
393 }
394 else
395 break; /* leave loop immediately */
396 }
397
398 if (ulStrings != 0) /* transformation required ? */
399 {
400 /* now reallocate lpFmt */
401 ulStrings += strlen(lpFmtA); /* calculate total string length */
402 pszTemp = lpFmtA; /* save string pointer */
403 pszTemp1 = lpFmtA; /* save string pointer */
404
405 /* @@@PH allocation has to be compatible to FreeAsciiString !!! */
406 lpFmtA = (char *)malloc(ulStrings + 1);
407 if (lpFmtA == NULL) /* check proper allocation */
408 return (0); /* raise error condition */
409
410 for (ulIndex = 0;
411 ulIndex <= ulStrings;
412 ulIndex++,
413 pszTemp++)
414 {
415 if ((pszTemp[0] == '%') &&
416 (pszTemp[1] == 's') )
417 {
418 /* replace %s by %ls */
419 lpFmtA[ulIndex++] = '%';
420 lpFmtA[ulIndex ] = 'l';
421 lpFmtA[ulIndex+1] = 's';
422 }
423 else
424 lpFmtA[ulIndex] = *pszTemp; /* just copy over the character */
425 }
426
427 lpFmtA[ulStrings] = 0; /* string termination */
428
429 FreeAsciiString(pszTemp1); /* the original string is obsolete */
430 }
431 }
432
433 dprintf(("USER32: wsprintfW (%s).\n",
434 lpFmt));
435
436 va_start(argptr,
437 lpFmt);
438
439 rc = O32_wvsprintf(szOut,
440 lpFmtA,
441 argptr);
442
443 AsciiToUnicode(szOut,
444 lpOut);
445
446 FreeAsciiString(lpFmtA);
447 return(rc);
448}
449//******************************************************************************
450//******************************************************************************
451int WIN32API wvsprintfA( LPSTR lpOutput, LPCSTR lpFormat, va_list arglist)
452{
453#ifdef DEBUG
454 WriteLog("USER32: wvsprintfA\n");
455#endif
456 return O32_wvsprintf(lpOutput,lpFormat,(LPCVOID*)arglist);
457}
458//******************************************************************************
459//******************************************************************************
460int WIN32API wvsprintfW(LPWSTR lpOutput, LPCWSTR lpFormat, va_list arglist)
461{
462 int rc;
463 char szOut[256];
464 char *lpFmtA;
465
466 lpFmtA = UnicodeToAsciiString((LPWSTR)lpFormat);
467#ifdef DEBUG
468 WriteLog("USER32: wvsprintfW, DOES NOT HANDLE UNICODE STRINGS!\n");
469 WriteLog("USER32: %s\n", lpFormat);
470#endif
471 rc = O32_wvsprintf(szOut, lpFmtA, (LPCVOID)arglist);
472
473 AsciiToUnicode(szOut, lpOutput);
474#ifdef DEBUG
475 WriteLog("USER32: %s\n", lpOutput);
476#endif
477 FreeAsciiString(lpFmtA);
478 return(rc);
479}
480
481/* Cursor Functions */
482
483BOOL WIN32API ClipCursor(const RECT * lpRect)
484{
485#ifdef DEBUG
486 WriteLog("USER32: ClipCursor\n");
487#endif
488 return O32_ClipCursor(lpRect);
489}
490//******************************************************************************
491//******************************************************************************
492HCURSOR WIN32API CreateCursor( HINSTANCE hInst, int xHotSpot, int yHotSpot, int nWidth, int nHeight, const VOID *pvANDPlane, const VOID *pvXORPlane)
493{
494#ifdef DEBUG
495 WriteLog("USER32: CreateCursor\n");
496#endif
497 return O32_CreateCursor(hInst,xHotSpot,yHotSpot,nWidth,nHeight,pvANDPlane,pvXORPlane);
498}
499//******************************************************************************
500//******************************************************************************
501BOOL WIN32API DestroyCursor( HCURSOR hCursor)
502{
503#ifdef DEBUG
504 WriteLog("USER32: DestroyCursor\n");
505#endif
506 return O32_DestroyCursor(hCursor);
507}
508//******************************************************************************
509//******************************************************************************
510BOOL WIN32API GetClipCursor( LPRECT lpRect)
511{
512#ifdef DEBUG
513 WriteLog("USER32: GetClipCursor\n");
514#endif
515 return O32_GetClipCursor(lpRect);
516}
517//******************************************************************************
518//******************************************************************************
519HCURSOR WIN32API GetCursor(void)
520{
521#ifdef DEBUG
522//// WriteLog("USER32: GetCursor\n");
523#endif
524 return O32_GetCursor();
525}
526//******************************************************************************
527//******************************************************************************
528BOOL WIN32API GetCursorPos( PPOINT lpPoint)
529{
530 BOOL rc;
531 POINT point;
532#ifdef DEBUG
533//// WriteLog("USER32: GetCursorPos\n");
534#endif
535 if (!lpPoint) return FALSE;
536 if (OSLibWinQueryPointerPos(OSLIB_HWND_DESKTOP,&point)) //POINT == POINTL
537 {
538 OS2ToWin32ScreenPos(lpPoint,&point);
539 return TRUE;
540 } else return FALSE;
541}
542/*****************************************************************************
543 * Name : HCURSOR WIN32API LoadCursorFromFileA
544 * Purpose : The LoadCursorFromFile function creates a cursor based on data
545 * contained in a file. The file is specified by its name or by a
546 * system cursor identifier. The function returns a handle to the
547 * newly created cursor. Files containing cursor data may be in
548 * either cursor (.CUR) or animated cursor (.ANI) format.
549 * Parameters: LPCTSTR lpFileName pointer to cursor file, or system cursor id
550 * Variables :
551 * Result : If the function is successful, the return value is a handle to
552 * the new cursor.
553 * If the function fails, the return value is NULL. To get extended
554 * error information, call GetLastError. GetLastError may return
555 * the following
556 * Remark :
557 * Status : UNTESTED STUB
558 *
559 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
560 *****************************************************************************/
561HCURSOR WIN32API LoadCursorFromFileA(LPCTSTR lpFileName)
562{
563 if (!HIWORD(lpFileName))
564 {
565 return LoadCursorA(NULL,lpFileName);
566 } else
567 {
568 dprintf(("USER32:LoadCursorFromFileA (%s) not implemented.\n",
569 lpFileName));
570
571 return (NULL);
572 }
573}
574/*****************************************************************************
575 * Name : HCURSOR WIN32API LoadCursorFromFileW
576 * Purpose : The LoadCursorFromFile function creates a cursor based on data
577 * contained in a file. The file is specified by its name or by a
578 * system cursor identifier. The function returns a handle to the
579 * newly created cursor. Files containing cursor data may be in
580 * either cursor (.CUR) or animated cursor (.ANI) format.
581 * Parameters: LPCTSTR lpFileName pointer to cursor file, or system cursor id
582 * Variables :
583 * Result : If the function is successful, the return value is a handle to
584 * the new cursor.
585 * If the function fails, the return value is NULL. To get extended
586 * error information, call GetLastError. GetLastError may return
587 * the following
588 * Remark :
589 * Status : UNTESTED STUB
590 *
591 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
592 *****************************************************************************/
593HCURSOR WIN32API LoadCursorFromFileW(LPCWSTR lpFileName)
594{
595 if (!HIWORD(lpFileName))
596 {
597 return LoadCursorW(NULL,lpFileName);
598 } else
599 {
600 dprintf(("USER32:LoadCursorFromFileW (%s) not implemented.\n",
601 lpFileName));
602
603 return (NULL);
604 }
605}
606//******************************************************************************
607//******************************************************************************
608HCURSOR WIN32API SetCursor( HCURSOR hcur)
609{
610 HCURSOR rc;
611
612 rc = O32_SetCursor(hcur);
613 dprintf(("USER32: SetCursor %x (prev %x (%x))\n", hcur, rc, O32_GetCursor()));
614 return rc;
615}
616//******************************************************************************
617//******************************************************************************
618BOOL WIN32API SetCursorPos( int X, int Y)
619{
620#ifdef DEBUG
621 WriteLog("USER32: SetCursorPos\n");
622#endif
623 return O32_SetCursorPos(X,Y);
624}
625/*****************************************************************************
626 * Name : BOOL WIN32API SetSystemCursor
627 * Purpose : The SetSystemCursor function replaces the contents of the system
628 * cursor specified by dwCursorId with the contents of the cursor
629 * specified by hCursor, and then destroys hCursor. This function
630 * lets an application customize the system cursors.
631 * Parameters: HCURSOR hCursor set specified system cursor to this cursor's
632 * contents, then destroy this
633 * DWORD dwCursorID system cursor specified by its identifier
634 * Variables :
635 * Result : If the function succeeds, the return value is TRUE.
636 * If the function fails, the return value is FALSE. To get extended
637 * error information, call GetLastError.
638 * Remark :
639 * Status : UNTESTED STUB
640 *
641 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
642 *****************************************************************************/
643BOOL WIN32API SetSystemCursor(HCURSOR hCursor,
644 DWORD dwCursorId)
645{
646 dprintf(("USER32:SetSystemCursor (%08xh,%08x) not supported.\n",
647 hCursor,
648 dwCursorId));
649
650 return DestroyCursor(hCursor);
651}
652//******************************************************************************
653//******************************************************************************
654int WIN32API ShowCursor( BOOL bShow)
655{
656#ifdef DEBUG
657 WriteLog("USER32: ShowCursor\n");
658#endif
659 return O32_ShowCursor(bShow);
660}
661
662/* Mouse Input Functions */
663
664/*****************************************************************************
665 * Name : BOOL WIN32API DragDetect
666 * Purpose : The DragDetect function captures the mouse and tracks its movement
667 * Parameters: HWND hwnd
668 * POINT pt
669 * Variables :
670 * Result : If the user moved the mouse outside of the drag rectangle while
671 * holding the left button down, the return value is TRUE.
672 * If the user did not move the mouse outside of the drag rectangle
673 * while holding the left button down, the return value is FALSE.
674 * Remark :
675 * Status : UNTESTED STUB
676 *
677 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
678 *****************************************************************************/
679BOOL WIN32API DragDetect(HWND hwnd,
680 POINT pt)
681{
682 dprintf(("USER32:DragDetect(%08xh,...) not implemented.\n",
683 hwnd));
684
685 return (FALSE);
686}
687//******************************************************************************
688//******************************************************************************
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/* Icon Functions */
2320
2321int WIN32API LookupIconIdFromDirectory(PBYTE presbits, BOOL fIcon)
2322{
2323#ifdef DEBUG
2324 WriteLog("USER32: LookupIconIdFromDirectory, not implemented\n");
2325#endif
2326 return(0);
2327}
2328//******************************************************************************
2329//******************************************************************************
2330int WIN32API LookupIconIdFromDirectoryEx(PBYTE presbits, BOOL fIcon,
2331 int cxDesired, int cyDesired,
2332 UINT Flags)
2333{
2334#ifdef DEBUG
2335 WriteLog("USER32: LookupIconIdFromDirectoryEx, not implemented\n");
2336#endif
2337 return(0);
2338}
2339
2340/* Device Context Functions */
2341
2342BOOL WIN32API GetMonitorInfoA(HMONITOR,LPMONITORINFO)
2343{
2344#ifdef DEBUG
2345 WriteLog("USER32: GetMonitorInfoA not supported!!\n");
2346#endif
2347 return(FALSE);
2348}
2349//******************************************************************************
2350//******************************************************************************
2351BOOL WIN32API GetMonitorInfoW(HMONITOR,LPMONITORINFO)
2352{
2353#ifdef DEBUG
2354 WriteLog("USER32: GetMonitorInfoW not supported!!\n");
2355#endif
2356 return(FALSE);
2357}
2358//******************************************************************************
2359//******************************************************************************
2360HMONITOR WIN32API MonitorFromWindow(HWND hwnd, DWORD dwFlags)
2361{
2362#ifdef DEBUG
2363 WriteLog("USER32: MonitorFromWindow not correctly supported??\n");
2364#endif
2365 //Attention: Win32 hwnd!
2366
2367 return(0);
2368}
2369//******************************************************************************
2370//******************************************************************************
2371HMONITOR WIN32API MonitorFromRect(LPRECT rect, DWORD dwFlags)
2372{
2373#ifdef DEBUG
2374 WriteLog("USER32: MonitorFromRect not correctly supported??\n");
2375#endif
2376 return(0);
2377}
2378//******************************************************************************
2379//******************************************************************************
2380HMONITOR WIN32API MonitorFromPoint(POINT point, DWORD dwflags)
2381{
2382#ifdef DEBUG
2383 WriteLog("USER32: MonitorFromPoint not correctly supported??\n");
2384#endif
2385 return(0);
2386}
2387//******************************************************************************
2388//******************************************************************************
2389BOOL WIN32API EnumDisplayMonitors(HDC,LPRECT,MONITORENUMPROC,LPARAM)
2390{
2391#ifdef DEBUG
2392 WriteLog("USER32: EnumDisplayMonitors not supported??\n");
2393#endif
2394 return(FALSE);
2395}
2396//******************************************************************************
2397//******************************************************************************
2398BOOL WIN32API EnumDisplaySettingsA(LPCSTR lpszDeviceName, DWORD iModeNum,
2399 LPDEVMODEA lpDevMode)
2400{
2401#ifdef DEBUG
2402 WriteLog("USER32: EnumDisplaySettingsA FAKED\n");
2403#endif
2404 switch(iModeNum) {
2405 case 0:
2406 lpDevMode->dmBitsPerPel = 16;
2407 lpDevMode->dmPelsWidth = 768;
2408 lpDevMode->dmPelsHeight = 1024;
2409 lpDevMode->dmDisplayFlags = 0;
2410 lpDevMode->dmDisplayFrequency = 70;
2411 break;
2412 case 1:
2413 lpDevMode->dmBitsPerPel = 16;
2414 lpDevMode->dmPelsWidth = 640;
2415 lpDevMode->dmPelsHeight = 480;
2416 lpDevMode->dmDisplayFlags = 0;
2417 lpDevMode->dmDisplayFrequency = 70;
2418 break;
2419 default:
2420 return(FALSE);
2421 }
2422 return(TRUE);
2423}
2424/*****************************************************************************
2425 * Name : BOOL WIN32API EnumDisplaySettingsW
2426 * Purpose : The EnumDisplaySettings function obtains information about one
2427 * of a display device's graphics modes. You can obtain information
2428 * for all of a display device's graphics modes by making a series
2429 * of calls to this function.
2430 * Parameters: LPCTSTR lpszDeviceName specifies the display device
2431 * DWORD iModeNum specifies the graphics mode
2432 * LPDEVMODE lpDevMode points to structure to receive settings
2433 * Variables :
2434 * Result : If the function succeeds, the return value is TRUE.
2435 * If the function fails, the return value is FALSE.
2436 * Remark :
2437 * Status : UNTESTED STUB
2438 *
2439 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2440 *****************************************************************************/
2441BOOL WIN32API EnumDisplaySettingsW(LPCSTR lpszDeviceName,
2442 DWORD iModeNum,
2443 LPDEVMODEW lpDevMode)
2444{
2445 dprintf(("USER32:EnumDisplaySettingsW (%s,%08xh,%08x) not implemented.\n",
2446 lpszDeviceName,
2447 iModeNum,
2448 lpDevMode));
2449
2450 return (EnumDisplaySettingsA(lpszDeviceName,
2451 iModeNum,
2452 (LPDEVMODEA)lpDevMode));
2453}
2454//******************************************************************************
2455//******************************************************************************
2456LONG WIN32API ChangeDisplaySettingsA(LPDEVMODEA lpDevMode, DWORD dwFlags)
2457{
2458#ifdef DEBUG
2459 if(lpDevMode) {
2460 WriteLog("USER32: ChangeDisplaySettingsA FAKED %X\n", dwFlags);
2461 WriteLog("USER32: ChangeDisplaySettingsA lpDevMode->dmBitsPerPel %d\n", lpDevMode->dmBitsPerPel);
2462 WriteLog("USER32: ChangeDisplaySettingsA lpDevMode->dmPelsWidth %d\n", lpDevMode->dmPelsWidth);
2463 WriteLog("USER32: ChangeDisplaySettingsA lpDevMode->dmPelsHeight %d\n", lpDevMode->dmPelsHeight);
2464 }
2465#endif
2466 return(DISP_CHANGE_SUCCESSFUL);
2467}
2468/*****************************************************************************
2469 * Name : LONG WIN32API ChangeDisplaySettingsW
2470 * Purpose : The ChangeDisplaySettings function changes the display settings
2471 * to the specified graphics mode.
2472 * Parameters: LPDEVMODEW lpDevModeW
2473 * DWORD dwFlags
2474 * Variables :
2475 * Result : DISP_CHANGE_SUCCESSFUL The settings change was successful.
2476 * DISP_CHANGE_RESTART The computer must be restarted in order for the graphics mode to work.
2477 * DISP_CHANGE_BADFLAGS An invalid set of flags was passed in.
2478 * DISP_CHANGE_FAILED The display driver failed the specified graphics mode.
2479 * DISP_CHANGE_BADMODE The graphics mode is not supported.
2480 * DISP_CHANGE_NOTUPDATED Unable to write settings to the registry.
2481 * Remark :
2482 * Status : UNTESTED STUB
2483 *
2484 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2485 *****************************************************************************/
2486LONG WIN32API ChangeDisplaySettingsW(LPDEVMODEW lpDevMode,
2487 DWORD dwFlags)
2488{
2489 dprintf(("USER32:ChangeDisplaySettingsW(%08xh,%08x) not implemented.\n",
2490 lpDevMode,
2491 dwFlags));
2492
2493 return (ChangeDisplaySettingsA((LPDEVMODEA)lpDevMode,
2494 dwFlags));
2495}
2496
2497/* Window Station and Desktop Functions */
2498
2499/*****************************************************************************
2500 * Name : BOOL WIN32API CloseDesktop
2501 * Purpose : The CloseDesktop function closes an open handle of a desktop
2502 * object. A desktop is a secure object contained within a window
2503 * station object. A desktop has a logical display surface and
2504 * contains windows, menus and hooks.
2505 * Parameters: HDESK hDesktop
2506 * Variables :
2507 * Result : If the function succeeds, the return value is TRUE.
2508 * If the functions fails, the return value is FALSE. To get
2509 * extended error information, call GetLastError.
2510 * Remark :
2511 * Status : UNTESTED STUB
2512 *
2513 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2514 *****************************************************************************/
2515BOOL WIN32API CloseDesktop(HDESK hDesktop)
2516{
2517 dprintf(("USER32:CloseDesktop(%08x) not implemented.\n",
2518 hDesktop));
2519
2520 return (FALSE);
2521}
2522/*****************************************************************************
2523 * Name : BOOL WIN32API CloseWindowStation
2524 * Purpose : The CloseWindowStation function closes an open window station handle.
2525 * Parameters: HWINSTA hWinSta
2526 * Variables :
2527 * Result :
2528 * Remark : If the function succeeds, the return value is TRUE.
2529 * If the functions fails, the return value is FALSE. To get
2530 * extended error information, call GetLastError.
2531 * Status : UNTESTED STUB
2532 *
2533 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2534 *****************************************************************************/
2535BOOL WIN32API CloseWindowStation(HWINSTA hWinSta)
2536{
2537 dprintf(("USER32:CloseWindowStation(%08x) not implemented.\n",
2538 hWinSta));
2539
2540 return (FALSE);
2541}
2542/*****************************************************************************
2543 * Name : HDESK WIN32API CreateDesktopA
2544 * Purpose : The CreateDesktop function creates a new desktop on the window
2545 * station associated with the calling process.
2546 * Parameters: LPCTSTR lpszDesktop name of the new desktop
2547 * LPCTSTR lpszDevice name of display device to assign to the desktop
2548 * LPDEVMODE pDevMode reserved; must be NULL
2549 * DWORD dwFlags flags to control interaction with other applications
2550 * DWORD dwDesiredAccess specifies access of returned handle
2551 * LPSECURITY_ATTRIBUTES lpsa specifies security attributes of the desktop
2552 * Variables :
2553 * Result : If the function succeeds, the return value is a handle of the
2554 * newly created desktop.
2555 * If the function fails, the return value is NULL. To get extended
2556 * error information, call GetLastError.
2557 * Remark :
2558 * Status : UNTESTED STUB
2559 *
2560 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2561 *****************************************************************************/
2562HDESK WIN32API CreateDesktopA(LPCTSTR lpszDesktop,
2563 LPCTSTR lpszDevice,
2564 LPDEVMODEA pDevMode,
2565 DWORD dwFlags,
2566 DWORD dwDesiredAccess,
2567 LPSECURITY_ATTRIBUTES lpsa)
2568{
2569 dprintf(("USER32:CreateDesktopA(%s,%s,%08xh,%08xh,%08xh,%08x) not implemented.\n",
2570 lpszDesktop,
2571 lpszDevice,
2572 pDevMode,
2573 dwFlags,
2574 dwDesiredAccess,
2575 lpsa));
2576
2577 return (NULL);
2578}
2579/*****************************************************************************
2580 * Name : HDESK WIN32API CreateDesktopW
2581 * Purpose : The CreateDesktop function creates a new desktop on the window
2582 * station associated with the calling process.
2583 * Parameters: LPCTSTR lpszDesktop name of the new desktop
2584 * LPCTSTR lpszDevice name of display device to assign to the desktop
2585 * LPDEVMODE pDevMode reserved; must be NULL
2586 * DWORD dwFlags flags to control interaction with other applications
2587 * DWORD dwDesiredAccess specifies access of returned handle
2588 * LPSECURITY_ATTRIBUTES lpsa specifies security attributes of the desktop
2589 * Variables :
2590 * Result : If the function succeeds, the return value is a handle of the
2591 * newly created desktop.
2592 * If the function fails, the return value is NULL. To get extended
2593 * error information, call GetLastError.
2594 * Remark :
2595 * Status : UNTESTED STUB
2596 *
2597 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2598 *****************************************************************************/
2599HDESK WIN32API CreateDesktopW(LPCTSTR lpszDesktop,
2600 LPCTSTR lpszDevice,
2601 LPDEVMODEW pDevMode,
2602 DWORD dwFlags,
2603 DWORD dwDesiredAccess,
2604 LPSECURITY_ATTRIBUTES lpsa)
2605{
2606 dprintf(("USER32:CreateDesktopW(%s,%s,%08xh,%08xh,%08xh,%08x) not implemented.\n",
2607 lpszDesktop,
2608 lpszDevice,
2609 pDevMode,
2610 dwFlags,
2611 dwDesiredAccess,
2612 lpsa));
2613
2614 return (NULL);
2615}
2616/*****************************************************************************
2617 * Name : HWINSTA WIN32API CreateWindowStationA
2618 * Purpose : The CreateWindowStation function creates a window station object.
2619 * It returns a handle that can be used to access the window station.
2620 * A window station is a secure object that contains a set of global
2621 * atoms, a clipboard, and a set of desktop objects.
2622 * Parameters: LPTSTR lpwinsta name of the new window station
2623 * DWORD dwReserved reserved; must be NULL
2624 * DWORD dwDesiredAccess specifies access of returned handle
2625 * LPSECURITY_ATTRIBUTES lpsa specifies security attributes of the window station
2626 * Variables :
2627 * Result : If the function succeeds, the return value is the handle to the
2628 * newly created window station.
2629 * If the function fails, the return value is NULL. To get extended
2630 * error information, call GetLastError.
2631 * Remark :
2632 * Status : UNTESTED STUB
2633 *
2634 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2635 *****************************************************************************/
2636HWINSTA WIN32API CreateWindowStationA(LPTSTR lpWinSta,
2637 DWORD dwReserved,
2638 DWORD dwDesiredAccess,
2639 LPSECURITY_ATTRIBUTES lpsa)
2640{
2641 dprintf(("USER32:CreateWindowStationA(%s,%08xh,%08xh,%08x) not implemented.\n",
2642 lpWinSta,
2643 dwReserved,
2644 dwDesiredAccess,
2645 lpsa));
2646
2647 return (NULL);
2648}
2649/*****************************************************************************
2650 * Name : HWINSTA WIN32API CreateWindowStationW
2651 * Purpose : The CreateWindowStation function creates a window station object.
2652 * It returns a handle that can be used to access the window station.
2653 * A window station is a secure object that contains a set of global
2654 * atoms, a clipboard, and a set of desktop objects.
2655 * Parameters: LPTSTR lpwinsta name of the new window station
2656 * DWORD dwReserved reserved; must be NULL
2657 * DWORD dwDesiredAccess specifies access of returned handle
2658 * LPSECURITY_ATTRIBUTES lpsa specifies security attributes of the window station
2659 * Variables :
2660 * Result : If the function succeeds, the return value is the handle to the
2661 * newly created window station.
2662 * If the function fails, the return value is NULL. To get extended
2663 * error information, call GetLastError.
2664 * Remark :
2665 * Status : UNTESTED STUB
2666 *
2667 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2668 *****************************************************************************/
2669HWINSTA WIN32API CreateWindowStationW(LPWSTR lpWinSta,
2670 DWORD dwReserved,
2671 DWORD dwDesiredAccess,
2672 LPSECURITY_ATTRIBUTES lpsa)
2673{
2674 dprintf(("USER32:CreateWindowStationW(%s,%08xh,%08xh,%08x) not implemented.\n",
2675 lpWinSta,
2676 dwReserved,
2677 dwDesiredAccess,
2678 lpsa));
2679
2680 return (NULL);
2681}
2682/*****************************************************************************
2683 * Name : BOOL WIN32API EnumDesktopWindows
2684 * Purpose : The EnumDesktopWindows function enumerates all windows in a
2685 * desktop by passing the handle of each window, in turn, to an
2686 * application-defined callback function.
2687 * Parameters: HDESK hDesktop handle of desktop to enumerate
2688 * WNDENUMPROC lpfn points to application's callback function
2689 * LPARAM lParam 32-bit value to pass to the callback function
2690 * Variables :
2691 * Result : If the function succeeds, the return value is TRUE.
2692 * If the function fails, the return value is FALSE. To get
2693 * extended error information, call GetLastError.
2694 * Remark :
2695 * Status : UNTESTED STUB
2696 *
2697 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2698 *****************************************************************************/
2699BOOL WIN32API EnumDesktopWindows(HDESK hDesktop,
2700 WNDENUMPROC lpfn,
2701 LPARAM lParam)
2702{
2703 dprintf(("USER32:EnumDesktopWindows (%08xh,%08xh,%08x) not implemented.\n",
2704 hDesktop,
2705 lpfn,
2706 lParam));
2707
2708 return (FALSE);
2709}
2710/*****************************************************************************
2711 * Name : BOOL WIN32API EnumDesktopsA
2712 * Purpose : The EnumDesktops function enumerates all desktops in the window
2713 * station assigned to the calling process. The function does so by
2714 * passing the name of each desktop, in turn, to an application-
2715 * defined callback function.
2716 * Parameters: HWINSTA hwinsta handle of window station to enumerate
2717 * DESKTOPENUMPROC lpEnumFunc points to application's callback function
2718 * LPARAM lParam 32-bit value to pass to the callback function
2719 * Variables :
2720 * Result : If the function succeeds, the return value is TRUE.
2721 * If the function fails, the return value is FALSE. To get extended
2722 * error information, call GetLastError.
2723 * Remark :
2724 * Status : UNTESTED STUB
2725 *
2726 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2727 *****************************************************************************/
2728BOOL WIN32API EnumDesktopsA(HWINSTA hWinSta,
2729 DESKTOPENUMPROCA lpEnumFunc,
2730 LPARAM lParam)
2731{
2732 dprintf(("USER32:EnumDesktopsA (%08xh,%08xh,%08x) not implemented.\n",
2733 hWinSta,
2734 lpEnumFunc,
2735 lParam));
2736
2737 return (FALSE);
2738}
2739/*****************************************************************************
2740 * Name : BOOL WIN32API EnumDesktopsW
2741 * Purpose : The EnumDesktops function enumerates all desktops in the window
2742 * station assigned to the calling process. The function does so by
2743 * passing the name of each desktop, in turn, to an application-
2744 * defined callback function.
2745 * Parameters: HWINSTA hwinsta handle of window station to enumerate
2746 * DESKTOPENUMPROC lpEnumFunc points to application's callback function
2747 * LPARAM lParam 32-bit value to pass to the callback function
2748 * Variables :
2749 * Result : If the function succeeds, the return value is TRUE.
2750 * If the function fails, the return value is FALSE. To get extended
2751 * error information, call GetLastError.
2752 * Remark :
2753 * Status : UNTESTED STUB
2754 *
2755 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2756 *****************************************************************************/
2757BOOL WIN32API EnumDesktopsW(HWINSTA hWinSta,
2758 DESKTOPENUMPROCW lpEnumFunc,
2759 LPARAM lParam)
2760{
2761 dprintf(("USER32:EnumDesktopsW (%08xh,%08xh,%08x) not implemented.\n",
2762 hWinSta,
2763 lpEnumFunc,
2764 lParam));
2765
2766 return (FALSE);
2767}
2768/*****************************************************************************
2769 * Name : BOOL WIN32API EnumWindowStationsA
2770 * Purpose : The EnumWindowStations function enumerates all windowstations
2771 * in the system by passing the name of each window station, in
2772 * turn, to an application-defined callback function.
2773 * Parameters:
2774 * Variables : WINSTAENUMPROC lpEnumFunc points to application's callback function
2775 * LPARAM lParam 32-bit value to pass to the callback function
2776 * Result : If the function succeeds, the return value is TRUE.
2777 * If the function fails the return value is FALSE. To get extended
2778 * error information, call GetLastError.
2779 * Remark :
2780 * Status : UNTESTED STUB
2781 *
2782 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2783 *****************************************************************************/
2784BOOL WIN32API EnumWindowStationsA(WINSTAENUMPROCA lpEnumFunc,
2785 LPARAM lParam)
2786{
2787 dprintf(("USER32:EnumWindowStationsA (%08xh,%08x) not implemented.\n",
2788 lpEnumFunc,
2789 lParam));
2790
2791 return (FALSE);
2792}
2793/*****************************************************************************
2794 * Name : BOOL WIN32API EnumWindowStationsW
2795 * Purpose : The EnumWindowStations function enumerates all windowstations
2796 * in the system by passing the name of each window station, in
2797 * turn, to an application-defined callback function.
2798 * Parameters:
2799 * Variables : WINSTAENUMPROC lpEnumFunc points to application's callback function
2800 * LPARAM lParam 32-bit value to pass to the callback function
2801 * Result : If the function succeeds, the return value is TRUE.
2802 * If the function fails the return value is FALSE. To get extended
2803 * error information, call GetLastError.
2804 * Remark :
2805 * Status : UNTESTED STUB
2806 *
2807 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2808 *****************************************************************************/
2809BOOL WIN32API EnumWindowStationsW(WINSTAENUMPROCW lpEnumFunc,
2810 LPARAM lParam)
2811{
2812 dprintf(("USER32:EnumWindowStationsW (%08xh,%08x) not implemented.\n",
2813 lpEnumFunc,
2814 lParam));
2815
2816 return (FALSE);
2817}
2818/*****************************************************************************
2819 * Name : HWINSTA WIN32API GetProcessWindowStation
2820 * Purpose : The GetProcessWindowStation function returns a handle of the
2821 * window station associated with the calling process.
2822 * Parameters:
2823 * Variables :
2824 * Result : If the function succeeds, the return value is a handle of the
2825 * window station associated with the calling process.
2826 * If the function fails, the return value is NULL. This can occur
2827 * if the calling process is not an application written for Windows
2828 * NT. To get extended error information, call GetLastError.
2829 * Remark :
2830 * Status : UNTESTED STUB
2831 *
2832 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2833 *****************************************************************************/
2834HWINSTA WIN32API GetProcessWindowStation(VOID)
2835{
2836 dprintf(("USER32:GetProcessWindowStation () not implemented.\n"));
2837
2838 return (NULL);
2839}
2840/*****************************************************************************
2841 * Name : BOOL WIN32API GetUserObjectInformationA
2842 * Purpose : The GetUserObjectInformation function returns information about
2843 * a window station or desktop object.
2844 * Parameters: HANDLE hObj handle of object to get information for
2845 * int nIndex type of information to get
2846 * PVOID pvInfo points to buffer that receives the information
2847 * DWORD nLength size, in bytes, of pvInfo buffer
2848 * LPDWORD lpnLengthNeeded receives required size, in bytes, of pvInfo buffer
2849 * Variables :
2850 * Result : If the function succeeds, the return value is TRUE.
2851 * If the function fails, the return value is FALSE. To get extended
2852 * error information, call GetLastError.
2853 * Remark :
2854 * Status : UNTESTED STUB
2855 *
2856 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2857 *****************************************************************************/
2858BOOL WIN32API GetUserObjectInformationA(HANDLE hObj,
2859 int nIndex,
2860 PVOID pvInfo,
2861 DWORD nLength,
2862 LPDWORD lpnLengthNeeded)
2863{
2864 dprintf(("USER32:GetUserObjectInformationA (%08xh,%08xh,%08xh,%u,%08x) not implemented.\n",
2865 hObj,
2866 nIndex,
2867 pvInfo,
2868 nLength,
2869 lpnLengthNeeded));
2870
2871 return (FALSE);
2872}
2873/*****************************************************************************
2874 * Name : BOOL WIN32API GetUserObjectInformationW
2875 * Purpose : The GetUserObjectInformation function returns information about
2876 * a window station or desktop object.
2877 * Parameters: HANDLE hObj handle of object to get information for
2878 * int nIndex type of information to get
2879 * PVOID pvInfo points to buffer that receives the information
2880 * DWORD nLength size, in bytes, of pvInfo buffer
2881 * LPDWORD lpnLengthNeeded receives required size, in bytes, of pvInfo buffer
2882 * Variables :
2883 * Result : If the function succeeds, the return value is TRUE.
2884 * If the function fails, the return value is FALSE. To get extended
2885 * error information, call GetLastError.
2886 * Remark :
2887 * Status : UNTESTED STUB
2888 *
2889 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2890 *****************************************************************************/
2891BOOL WIN32API GetUserObjectInformationW(HANDLE hObj,
2892 int nIndex,
2893 PVOID pvInfo,
2894 DWORD nLength,
2895 LPDWORD lpnLengthNeeded)
2896{
2897 dprintf(("USER32:GetUserObjectInformationW (%08xh,%08xh,%08xh,%u,%08x) not implemented.\n",
2898 hObj,
2899 nIndex,
2900 pvInfo,
2901 nLength,
2902 lpnLengthNeeded));
2903
2904 return (FALSE);
2905}
2906/*****************************************************************************
2907 * Name : BOOL WIN32API GetUserObjectSecurity
2908 * Purpose : The GetUserObjectSecurity function retrieves security information
2909 * for the specified user object.
2910 * Parameters: HANDLE hObj handle of user object
2911 * SECURITY_INFORMATION * pSIRequested address of requested security information
2912 * LPSECURITY_DESCRIPTOR pSID address of security descriptor
2913 * DWORD nLength size of buffer for security descriptor
2914 * LPDWORD lpnLengthNeeded address of required size of buffer
2915 * Variables :
2916 * Result : If the function succeeds, the return value is TRUE.
2917 * If the function fails, the return value is FALSE. To get extended
2918 * error information, call GetLastError.
2919 * Remark :
2920 * Status : UNTESTED STUB
2921 *
2922 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2923 *****************************************************************************/
2924BOOL WIN32API GetUserObjectSecurity(HANDLE hObj,
2925 SECURITY_INFORMATION * pSIRequested,
2926 LPSECURITY_DESCRIPTOR pSID,
2927 DWORD nLength,
2928 LPDWORD lpnLengthNeeded)
2929{
2930 dprintf(("USER32:GetUserObjectSecurity (%08xh,%08xh,%08xh,%u,%08x) not implemented.\n",
2931 hObj,
2932 pSIRequested,
2933 pSID,
2934 nLength,
2935 lpnLengthNeeded));
2936
2937 return (FALSE);
2938}
2939/*****************************************************************************
2940 * Name : HDESK WIN32API OpenDesktopA
2941 * Purpose : The OpenDesktop function returns a handle to an existing desktop.
2942 * A desktop is a secure object contained within a window station
2943 * object. A desktop has a logical display surface and contains
2944 * windows, menus and hooks.
2945 * Parameters: LPCTSTR lpszDesktopName name of the desktop to open
2946 * DWORD dwFlags flags to control interaction with other applications
2947 * BOOL fInherit specifies whether returned handle is inheritable
2948 * DWORD dwDesiredAccess specifies access of returned handle
2949 * Variables :
2950 * Result : If the function succeeds, the return value is the handle to the
2951 * opened desktop.
2952 * If the function fails, the return value is NULL. To get extended
2953 * error information, call GetLastError.
2954 * Remark :
2955 * Status : UNTESTED STUB
2956 *
2957 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2958 *****************************************************************************/
2959HDESK WIN32API OpenDesktopA(LPCTSTR lpszDesktopName,
2960 DWORD dwFlags,
2961 BOOL fInherit,
2962 DWORD dwDesiredAccess)
2963{
2964 dprintf(("USER32:OpenDesktopA (%s,%08xh,%08xh,%08x) not implemented.\n",
2965 lpszDesktopName,
2966 dwFlags,
2967 fInherit,
2968 dwDesiredAccess));
2969
2970 return (NULL);
2971}
2972/*****************************************************************************
2973 * Name : HDESK WIN32API OpenDesktopW
2974 * Purpose : The OpenDesktop function returns a handle to an existing desktop.
2975 * A desktop is a secure object contained within a window station
2976 * object. A desktop has a logical display surface and contains
2977 * windows, menus and hooks.
2978 * Parameters: LPCTSTR lpszDesktopName name of the desktop to open
2979 * DWORD dwFlags flags to control interaction with other applications
2980 * BOOL fInherit specifies whether returned handle is inheritable
2981 * DWORD dwDesiredAccess specifies access of returned handle
2982 * Variables :
2983 * Result : If the function succeeds, the return value is the handle to the
2984 * opened desktop.
2985 * If the function fails, the return value is NULL. To get extended
2986 * error information, call GetLastError.
2987 * Remark :
2988 * Status : UNTESTED STUB
2989 *
2990 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
2991 *****************************************************************************/
2992HDESK WIN32API OpenDesktopW(LPCTSTR lpszDesktopName,
2993 DWORD dwFlags,
2994 BOOL fInherit,
2995 DWORD dwDesiredAccess)
2996{
2997 dprintf(("USER32:OpenDesktopW (%s,%08xh,%08xh,%08x) not implemented.\n",
2998 lpszDesktopName,
2999 dwFlags,
3000 fInherit,
3001 dwDesiredAccess));
3002
3003 return (NULL);
3004}
3005/*****************************************************************************
3006 * Name : HDESK WIN32API OpenInputDesktop
3007 * Purpose : The OpenInputDesktop function returns a handle to the desktop
3008 * that receives user input. The input desktop is a desktop on the
3009 * window station associated with the logged-on user.
3010 * Parameters: DWORD dwFlags flags to control interaction with other applications
3011 * BOOL fInherit specifies whether returned handle is inheritable
3012 * DWORD dwDesiredAccess specifies access of returned handle
3013 * Variables :
3014 * Result : If the function succeeds, the return value is a handle of the
3015 * desktop that receives user input.
3016 * If the function fails, the return value is NULL. To get extended
3017 * error information, call GetLastError.
3018 * Remark :
3019 * Status : UNTESTED STUB
3020 *
3021 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3022 *****************************************************************************/
3023HDESK WIN32API OpenInputDesktop(DWORD dwFlags,
3024 BOOL fInherit,
3025 DWORD dwDesiredAccess)
3026{
3027 dprintf(("USER32:OpenInputDesktop (%08xh,%08xh,%08x) not implemented.\n",
3028 dwFlags,
3029 fInherit,
3030 dwDesiredAccess));
3031
3032 return (NULL);
3033}
3034/*****************************************************************************
3035 * Name : HWINSTA WIN32API OpenWindowStationA
3036 * Purpose : The OpenWindowStation function returns a handle to an existing
3037 * window station.
3038 * Parameters: LPCTSTR lpszWinStaName name of the window station to open
3039 * BOOL fInherit specifies whether returned handle is inheritable
3040 * DWORD dwDesiredAccess specifies access of returned handle
3041 * Variables :
3042 * Result : If the function succeeds, the return value is the handle to the
3043 * specified window station.
3044 * If the function fails, the return value is NULL. To get extended
3045 * error information, call GetLastError.
3046 * Remark :
3047 * Status : UNTESTED STUB
3048 *
3049 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3050 *****************************************************************************/
3051HWINSTA WIN32API OpenWindowStationA(LPCTSTR lpszWinStaName,
3052 BOOL fInherit,
3053 DWORD dwDesiredAccess)
3054{
3055 dprintf(("USER32:OpenWindowStatieonA (%s,%08xh,%08x) not implemented.\n",
3056 lpszWinStaName,
3057 fInherit,
3058 dwDesiredAccess));
3059
3060 return (NULL);
3061}
3062/*****************************************************************************
3063 * Name : HWINSTA WIN32API OpenWindowStationW
3064 * Purpose : The OpenWindowStation function returns a handle to an existing
3065 * window station.
3066 * Parameters: LPCTSTR lpszWinStaName name of the window station to open
3067 * BOOL fInherit specifies whether returned handle is inheritable
3068 * DWORD dwDesiredAccess specifies access of returned handle
3069 * Variables :
3070 * Result : If the function succeeds, the return value is the handle to the
3071 * specified window station.
3072 * If the function fails, the return value is NULL. To get extended
3073 * error information, call GetLastError.
3074
3075
3076 * Remark :
3077 * Status : UNTESTED STUB
3078 *
3079 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3080 *****************************************************************************/
3081HWINSTA WIN32API OpenWindowStationW(LPCTSTR lpszWinStaName,
3082 BOOL fInherit,
3083 DWORD dwDesiredAccess)
3084{
3085 dprintf(("USER32:OpenWindowStatieonW (%s,%08xh,%08x) not implemented.\n",
3086 lpszWinStaName,
3087 fInherit,
3088 dwDesiredAccess));
3089
3090 return (NULL);
3091}
3092/*****************************************************************************
3093 * Name : BOOL WIN32API SetProcessWindowStation
3094 * Purpose : The SetProcessWindowStation function assigns a window station
3095 * to the calling process. This enables the process to access
3096 * objects in the window station such as desktops, the clipboard,
3097 * and global atoms. All subsequent operations on the window station
3098 * use the access rights granted to hWinSta.
3099 * Parameters:
3100 * Variables :
3101 * Result : If the function succeeds, the return value is TRUE.
3102 * If the function fails, the return value is FALSE. To get extended
3103 * error information, call GetLastError.
3104 * Remark :
3105 * Status : UNTESTED STUB
3106 *
3107 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3108 *****************************************************************************/
3109BOOL WIN32API SetProcessWindowStation(HWINSTA hWinSta)
3110{
3111 dprintf(("USER32:SetProcessWindowStation (%08x) not implemented.\n",
3112 hWinSta));
3113
3114 return (FALSE);
3115}
3116/*****************************************************************************
3117 * Name : BOOL WIN32API SetThreadDesktop
3118 * Purpose : The SetThreadDesktop function assigns a desktop to the calling
3119 * thread. All subsequent operations on the desktop use the access
3120 * rights granted to hDesk.
3121 * Parameters: HDESK hDesk handle of the desktop to assign to this thread
3122 * Variables :
3123 * Result : If the function succeeds, the return value is TRUE.
3124 * If the function fails, the return value is FALSE. To get extended
3125 * error information, call GetLastError.
3126 * Remark :
3127 * Status : UNTESTED STUB
3128 *
3129 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3130 *****************************************************************************/
3131BOOL WIN32API SetThreadDesktop(HDESK hDesktop)
3132{
3133 dprintf(("USER32:SetThreadDesktop (%08x) not implemented.\n",
3134 hDesktop));
3135
3136 return (FALSE);
3137}
3138/*****************************************************************************
3139 * Name : BOOL WIN32API SetUserObjectInformationA
3140 * Purpose : The SetUserObjectInformation function sets information about a
3141 * window station or desktop object.
3142 * Parameters: HANDLE hObject handle of the object for which to set information
3143 * int nIndex type of information to set
3144 * PVOID lpvInfo points to a buffer that contains the information
3145 * DWORD cbInfo size, in bytes, of lpvInfo buffer
3146 * Variables :
3147 * Result : If the function succeeds, the return value is TRUE.
3148 * If the function fails the return value is FALSE. To get extended
3149 * error information, call GetLastError.
3150 * Remark :
3151 * Status : UNTESTED STUB
3152 *
3153 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3154 *****************************************************************************/
3155BOOL WIN32API SetUserObjectInformationA(HANDLE hObject,
3156 int nIndex,
3157 PVOID lpvInfo,
3158 DWORD cbInfo)
3159{
3160 dprintf(("USER32:SetUserObjectInformationA (%08xh,%u,%08xh,%08x) not implemented.\n",
3161 hObject,
3162 nIndex,
3163 lpvInfo,
3164 cbInfo));
3165
3166 return (FALSE);
3167}
3168/*****************************************************************************
3169 * Name : BOOL WIN32API SetUserObjectInformationW
3170 * Purpose : The SetUserObjectInformation function sets information about a
3171 * window station or desktop object.
3172 * Parameters: HANDLE hObject handle of the object for which to set information
3173 * int nIndex type of information to set
3174 * PVOID lpvInfo points to a buffer that contains the information
3175 * DWORD cbInfo size, in bytes, of lpvInfo buffer
3176 * Variables :
3177 * Result : If the function succeeds, the return value is TRUE.
3178 * If the function fails the return value is FALSE. To get extended
3179 * error information, call GetLastError.
3180 * Remark :
3181 * Status : UNTESTED STUB
3182 *
3183 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3184 *****************************************************************************/
3185BOOL WIN32API SetUserObjectInformationW(HANDLE hObject,
3186 int nIndex,
3187 PVOID lpvInfo,
3188 DWORD cbInfo)
3189{
3190 dprintf(("USER32:SetUserObjectInformationW (%08xh,%u,%08xh,%08x) not implemented.\n",
3191 hObject,
3192 nIndex,
3193 lpvInfo,
3194 cbInfo));
3195
3196 return (FALSE);
3197}
3198/*****************************************************************************
3199 * Name : BOOL WIN32API SetUserObjectSecurity
3200 * Purpose : The SetUserObjectSecurity function sets the security of a user
3201 * object. This can be, for example, a window or a DDE conversation
3202 * Parameters: HANDLE hObject handle of user object
3203 * SECURITY_INFORMATION * psi address of security information
3204 * LPSECURITY_DESCRIPTOR psd address of security descriptor
3205 * Variables :
3206 * Result : If the function succeeds, the return value is TRUE.
3207 * If the function fails, the return value is FALSE. To get extended
3208 * error information, call GetLastError.
3209 * Remark :
3210 * Status : UNTESTED STUB
3211 *
3212 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3213 *****************************************************************************/
3214BOOL WIN32API SetUserObjectSecurity(HANDLE hObject,
3215 SECURITY_INFORMATION * psi,
3216 LPSECURITY_DESCRIPTOR psd)
3217{
3218 dprintf(("USER32:SetUserObjectSecuroty (%08xh,%08xh,%08x) not implemented.\n",
3219 hObject,
3220 psi,
3221 psd));
3222
3223 return (FALSE);
3224}
3225/*****************************************************************************
3226 * Name : BOOL WIN32API SwitchDesktop
3227 * Purpose : The SwitchDesktop function makes a desktop visible and activates
3228 * it. This enables the desktop to receive input from the user. The
3229 * calling process must have DESKTOP_SWITCHDESKTOP access to the
3230 * desktop for the SwitchDesktop function to succeed.
3231 * Parameters:
3232 * Variables :
3233 * Result : If the function succeeds, the return value is TRUE.
3234 * If the function fails, the return value is FALSE. To get extended
3235 * error information, call GetLastError.
3236 * Remark :
3237 * Status : UNTESTED STUB
3238 *
3239 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3240 *****************************************************************************/
3241BOOL WIN32API SwitchDesktop(HDESK hDesktop)
3242{
3243 dprintf(("USER32:SwitchDesktop (%08x) not implemented.\n",
3244 hDesktop));
3245
3246 return (FALSE);
3247}
3248
3249/* Debugging Functions */
3250
3251/*****************************************************************************
3252 * Name : VOID WIN32API SetDebugErrorLevel
3253 * Purpose : The SetDebugErrorLevel function sets the minimum error level at
3254 * which Windows will generate debugging events and pass them to a debugger.
3255 * Parameters: DWORD dwLevel debugging error level
3256 * Variables :
3257 * Result :
3258 * Remark :
3259 * Status : UNTESTED STUB
3260 *
3261 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3262 *****************************************************************************/
3263VOID WIN32API SetDebugErrorLevel(DWORD dwLevel)
3264{
3265 dprintf(("USER32:SetDebugErrorLevel (%08x) not implemented.\n",
3266 dwLevel));
3267}
3268
3269/* Hook Functions */
3270
3271/*****************************************************************************
3272 * Name : BOOL WIN32API SetWindowsHookW
3273 * Purpose : The SetWindowsHook function is not implemented in the Win32 API.
3274 * Win32-based applications should use the SetWindowsHookEx function.
3275 * Parameters:
3276 * Variables :
3277 * Result :
3278 * Remark : ARGH ! MICROSOFT !
3279 * Status : UNTESTED STUB
3280 *
3281 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3282 *****************************************************************************/
3283HHOOK WIN32API SetWindowsHookW(int nFilterType, HOOKPROC pfnFilterProc)
3284
3285{
3286 return (FALSE);
3287}
3288
3289/* CB: move to ShowWindow() */
3290
3291/*****************************************************************************
3292 * Name : BOOL WIN32API ShowWindowAsync
3293 * Purpose : The ShowWindowAsync function sets the show state of a window
3294 * created by a different thread.
3295 * Parameters: HWND hwnd handle of window
3296 * int nCmdShow show state of window
3297 * Variables :
3298 * Result : If the window was previously visible, the return value is TRUE.
3299 * If the window was previously hidden, the return value is FALSE.
3300 * Remark :
3301 * Status : UNTESTED STUB
3302 *
3303 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3304 *****************************************************************************/
3305BOOL WIN32API ShowWindowAsync (HWND hWnd,
3306 int nCmdShow)
3307{
3308 dprintf(("USER32:ShowWindowAsync (%08xh,%08x) not implemented.\n",
3309 hWnd,
3310 nCmdShow));
3311
3312 return (FALSE);
3313}
3314
3315/* CB: move to MDI */
3316
3317/*****************************************************************************
3318 * Name : WORD WIN32API TileWindows
3319 * Purpose : The TileWindows function tiles the specified windows, or the child
3320 * windows of the specified parent window.
3321 * Parameters: HWND hwndParent handle of parent window
3322 * WORD wFlags types of windows not to arrange
3323 * LPCRECT lpRect rectangle to arrange windows in
3324 * WORD cChildrenb number of windows to arrange
3325 * const HWND *ahwndChildren array of window handles
3326 * Variables :
3327 * Result : If the function succeeds, the return value is the number of
3328 * windows arranged.
3329 * If the function fails, the return value is zero.
3330 * Remark :
3331 * Status : UNTESTED STUB
3332 *
3333 * Author : Patrick Haller [Thu, 1998/02/26 11:55]
3334 *****************************************************************************/
3335WORD WIN32API TileWindows(HWND hwndParent,
3336 UINT wFlags,
3337 const LPRECT lpRect,
3338 UINT cChildrenb,
3339 const HWND *ahwndChildren)
3340{
3341 dprintf(("USER32:TileWindows (%08xh,%08xh,%08xh,%08xh,%08x) not implemented.\n",
3342 hwndParent,
3343 wFlags,
3344 lpRect,
3345 cChildrenb,
3346 ahwndChildren));
3347
3348 return (0);
3349}
3350/*****************************************************************************
3351 * Name : BOOL WIN32API TileChildWindows
3352 * Purpose : Unknown
3353 * Parameters: Unknown
3354 * Variables :
3355 * Result :
3356 * Remark :
3357 * Status : UNTESTED UNKNOWN STUB
3358 *
3359 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3360 *****************************************************************************/
3361BOOL WIN32API TileChildWindows(DWORD x1,
3362 DWORD x2)
3363{
3364 dprintf(("USER32: TileChildWindows(%08xh,%08xh) not implemented.\n",
3365 x1,
3366 x2));
3367
3368 return (FALSE); /* default */
3369}
3370/*****************************************************************************
3371 * Name : BOOL WIN32API CascadeChildWindows
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 CascadeChildWindows(DWORD x1,
3382 DWORD x2)
3383{
3384 dprintf(("USER32: CascadeChildWindows(%08xh,%08xh) not implemented.\n",
3385 x1,
3386 x2));
3387
3388 return (FALSE); /* default */
3389}
3390
3391/* Drag'n'drop */
3392
3393/*****************************************************************************
3394 * Name : BOOL WIN32API DragObject
3395 * Purpose : Unknown
3396 * Parameters: Unknown
3397 * Variables :
3398 * Result :
3399 * Remark :
3400 * Status : UNTESTED UNKNOWN STUB
3401 *
3402 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3403 *****************************************************************************/
3404DWORD WIN32API DragObject(HWND x1,HWND x2,UINT x3,DWORD x4,HCURSOR x5)
3405{
3406 dprintf(("USER32: DragObject(%08x,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
3407 x1,
3408 x2,
3409 x3,
3410 x4,
3411 x5));
3412
3413 return (FALSE); /* default */
3414}
3415
3416/* Unknown */
3417
3418/*****************************************************************************
3419 * Name : BOOL WIN32API SetShellWindow
3420 * Purpose : Unknown
3421 * Parameters: Unknown
3422 * Variables :
3423 * Result :
3424 * Remark :
3425 * Status : UNTESTED UNKNOWN STUB
3426 *
3427 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3428 *****************************************************************************/
3429BOOL WIN32API SetShellWindow(DWORD x1)
3430{
3431 dprintf(("USER32: SetShellWindow(%08x) not implemented.\n",
3432 x1));
3433
3434 return (FALSE); /* default */
3435}
3436/*****************************************************************************
3437 * Name : BOOL WIN32API PlaySoundEvent
3438 * Purpose : Unknown
3439 * Parameters: Unknown
3440 * Variables :
3441 * Result :
3442 * Remark :
3443 * Status : UNTESTED UNKNOWN STUB
3444 *
3445 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3446 *****************************************************************************/
3447BOOL WIN32API PlaySoundEvent(DWORD x1)
3448{
3449 dprintf(("USER32: PlaySoundEvent(%08x) not implemented.\n",
3450 x1));
3451
3452 return (FALSE); /* default */
3453}
3454/*****************************************************************************
3455 * Name : BOOL WIN32API SetSysColorsTemp
3456 * Purpose : Unknown
3457 * Parameters: Unknown
3458 * Variables :
3459 * Result :
3460 * Remark :
3461 * Status : UNTESTED UNKNOWN STUB
3462 *
3463 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3464 *****************************************************************************/
3465BOOL WIN32API SetSysColorsTemp(void)
3466{
3467 dprintf(("USER32: SetSysColorsTemp() not implemented.\n"));
3468
3469 return (FALSE); /* default */
3470}
3471/*****************************************************************************
3472 * Name : BOOL WIN32API RegisterNetworkCapabilities
3473 * Purpose : Unknown
3474 * Parameters: Unknown
3475 * Variables :
3476 * Result :
3477 * Remark :
3478 * Status : UNTESTED UNKNOWN STUB
3479 *
3480 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3481 *****************************************************************************/
3482BOOL WIN32API RegisterNetworkCapabilities(DWORD x1,
3483 DWORD x2)
3484{
3485 dprintf(("USER32: RegisterNetworkCapabilities(%08xh,%08xh) not implemented.\n",
3486 x1,
3487 x2));
3488
3489 return (FALSE); /* default */
3490}
3491/*****************************************************************************
3492 * Name : BOOL WIN32API EndTask
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 EndTask(DWORD x1,
3503 DWORD x2,
3504 DWORD x3)
3505{
3506 dprintf(("USER32: EndTask(%08xh,%08xh,%08xh) not implemented.\n",
3507 x1,
3508 x2,
3509 x3));
3510
3511 return (FALSE); /* default */
3512}
3513/*****************************************************************************
3514 * Name : BOOL WIN32API GetNextQueueWindow
3515 * Purpose : Unknown
3516 * Parameters: Unknown
3517 * Variables :
3518 * Result :
3519 * Remark :
3520 * Status : UNTESTED UNKNOWN STUB
3521 *
3522 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3523 *****************************************************************************/
3524BOOL WIN32API GetNextQueueWindow(DWORD x1,
3525 DWORD x2)
3526{
3527 dprintf(("USER32: GetNextQueueWindow(%08xh,%08xh) not implemented.\n",
3528 x1,
3529 x2));
3530
3531 return (FALSE); /* default */
3532}
3533/*****************************************************************************
3534 * Name : BOOL WIN32API YieldTask
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 YieldTask(void)
3545{
3546 dprintf(("USER32: YieldTask() not implemented.\n"));
3547
3548 return (FALSE); /* default */
3549}
3550/*****************************************************************************
3551 * Name : BOOL WIN32API WinOldAppHackoMatic
3552 * Purpose : Unknown
3553 * Parameters: Unknown
3554 * Variables :
3555 * Result :
3556 * Remark :
3557 * Status : UNTESTED UNKNOWN STUB
3558 *
3559 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3560 *****************************************************************************/
3561BOOL WIN32API WinOldAppHackoMatic(DWORD x1)
3562{
3563 dprintf(("USER32: WinOldAppHackoMatic(%08x) not implemented.\n",
3564 x1));
3565
3566 return (FALSE); /* default */
3567}
3568/*****************************************************************************
3569 * Name : BOOL WIN32API RegisterSystemThread
3570 * Purpose : Unknown
3571 * Parameters: Unknown
3572 * Variables :
3573 * Result :
3574 * Remark :
3575 * Status : UNTESTED UNKNOWN STUB
3576 *
3577 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3578 *****************************************************************************/
3579BOOL WIN32API RegisterSystemThread(DWORD x1,
3580 DWORD x2)
3581{
3582 dprintf(("USER32: RegisterSystemThread(%08xh,%08xh) not implemented.\n",
3583 x1,
3584 x2));
3585
3586 return (FALSE); /* default */
3587}
3588/*****************************************************************************
3589 * Name : BOOL WIN32API IsHungThread
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 IsHungThread(DWORD x1)
3600{
3601 dprintf(("USER32: IsHungThread(%08xh) not implemented.\n",
3602 x1));
3603
3604 return (FALSE); /* default */
3605}
3606/*****************************************************************************
3607 * Name : BOOL WIN32API UserSignalProc
3608 * Purpose : Unknown
3609 * Parameters: Unknown
3610 * Variables :
3611 * Result :
3612 * Remark :
3613 * Status : UNTESTED UNKNOWN STUB
3614 *
3615 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3616 *****************************************************************************/
3617BOOL WIN32API UserSignalProc(DWORD x1,
3618 DWORD x2,
3619 DWORD x3,
3620 DWORD x4)
3621{
3622 dprintf(("USER32: SysErrorBox(%08xh,%08xh,%08xh,%08xh) not implemented.\n",
3623 x1,
3624 x2,
3625 x3,
3626 x4));
3627
3628 return (FALSE); /* default */
3629}
3630/*****************************************************************************
3631 * Name : BOOL WIN32API GetShellWindow
3632 * Purpose : Unknown
3633 * Parameters: Unknown
3634 * Variables :
3635 * Result :
3636 * Remark :
3637 * Status : UNTESTED UNKNOWN STUB
3638 *
3639 * Author : Patrick Haller [Wed, 1998/06/16 11:55]
3640 *****************************************************************************/
3641HWND WIN32API GetShellWindow(void)
3642{
3643 dprintf(("USER32: GetShellWindow() not implemented.\n"));
3644
3645 return (0); /* default */
3646}
3647/***********************************************************************
3648 * RegisterTasklist32 [USER32.436]
3649 */
3650DWORD WIN32API RegisterTasklist (DWORD x)
3651{
3652 dprintf(("USER32: RegisterTasklist(%08xh) not implemented.\n",
3653 x));
3654
3655 return TRUE;
3656}
3657
3658
Note: See TracBrowser for help on using the repository browser.