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

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

Dialog fixes + ported Wine apis

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