branch update for HEAD-2003021201
[reactos.git] / lib / user32 / windows / window.c
1 /* $Id$
2  *
3  * COPYRIGHT:       See COPYING in the top level directory
4  * PROJECT:         ReactOS user32.dll
5  * FILE:            lib/user32/windows/window.c
6  * PURPOSE:         Window management
7  * PROGRAMMER:      Casper S. Hornstrup (chorns@users.sourceforge.net)
8  * UPDATE HISTORY:
9  *      06-06-2001  CSH  Created
10  */
11
12 /* INCLUDES ******************************************************************/
13
14 #include <windows.h>
15 #include <user32.h>
16 #include <window.h>
17 #include <debug.h>
18 #include <user32/callback.h>
19
20 /* FUNCTIONS *****************************************************************/
21
22 NTSTATUS STDCALL
23 User32SendNCCALCSIZEMessageForKernel(PVOID Arguments, ULONG ArgumentLength)
24 {
25   PSENDNCCALCSIZEMESSAGE_CALLBACK_ARGUMENTS CallbackArgs;
26   SENDNCCALCSIZEMESSAGE_CALLBACK_RESULT Result;
27   WNDPROC Proc;
28
29   DbgPrint("User32SendNCCALCSIZEMessageForKernel.\n");
30   CallbackArgs = (PSENDNCCALCSIZEMESSAGE_CALLBACK_ARGUMENTS)Arguments;
31   if (ArgumentLength != sizeof(SENDNCCALCSIZEMESSAGE_CALLBACK_ARGUMENTS))
32     {
33       DbgPrint("Wrong length.\n");
34       return(STATUS_INFO_LENGTH_MISMATCH);
35     }
36   Proc = (WNDPROC)GetWindowLongW(CallbackArgs->Wnd, GWL_WNDPROC);
37   DbgPrint("Proc %X\n", Proc);
38   /* Call the window procedure; notice kernel messages are always unicode. */
39   if (CallbackArgs->Validate)
40     {
41       Result.Result = CallWindowProcW(Proc, CallbackArgs->Wnd, WM_NCCALCSIZE, 
42                                       TRUE, 
43                                       (LPARAM)&CallbackArgs->Params);
44       Result.Params = CallbackArgs->Params;
45     }
46   else
47     {
48       Result.Result = CallWindowProcW(Proc, CallbackArgs->Wnd, WM_NCCALCSIZE,
49                                       FALSE, (LPARAM)&CallbackArgs->Rect);
50       Result.Rect = CallbackArgs->Rect;
51     }
52   DbgPrint("Returning result %d.\n", Result);
53   return(ZwCallbackReturn(&Result, sizeof(Result), STATUS_SUCCESS));
54 }
55
56 NTSTATUS STDCALL
57 User32SendGETMINMAXINFOMessageForKernel(PVOID Arguments, ULONG ArgumentLength)
58 {
59   PSENDGETMINMAXINFO_CALLBACK_ARGUMENTS CallbackArgs;
60   SENDGETMINMAXINFO_CALLBACK_RESULT Result;
61   WNDPROC Proc;
62
63   DbgPrint("User32SendGETMINAXINFOMessageForKernel.\n");
64   CallbackArgs = (PSENDGETMINMAXINFO_CALLBACK_ARGUMENTS)Arguments;
65   if (ArgumentLength != sizeof(SENDGETMINMAXINFO_CALLBACK_ARGUMENTS))
66     {
67       DbgPrint("Wrong length.\n");
68       return(STATUS_INFO_LENGTH_MISMATCH);
69     }
70   Proc = (WNDPROC)GetWindowLongW(CallbackArgs->Wnd, GWL_WNDPROC);
71   DbgPrint("Proc %X\n", Proc);
72   /* Call the window procedure; notice kernel messages are always unicode. */
73   Result.Result = CallWindowProcW(Proc, CallbackArgs->Wnd, WM_GETMINMAXINFO, 
74                                   0, (LPARAM)&CallbackArgs->MinMaxInfo);
75   Result.MinMaxInfo = CallbackArgs->MinMaxInfo;
76   DbgPrint("Returning result %d.\n", Result);
77   return(ZwCallbackReturn(&Result, sizeof(Result), STATUS_SUCCESS));
78 }
79
80 NTSTATUS STDCALL
81 User32SendCREATEMessageForKernel(PVOID Arguments, ULONG ArgumentLength)
82 {
83   PSENDCREATEMESSAGE_CALLBACK_ARGUMENTS CallbackArgs;
84   WNDPROC Proc;
85   LRESULT Result;
86
87   DbgPrint("User32SendCREATEMessageForKernel.\n");
88   CallbackArgs = (PSENDCREATEMESSAGE_CALLBACK_ARGUMENTS)Arguments;
89   if (ArgumentLength != sizeof(SENDCREATEMESSAGE_CALLBACK_ARGUMENTS))
90     {
91       DbgPrint("Wrong length.\n");
92       return(STATUS_INFO_LENGTH_MISMATCH);
93     }
94   Proc = (WNDPROC)GetWindowLongW(CallbackArgs->Wnd, GWL_WNDPROC);
95   DbgPrint("Proc %X\n", Proc);
96   /* Call the window procedure; notice kernel messages are always unicode. */
97   Result = CallWindowProcW(Proc, CallbackArgs->Wnd, WM_CREATE, 0, 
98                            (LPARAM)&CallbackArgs->CreateStruct);
99   DbgPrint("Returning result %d.\n", Result);
100   return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS));
101 }
102
103 NTSTATUS STDCALL
104 User32SendNCCREATEMessageForKernel(PVOID Arguments, ULONG ArgumentLength)
105 {
106   PSENDNCCREATEMESSAGE_CALLBACK_ARGUMENTS CallbackArgs;
107   WNDPROC Proc;
108   LRESULT Result;
109
110   DbgPrint("User32SendNCCREATEMessageForKernel.\n");
111   CallbackArgs = (PSENDNCCREATEMESSAGE_CALLBACK_ARGUMENTS)Arguments;
112   if (ArgumentLength != sizeof(SENDNCCREATEMESSAGE_CALLBACK_ARGUMENTS))
113     {
114       DbgPrint("Wrong length.\n");
115       return(STATUS_INFO_LENGTH_MISMATCH);
116     }
117   Proc = (WNDPROC)GetWindowLongW(CallbackArgs->Wnd, GWL_WNDPROC);
118   DbgPrint("Proc %X\n", Proc);
119   /* Call the window procedure; notice kernel messages are always unicode. */
120   Result = CallWindowProcW(Proc, CallbackArgs->Wnd, WM_NCCREATE, 0, 
121                            (LPARAM)&CallbackArgs->CreateStruct);
122   DbgPrint("Returning result %d.\n", Result);
123   return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS));
124 }
125
126 NTSTATUS STDCALL
127 User32CallSendAsyncProcForKernel(PVOID Arguments, ULONG ArgumentLength)
128 {
129   PSENDASYNCPROC_CALLBACK_ARGUMENTS CallbackArgs;
130
131   DbgPrint("User32CallSendAsyncProcKernel()\n");
132   CallbackArgs = (PSENDASYNCPROC_CALLBACK_ARGUMENTS)Arguments;
133   if (ArgumentLength != sizeof(WINDOWPROC_CALLBACK_ARGUMENTS))
134     {
135       return(STATUS_INFO_LENGTH_MISMATCH);
136     }
137   CallbackArgs->Callback(CallbackArgs->Wnd, CallbackArgs->Msg,
138                          CallbackArgs->Context, CallbackArgs->Result);
139   return(STATUS_SUCCESS);
140 }
141
142 NTSTATUS STDCALL
143 User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength)
144 {
145   PWINDOWPROC_CALLBACK_ARGUMENTS CallbackArgs;
146   LRESULT Result;
147
148   CallbackArgs = (PWINDOWPROC_CALLBACK_ARGUMENTS)Arguments;
149   if (ArgumentLength != sizeof(WINDOWPROC_CALLBACK_ARGUMENTS))
150     {
151       return(STATUS_INFO_LENGTH_MISMATCH);
152     }
153   if (CallbackArgs->Proc == NULL)
154     {
155       CallbackArgs->Proc = (WNDPROC)GetWindowLong(CallbackArgs->Wnd, 
156                                                   GWL_WNDPROC);
157     }
158   Result = CallWindowProcW(CallbackArgs->Proc, CallbackArgs->Wnd, 
159                            CallbackArgs->Msg, CallbackArgs->wParam, 
160                            CallbackArgs->lParam);
161   return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS));
162 }
163
164 WINBOOL STDCALL
165 AdjustWindowRect(LPRECT lpRect,
166                  DWORD dwStyle,
167                  WINBOOL bMenu)
168 {
169   return(AdjustWindowRectEx(lpRect, dwStyle, bMenu, 0));
170 }
171
172 WINBOOL STDCALL
173 AdjustWindowRectEx(LPRECT lpRect, 
174                    DWORD dwStyle, 
175                    WINBOOL bMenu, 
176                    DWORD dwExStyle)
177 {
178   return(FALSE);
179 }
180
181 WINBOOL STDCALL
182 AllowSetForegroundWindow(DWORD dwProcessId)
183 {
184   return(FALSE);
185 }
186
187 WINBOOL STDCALL
188 AnimateWindow(HWND hwnd,
189               DWORD dwTime,
190               DWORD dwFlags)
191 {
192   return FALSE;
193 }
194
195 UINT STDCALL
196 ArrangeIconicWindows(HWND hWnd)
197 {
198   return 0;
199 }
200
201 HDWP STDCALL
202 BeginDeferWindowPos(int nNumWindows)
203 {
204   return (HDWP)0;
205 }
206
207 WINBOOL STDCALL
208 BringWindowToTop(HWND hWnd)
209 {
210   return FALSE;
211 }
212
213 WORD STDCALL
214 CascadeWindows(HWND hwndParent,
215                UINT wHow,
216                CONST RECT *lpRect,
217                UINT cKids,
218                const HWND *lpKids)
219 {
220   return 0;
221 }
222
223 HWND STDCALL
224 ChildWindowFromPoint(HWND hWndParent,
225                      POINT Point)
226 {
227   return (HWND)0;
228 }
229
230 HWND STDCALL
231 ChildWindowFromPointEx(HWND hwndParent,
232                        POINT pt,
233                        UINT uFlags)
234 {
235   return (HWND)0;
236 }
237
238 WINBOOL STDCALL
239 CloseWindow(HWND hWnd)
240 {
241   return FALSE;
242 }
243
244 HWND STDCALL
245 CreateWindowExA(DWORD dwExStyle,
246                 LPCSTR lpClassName,
247                 LPCSTR lpWindowName,
248                 DWORD dwStyle,
249                 int x,
250                 int y,
251                 int nWidth,
252                 int nHeight,
253                 HWND hWndParent,
254                 HMENU hMenu,
255                 HINSTANCE hInstance,
256                 LPVOID lpParam)
257 {
258   UNICODE_STRING WindowName;
259   UNICODE_STRING ClassName;
260   HWND Handle;
261   INT sw;
262   
263   if (IS_ATOM(lpClassName)) 
264     {
265       RtlInitUnicodeString(&ClassName, NULL);
266       ClassName.Buffer = (LPWSTR)lpClassName;
267     } 
268   else 
269     {
270       if (!RtlCreateUnicodeStringFromAsciiz(&(ClassName), (PCSZ)lpClassName)) 
271         {
272           SetLastError(ERROR_OUTOFMEMORY);
273           return (HWND)0;
274         }
275     }
276
277   if (!RtlCreateUnicodeStringFromAsciiz(&WindowName, (PCSZ)lpWindowName)) 
278     {
279       if (!IS_ATOM(lpClassName)) 
280         {
281           RtlFreeUnicodeString(&ClassName);
282         }
283       SetLastError(ERROR_OUTOFMEMORY);
284       return (HWND)0;
285     }
286
287   /* Fixup default coordinates. */
288   sw = SW_SHOW;
289   if (x == (LONG) CW_USEDEFAULT || nWidth == (LONG) CW_USEDEFAULT)
290     {
291       if (dwStyle & (WS_CHILD | WS_POPUP))
292         {
293           if (x == (LONG) CW_USEDEFAULT)
294             {
295               x = y = 0;
296             }
297           if (nWidth == (LONG) CW_USEDEFAULT)
298             {
299               nWidth = nHeight = 0;
300             }
301         }
302       else
303         {
304           STARTUPINFOA info;
305
306           GetStartupInfoA(&info);
307
308           if (x == (LONG) CW_USEDEFAULT)
309             {
310               if (y != (LONG) CW_USEDEFAULT)
311                 {
312                   sw = y;
313                 }
314               x = (info.dwFlags & STARTF_USEPOSITION) ? info.dwX : 0;
315               y = (info.dwFlags & STARTF_USEPOSITION) ? info.dwY : 0;
316             }
317           
318           if (nWidth == (LONG) CW_USEDEFAULT)
319             {
320               if (info.dwFlags & STARTF_USESIZE)
321                 {
322                   nWidth = info.dwXSize;
323                   nHeight = info.dwYSize;
324                 }
325               else
326                 {
327                   RECT r;
328
329                   SystemParametersInfoA(SPI_GETWORKAREA, 0, &r, 0);
330                   nWidth = (((r.right - r.left) * 3) / 4) - x;
331                   nHeight = (((r.bottom - r.top) * 3) / 4) - y;
332                 }
333             }
334         }
335     }
336
337   Handle = NtUserCreateWindowEx(dwExStyle,
338                                 &ClassName,
339                                 &WindowName,
340                                 dwStyle,
341                                 x,
342                                 y,
343                                 nWidth,
344                                 nHeight,
345                                 hWndParent,
346                                 hMenu,
347                                 hInstance,
348                                 lpParam,
349                                 sw);
350
351   RtlFreeUnicodeString(&WindowName);
352
353   if (!IS_ATOM(lpClassName)) 
354     {
355       RtlFreeUnicodeString(&ClassName);
356     }
357   
358   return Handle;
359 }
360
361 HWND STDCALL
362 CreateWindowExW(DWORD dwExStyle,
363                 LPCWSTR lpClassName,
364                 LPCWSTR lpWindowName,
365                 DWORD dwStyle,
366                 int x,
367                 int y,
368                 int nWidth,
369                 int nHeight,
370                 HWND hWndParent,
371                 HMENU hMenu,
372                 HINSTANCE hInstance,
373                 LPVOID lpParam)
374 {
375   UNICODE_STRING WindowName;
376   UNICODE_STRING ClassName;
377   HANDLE Handle;
378   UINT sw;
379
380   if (IS_ATOM(lpClassName)) 
381     {
382       RtlInitUnicodeString(&ClassName, NULL);
383       ClassName.Buffer = (LPWSTR)lpClassName;
384     } 
385   else 
386     {
387       RtlInitUnicodeString(&ClassName, lpClassName);
388     }
389
390   RtlInitUnicodeString(&WindowName, lpWindowName);
391
392   /* Fixup default coordinates. */
393   sw = SW_SHOW;
394   if (x == (LONG) CW_USEDEFAULT || nWidth == (LONG) CW_USEDEFAULT)
395     {
396       if (dwStyle & (WS_CHILD | WS_POPUP))
397         {
398           if (x == (LONG) CW_USEDEFAULT)
399             {
400               x = y = 0;
401             }
402           if (nWidth == (LONG) CW_USEDEFAULT)
403             {
404               nWidth = nHeight = 0;
405             }
406         }
407       else
408         {
409           STARTUPINFOW info;
410
411           GetStartupInfoW(&info);
412
413           if (x == (LONG) CW_USEDEFAULT)
414             {
415               if (y != (LONG) CW_USEDEFAULT)
416                 {
417                   sw = y;
418                 }
419               x = (info.dwFlags & STARTF_USEPOSITION) ? info.dwX : 0;
420               y = (info.dwFlags & STARTF_USEPOSITION) ? info.dwY : 0;
421             }
422           
423           if (nWidth == (LONG) CW_USEDEFAULT)
424             {
425               if (info.dwFlags & STARTF_USESIZE)
426                 {
427                   nWidth = info.dwXSize;
428                   nHeight = info.dwYSize;
429                 }
430               else
431                 {
432                   RECT r;
433
434                   SystemParametersInfoW(SPI_GETWORKAREA, 0, &r, 0);
435                   nWidth = (((r.right - r.left) * 3) / 4) - x;
436                   nHeight = (((r.bottom - r.top) * 3) / 4) - y;
437                 }
438             }
439         }
440     }
441
442   Handle = NtUserCreateWindowEx(dwExStyle,
443                                 &ClassName,
444                                 &WindowName,
445                                 dwStyle,
446                                 x,
447                                 y,
448                                 nWidth,
449                                 nHeight,
450                                 hWndParent,
451                                 hMenu,
452                                 hInstance,
453                                 lpParam,
454                                 0);
455
456   return (HWND)Handle;
457 }
458
459 HDWP STDCALL
460 DeferWindowPos(HDWP hWinPosInfo,
461                HWND hWnd,
462                HWND hWndInsertAfter,
463                int x,
464                int y,
465                int cx,
466                int cy,
467                UINT uFlags)
468 {
469   return (HDWP)0;
470 }
471
472 WINBOOL STDCALL
473 DestroyWindow(HWND hWnd)
474 {
475   return FALSE;
476 }
477
478 WINBOOL STDCALL
479 EndDeferWindowPos(HDWP hWinPosInfo)
480 {
481   return FALSE;
482 }
483
484 WINBOOL STDCALL
485 EnumChildWindows(HWND hWndParent,
486                  ENUMWINDOWSPROC lpEnumFunc,
487                  LPARAM lParam)
488 {
489   return FALSE;
490 }
491
492 WINBOOL STDCALL
493 EnumThreadWindows(DWORD dwThreadId,
494                   ENUMWINDOWSPROC lpfn,
495                   LPARAM lParam)
496 {
497   return FALSE;
498 }
499
500 WINBOOL STDCALL
501 EnumWindows(ENUMWINDOWSPROC lpEnumFunc,
502             LPARAM lParam)
503 {
504   return FALSE;
505 }
506
507 HWND STDCALL
508 FindWindowA(LPCSTR lpClassName, LPCSTR lpWindowName)
509 {
510   //FIXME: FindWindow does not search children, but FindWindowEx does.
511   //       what should we do about this?
512   return FindWindowExA (NULL, NULL, lpClassName, lpWindowName);
513 }
514
515 HWND STDCALL
516 FindWindowExA(HWND hwndParent,
517               HWND hwndChildAfter,
518               LPCSTR lpszClass,
519               LPCSTR lpszWindow)
520 {
521   return (HWND)0;
522 }
523
524 HWND STDCALL
525 FindWindowW(LPCWSTR lpClassName, LPCWSTR lpWindowName)
526 {
527   //FIXME: FindWindow does not search children, but FindWindowEx does.
528   //       what should we do about this?
529   return FindWindowExW (NULL, NULL, lpClassName, lpWindowName);
530 }
531
532 HWND STDCALL
533 FindWindowExW(HWND hwndParent,
534               HWND hwndChildAfter,
535               LPCWSTR lpszClass,
536               LPCWSTR lpszWindow)
537 {
538   return (HWND)0;
539 }
540
541 WINBOOL STDCALL
542 GetAltTabInfo(HWND hwnd,
543               int iItem,
544               PALTTABINFO pati,
545               LPTSTR pszItemText,
546               UINT cchItemText)
547 {
548   return FALSE;
549 }
550
551 WINBOOL STDCALL
552 GetAltTabInfoA(HWND hwnd,
553                int iItem,
554                PALTTABINFO pati,
555                LPSTR pszItemText,
556                UINT cchItemText)
557 {
558   return FALSE;
559 }
560
561 WINBOOL STDCALL
562 GetAltTabInfoW(HWND hwnd,
563                int iItem,
564                PALTTABINFO pati,
565                LPWSTR pszItemText,
566                UINT cchItemText)
567 {
568   return FALSE;
569 }
570
571 HWND STDCALL
572 GetAncestor(HWND hwnd, UINT gaFlags)
573 {
574   return(NtUserGetAncestor(hwnd, gaFlags));
575 }
576
577 WINBOOL STDCALL
578 GetClientRect(HWND hWnd, LPRECT lpRect)
579 {
580   return FALSE;
581 }
582
583 HWND STDCALL
584 GetDesktopWindow(VOID)
585 {
586   return (HWND)0;
587 }
588
589 HWND STDCALL
590 GetForegroundWindow(VOID)
591 {
592   return (HWND)0;
593 }
594
595 WINBOOL STDCALL
596 GetGUIThreadInfo(DWORD idThread,
597                  LPGUITHREADINFO lpgui)
598 {
599   return FALSE;
600 }
601
602 HWND STDCALL
603 GetLastActivePopup(HWND hWnd)
604 {
605   return (HWND)0;
606 }
607
608 HWND STDCALL
609 GetParent(HWND hWnd)
610 {
611   return (HWND)0;
612 }
613
614 WINBOOL STDCALL
615 GetProcessDefaultLayout(DWORD *pdwDefaultLayout)
616 {
617   return FALSE;
618 }
619
620 WINBOOL STDCALL
621 GetTitleBarInfo(HWND hwnd,
622                 PTITLEBARINFO pti)
623 {
624   return FALSE;
625 }
626
627 HWND STDCALL
628 GetTopWindow(HWND hWnd)
629 {
630   return (HWND)0;
631 }
632
633 HWND STDCALL
634 GetWindow(HWND hWnd,
635           UINT uCmd)
636 {
637   return (HWND)0;
638 }
639
640 WINBOOL STDCALL
641 GetWindowInfo(HWND hwnd,
642               PWINDOWINFO pwi)
643 {
644   return FALSE;
645 }
646
647 UINT STDCALL
648 GetWindowModuleFileName(HWND hwnd,
649                         LPSTR lpszFileName,
650                         UINT cchFileNameMax)
651 {
652   return 0;
653 }
654
655 UINT STDCALL
656 GetWindowModuleFileNameA(HWND hwnd,
657                          LPSTR lpszFileName,
658                          UINT cchFileNameMax)
659 {
660   return 0;
661 }
662
663 UINT STDCALL
664 GetWindowModuleFileNameW(HWND hwnd,
665                          LPWSTR lpszFileName,
666                          UINT cchFileNameMax)
667 {
668   return 0;
669 }
670
671 WINBOOL STDCALL
672 GetWindowPlacement(HWND hWnd,
673                    WINDOWPLACEMENT *lpwndpl)
674 {
675   return FALSE;
676 }
677
678 WINBOOL STDCALL
679 GetWindowRect(HWND hWnd,
680               LPRECT lpRect)
681 {
682   return(NtUserGetWindowRect(hWnd, lpRect));
683 }
684
685 int STDCALL
686 GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
687 {
688   return(SendMessageA(hWnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString));
689 }
690
691 int STDCALL
692 GetWindowTextLengthA(HWND hWnd)
693 {
694   return(SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0));
695 }
696
697 int STDCALL
698 GetWindowTextLengthW(HWND hWnd)
699 {
700   return 0;
701 }
702
703 int STDCALL
704 GetWindowTextW(HWND hWnd,
705                LPWSTR lpString,
706                int nMaxCount)
707 {
708   return 0;
709 }
710
711 DWORD STDCALL
712 GetWindowThreadProcessId(HWND hWnd,
713                          LPDWORD lpdwProcessId)
714 {
715   return 0;
716 }
717
718 WINBOOL STDCALL
719 IsChild(HWND hWndParent,
720         HWND hWnd)
721 {
722   return FALSE;
723 }
724
725 WINBOOL STDCALL
726 IsIconic(HWND hWnd)
727 {
728   return FALSE;
729 }
730
731 WINBOOL STDCALL
732 IsWindow(HWND hWnd)
733 {
734   return FALSE;
735 }
736
737 WINBOOL STDCALL
738 IsWindowUnicode(HWND hWnd)
739 {
740   return FALSE;
741 }
742
743 WINBOOL STDCALL
744 IsWindowVisible(HWND hWnd)
745 {
746   while (GetWindowLong(hWnd, GWL_STYLE) & WS_CHILD)
747     {
748       if (!(GetWindowLong(hWnd, GWL_STYLE) & WS_VISIBLE))
749         {
750           return(FALSE);
751         }
752       hWnd = GetAncestor(hWnd, GA_PARENT);
753     }
754   return(GetWindowLong(hWnd, GWL_STYLE) & WS_VISIBLE);
755 }
756
757 WINBOOL STDCALL
758 IsZoomed(HWND hWnd)
759 {
760   return FALSE;
761 }
762
763 WINBOOL STDCALL
764 LockSetForegroundWindow(UINT uLockCode)
765 {
766   return FALSE;
767 }
768
769 WINBOOL STDCALL
770 MoveWindow(HWND hWnd,
771            int X,
772            int Y,
773            int nWidth,
774            int nHeight,
775            WINBOOL bRepaint)
776 {
777   return FALSE;
778 }
779
780 WINBOOL STDCALL
781 OpenIcon(HWND hWnd)
782 {
783   return FALSE;
784 }
785
786 HWND STDCALL
787 RealChildWindowFromPoint(HWND hwndParent,
788                          POINT ptParentClientCoords)
789 {
790   return (HWND)0;
791 }
792
793 UINT
794 RealGetWindowClass(HWND  hwnd,
795                    LPTSTR pszType,
796                    UINT  cchType)
797 {
798   return 0;
799 }
800
801 WINBOOL STDCALL
802 SetForegroundWindow(HWND hWnd)
803 {
804   return FALSE;
805 }
806
807 WINBOOL STDCALL
808 SetLayeredWindowAttributes(HWND hwnd,
809                            COLORREF crKey,
810                            BYTE bAlpha,
811                            DWORD dwFlags)
812 {
813   return FALSE;
814 }
815
816 HWND STDCALL
817 SetParent(HWND hWndChild,
818           HWND hWndNewParent)
819 {
820   return (HWND)0;
821 }
822
823 WINBOOL STDCALL
824 SetProcessDefaultLayout(DWORD dwDefaultLayout)
825 {
826   return FALSE;
827 }
828
829 WINBOOL STDCALL
830 SetWindowPlacement(HWND hWnd,
831                    CONST WINDOWPLACEMENT *lpwndpl)
832 {
833   return FALSE;
834 }
835
836 WINBOOL STDCALL
837 SetWindowPos(HWND hWnd,
838              HWND hWndInsertAfter,
839              int X,
840              int Y,
841              int cx,
842              int cy,
843              UINT uFlags)
844 {
845   return FALSE;
846 }
847
848 WINBOOL STDCALL
849 SetWindowTextA(HWND hWnd,
850                LPCSTR lpString)
851 {
852   return FALSE;
853 }
854
855 WINBOOL STDCALL
856 SetWindowTextW(HWND hWnd,
857                LPCWSTR lpString)
858 {
859   return FALSE;
860 }
861
862 WINBOOL STDCALL
863 ShowOwnedPopups(HWND hWnd,
864                 WINBOOL fShow)
865 {
866   return FALSE;
867 }
868
869 WINBOOL STDCALL
870 ShowWindow(HWND hWnd,
871            int nCmdShow)
872 {
873   return NtUserShowWindow(hWnd, nCmdShow);
874 }
875
876 WINBOOL STDCALL
877 ShowWindowAsync(HWND hWnd,
878                 int nCmdShow)
879 {
880   return FALSE;
881 }
882
883 WORD STDCALL
884 TileWindows(HWND hwndParent,
885             UINT wHow,
886             CONST RECT *lpRect,
887             UINT cKids,
888             const HWND *lpKids)
889 {
890   return 0;
891 }
892
893 WINBOOL STDCALL
894 UpdateLayeredWindow(HWND hwnd,
895                     HDC hdcDst,
896                     POINT *pptDst,
897                     SIZE *psize,
898                     HDC hdcSrc,
899                     POINT *pptSrc,
900                     COLORREF crKey,
901                     BLENDFUNCTION *pblend,
902                     DWORD dwFlags)
903 {
904   return FALSE;
905 }
906
907 HWND STDCALL
908 WindowFromPoint(POINT Point)
909 {
910   return (HWND)0;
911 }
912
913 int STDCALL
914 MapWindowPoints(HWND hWndFrom, HWND hWndTo, LPPOINT lpPoints, UINT cPoints)
915 {
916   POINT FromOffset, ToOffset;
917   LONG XMove, YMove;
918   ULONG i;
919
920   NtUserGetClientOrigin(hWndFrom, &FromOffset);
921   NtUserGetClientOrigin(hWndTo, &ToOffset);
922   XMove = ToOffset.x - FromOffset.x;
923   YMove = ToOffset.y - FromOffset.y;
924   for (i = 0; i < cPoints; i++)
925     {
926       lpPoints[i].x += XMove;
927       lpPoints[i].y += YMove;
928     }
929   return(MAKELONG(LOWORD(XMove), LOWORD(YMove))); 
930 }
931
932
933 WINBOOL STDCALL 
934 ScreenToClient(HWND hWnd, LPPOINT lpPoint)
935 {
936   return(MapWindowPoints(NULL, hWnd, lpPoint, 1));
937 }
938
939 /* EOF */