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

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

functions now sorted

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