4 * Copyright 2000, 2005 Alexandre Julliard
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #include "wine/debug.h"
28 #include "wine/gdi_driver.h"
29 #include "wine/unicode.h"
31 #include "user_private.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(user
);
36 static USER_DRIVER null_driver
, lazy_load_driver
;
38 const USER_DRIVER
*USER_Driver
= &lazy_load_driver
;
39 static char driver_load_error
[80];
41 static HMODULE
load_desktop_driver( HWND hwnd
)
43 static const WCHAR display_device_guid_propW
[] = {
44 '_','_','w','i','n','e','_','d','i','s','p','l','a','y','_',
45 'd','e','v','i','c','e','_','g','u','i','d',0 };
46 static const WCHAR key_pathW
[] = {
47 'S','y','s','t','e','m','\\',
48 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
49 'C','o','n','t','r','o','l','\\',
50 'V','i','d','e','o','\\','{',0};
51 static const WCHAR displayW
[] = {'}','\\','0','0','0','0',0};
52 static const WCHAR driverW
[] = {'G','r','a','p','h','i','c','s','D','r','i','v','e','r',0};
57 WCHAR key
[(sizeof(key_pathW
) + sizeof(displayW
)) / sizeof(WCHAR
) + 40];
58 UINT guid_atom
= HandleToULong( GetPropW( hwnd
, display_device_guid_propW
));
62 strcpy( driver_load_error
, "The explorer process failed to start." ); /* default error */
66 SendMessageW( hwnd
, WM_NULL
, 0, 0 ); /* wait for the desktop process to be ready */
67 guid_atom
= HandleToULong( GetPropW( hwnd
, display_device_guid_propW
));
69 memcpy( key
, key_pathW
, sizeof(key_pathW
) );
70 if (!GlobalGetAtomNameW( guid_atom
, key
+ strlenW(key
), 40 )) return 0;
71 strcatW( key
, displayW
);
72 if (RegOpenKeyW( HKEY_LOCAL_MACHINE
, key
, &hkey
)) return 0;
74 if (!RegQueryValueExW( hkey
, driverW
, NULL
, NULL
, (BYTE
*)path
, &size
))
76 if (!(ret
= LoadLibraryW( path
))) ERR( "failed to load %s\n", debugstr_w(path
) );
77 TRACE( "%s %p\n", debugstr_w(path
), ret
);
81 size
= sizeof(driver_load_error
);
82 RegQueryValueExA( hkey
, "DriverError", NULL
, NULL
, (BYTE
*)driver_load_error
, &size
);
88 /* load the graphics driver */
89 static const USER_DRIVER
*load_driver(void)
92 HMODULE graphics_driver
;
93 USER_DRIVER
*driver
, *prev
;
95 driver
= HeapAlloc( GetProcessHeap(), 0, sizeof(*driver
) );
96 *driver
= null_driver
;
98 graphics_driver
= load_desktop_driver( GetDesktopWindow() );
101 #define GET_USER_FUNC(name) \
102 do { if ((ptr = GetProcAddress( graphics_driver, #name ))) driver->p##name = ptr; } while(0)
104 GET_USER_FUNC(ActivateKeyboardLayout
);
106 GET_USER_FUNC(GetAsyncKeyState
);
107 GET_USER_FUNC(GetKeyNameText
);
108 GET_USER_FUNC(GetKeyboardLayout
);
109 GET_USER_FUNC(GetKeyboardLayoutList
);
110 GET_USER_FUNC(GetKeyboardLayoutName
);
111 GET_USER_FUNC(LoadKeyboardLayout
);
112 GET_USER_FUNC(MapVirtualKeyEx
);
113 GET_USER_FUNC(RegisterHotKey
);
114 GET_USER_FUNC(ToUnicodeEx
);
115 GET_USER_FUNC(UnloadKeyboardLayout
);
116 GET_USER_FUNC(UnregisterHotKey
);
117 GET_USER_FUNC(VkKeyScanEx
);
118 GET_USER_FUNC(DestroyCursorIcon
);
119 GET_USER_FUNC(SetCursor
);
120 GET_USER_FUNC(GetCursorPos
);
121 GET_USER_FUNC(SetCursorPos
);
122 GET_USER_FUNC(ClipCursor
);
123 GET_USER_FUNC(AcquireClipboard
);
124 GET_USER_FUNC(EmptyClipboard
);
125 GET_USER_FUNC(SetClipboardData
);
126 GET_USER_FUNC(GetClipboardData
);
127 GET_USER_FUNC(CountClipboardFormats
);
128 GET_USER_FUNC(EnumClipboardFormats
);
129 GET_USER_FUNC(IsClipboardFormatAvailable
);
130 GET_USER_FUNC(EndClipboardUpdate
);
131 GET_USER_FUNC(ChangeDisplaySettingsEx
);
132 GET_USER_FUNC(EnumDisplayMonitors
);
133 GET_USER_FUNC(EnumDisplaySettingsEx
);
134 GET_USER_FUNC(GetMonitorInfo
);
135 GET_USER_FUNC(CreateDesktopWindow
);
136 GET_USER_FUNC(CreateWindow
);
137 GET_USER_FUNC(DestroyWindow
);
138 GET_USER_FUNC(GetDC
);
139 GET_USER_FUNC(MsgWaitForMultipleObjectsEx
);
140 GET_USER_FUNC(ReleaseDC
);
141 GET_USER_FUNC(ScrollDC
);
142 GET_USER_FUNC(SetCapture
);
143 GET_USER_FUNC(SetFocus
);
144 GET_USER_FUNC(SetLayeredWindowAttributes
);
145 GET_USER_FUNC(SetParent
);
146 GET_USER_FUNC(SetWindowRgn
);
147 GET_USER_FUNC(SetWindowIcon
);
148 GET_USER_FUNC(SetWindowStyle
);
149 GET_USER_FUNC(SetWindowText
);
150 GET_USER_FUNC(ShowWindow
);
151 GET_USER_FUNC(SysCommand
);
152 GET_USER_FUNC(UpdateLayeredWindow
);
153 GET_USER_FUNC(WindowMessage
);
154 GET_USER_FUNC(WindowPosChanging
);
155 GET_USER_FUNC(WindowPosChanged
);
156 GET_USER_FUNC(SystemParametersInfo
);
160 prev
= InterlockedCompareExchangePointer( (void **)&USER_Driver
, driver
, &lazy_load_driver
);
161 if (prev
!= &lazy_load_driver
)
163 /* another thread beat us to it */
164 HeapFree( GetProcessHeap(), 0, driver
);
167 else LdrAddRefDll( 0, graphics_driver
);
169 __wine_set_display_driver( graphics_driver
);
170 register_builtin_classes();
175 /* unload the graphics driver on process exit */
176 void USER_unload_driver(void)
179 /* make sure we don't try to call the driver after it has been detached */
180 prev
= InterlockedExchangePointer( (void **)&USER_Driver
, &null_driver
);
181 if (prev
!= &lazy_load_driver
&& prev
!= &null_driver
)
182 HeapFree( GetProcessHeap(), 0, prev
);
186 /**********************************************************************
189 * These are fallbacks for entry points that are not implemented in the real driver.
192 static HKL CDECL
nulldrv_ActivateKeyboardLayout( HKL layout
, UINT flags
)
197 static void CDECL
nulldrv_Beep(void)
201 static SHORT CDECL
nulldrv_GetAsyncKeyState( INT key
)
206 static UINT CDECL
nulldrv_GetKeyboardLayoutList( INT size
, HKL
*layouts
)
211 ULONG_PTR baselayout
;
213 static const WCHAR szKeyboardReg
[] = {'S','y','s','t','e','m','\\','C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\','C','o','n','t','r','o','l','\\','K','e','y','b','o','a','r','d',' ','L','a','y','o','u','t','s',0};
215 baselayout
= GetUserDefaultLCID();
216 langid
= PRIMARYLANGID(LANGIDFROMLCID(baselayout
));
217 if (langid
== LANG_CHINESE
|| langid
== LANG_JAPANESE
|| langid
== LANG_KOREAN
)
218 baselayout
|= 0xe001 << 16; /* IME */
220 baselayout
|= baselayout
<< 16;
222 /* Enumerate the Registry */
223 rc
= RegOpenKeyW(HKEY_LOCAL_MACHINE
,szKeyboardReg
,&hKeyKeyboard
);
224 if (rc
== ERROR_SUCCESS
)
229 rc
= RegEnumKeyW(hKeyKeyboard
, count
, szKeyName
, 9);
230 if (rc
== ERROR_SUCCESS
)
232 layout
= (HKL
)(ULONG_PTR
)strtoulW(szKeyName
,NULL
,16);
233 if (baselayout
!= 0 && layout
== (HKL
)baselayout
)
234 baselayout
= 0; /* found in the registry do not add again */
237 if (count
>= size
) break;
238 layouts
[count
] = layout
;
242 } while (rc
== ERROR_SUCCESS
);
243 RegCloseKey(hKeyKeyboard
);
246 /* make sure our base layout is on the list */
253 layouts
[count
] = (HKL
)baselayout
;
264 static INT CDECL
nulldrv_GetKeyNameText( LONG lparam
, LPWSTR buffer
, INT size
)
269 static HKL CDECL
nulldrv_GetKeyboardLayout( DWORD thread_id
)
274 static BOOL CDECL
nulldrv_GetKeyboardLayoutName( LPWSTR name
)
279 static HKL CDECL
nulldrv_LoadKeyboardLayout( LPCWSTR name
, UINT flags
)
284 static UINT CDECL
nulldrv_MapVirtualKeyEx( UINT code
, UINT type
, HKL layout
)
289 static BOOL CDECL
nulldrv_RegisterHotKey( HWND hwnd
, UINT modifiers
, UINT vk
)
294 static INT CDECL
nulldrv_ToUnicodeEx( UINT virt
, UINT scan
, const BYTE
*state
, LPWSTR str
,
295 int size
, UINT flags
, HKL layout
)
300 static BOOL CDECL
nulldrv_UnloadKeyboardLayout( HKL layout
)
305 static void CDECL
nulldrv_UnregisterHotKey( HWND hwnd
, UINT modifiers
, UINT vk
)
309 static SHORT CDECL
nulldrv_VkKeyScanEx( WCHAR ch
, HKL layout
)
314 static void CDECL
nulldrv_DestroyCursorIcon( HCURSOR cursor
)
318 static void CDECL
nulldrv_SetCursor( HCURSOR cursor
)
322 static BOOL CDECL
nulldrv_GetCursorPos( LPPOINT pt
)
327 static BOOL CDECL
nulldrv_SetCursorPos( INT x
, INT y
)
332 static BOOL CDECL
nulldrv_ClipCursor( LPCRECT clip
)
337 static INT CDECL
nulldrv_AcquireClipboard( HWND hwnd
)
342 static BOOL CDECL
nulldrv_CountClipboardFormats(void)
347 static void CDECL
nulldrv_EmptyClipboard( BOOL keepunowned
)
351 static void CDECL
nulldrv_EndClipboardUpdate(void)
355 static UINT CDECL
nulldrv_EnumClipboardFormats( UINT format
)
360 static HANDLE CDECL
nulldrv_GetClipboardData( UINT format
)
365 static BOOL CDECL
nulldrv_IsClipboardFormatAvailable( UINT format
)
370 static BOOL CDECL
nulldrv_SetClipboardData( UINT format
, HANDLE handle
, BOOL owner
)
375 static LONG CDECL
nulldrv_ChangeDisplaySettingsEx( LPCWSTR name
, LPDEVMODEW mode
, HWND hwnd
,
376 DWORD flags
, LPVOID lparam
)
378 return DISP_CHANGE_FAILED
;
381 static BOOL CDECL
nulldrv_EnumDisplayMonitors( HDC hdc
, LPRECT rect
, MONITORENUMPROC proc
, LPARAM lp
)
386 static BOOL CDECL
nulldrv_EnumDisplaySettingsEx( LPCWSTR name
, DWORD num
, LPDEVMODEW mode
, DWORD flags
)
391 static BOOL CDECL
nulldrv_GetMonitorInfo( HMONITOR handle
, LPMONITORINFO info
)
396 static BOOL CDECL
nulldrv_CreateDesktopWindow( HWND hwnd
)
401 static BOOL CDECL
nulldrv_CreateWindow( HWND hwnd
)
404 HWND parent
= GetAncestor( hwnd
, GA_PARENT
);
406 /* HWND_MESSAGE windows don't need a graphics driver */
407 if (!parent
|| parent
== get_user_thread_info()->msg_window
) return TRUE
;
408 if (warned
++) return FALSE
;
410 MESSAGE( "Application tried to create a window, but no driver could be loaded.\n");
411 if (driver_load_error
[0]) MESSAGE( "%s\n", driver_load_error
);
415 static void CDECL
nulldrv_DestroyWindow( HWND hwnd
)
419 static void CDECL
nulldrv_GetDC( HDC hdc
, HWND hwnd
, HWND top_win
, const RECT
*win_rect
,
420 const RECT
*top_rect
, DWORD flags
)
424 static DWORD CDECL
nulldrv_MsgWaitForMultipleObjectsEx( DWORD count
, const HANDLE
*handles
, DWORD timeout
,
425 DWORD mask
, DWORD flags
)
427 return WaitForMultipleObjectsEx( count
, handles
, flags
& MWMO_WAITALL
,
428 timeout
, flags
& MWMO_ALERTABLE
);
431 static void CDECL
nulldrv_ReleaseDC( HWND hwnd
, HDC hdc
)
435 static BOOL CDECL
nulldrv_ScrollDC( HDC hdc
, INT dx
, INT dy
, HRGN update
)
439 GetClipBox( hdc
, &rect
);
440 return BitBlt( hdc
, rect
.left
, rect
.top
, rect
.right
- rect
.left
, rect
.bottom
- rect
.top
,
441 hdc
, rect
.left
- dx
, rect
.top
- dy
, SRCCOPY
);
444 static void CDECL
nulldrv_SetCapture( HWND hwnd
, UINT flags
)
448 static void CDECL
nulldrv_SetFocus( HWND hwnd
)
452 static void CDECL
nulldrv_SetLayeredWindowAttributes( HWND hwnd
, COLORREF key
, BYTE alpha
, DWORD flags
)
456 static void CDECL
nulldrv_SetParent( HWND hwnd
, HWND parent
, HWND old_parent
)
460 static int CDECL
nulldrv_SetWindowRgn( HWND hwnd
, HRGN hrgn
, BOOL redraw
)
465 static void CDECL
nulldrv_SetWindowIcon( HWND hwnd
, UINT type
, HICON icon
)
469 static void CDECL
nulldrv_SetWindowStyle( HWND hwnd
, INT offset
, STYLESTRUCT
*style
)
473 static void CDECL
nulldrv_SetWindowText( HWND hwnd
, LPCWSTR text
)
477 static UINT CDECL
nulldrv_ShowWindow( HWND hwnd
, INT cmd
, RECT
*rect
, UINT swp
)
482 static LRESULT CDECL
nulldrv_SysCommand( HWND hwnd
, WPARAM wparam
, LPARAM lparam
)
487 static BOOL CDECL
nulldrv_UpdateLayeredWindow( HWND hwnd
, const UPDATELAYEREDWINDOWINFO
*info
,
488 const RECT
*window_rect
)
493 static LRESULT CDECL
nulldrv_WindowMessage( HWND hwnd
, UINT msg
, WPARAM wparam
, LPARAM lparam
)
498 static void CDECL
nulldrv_WindowPosChanging( HWND hwnd
, HWND insert_after
, UINT swp_flags
,
499 const RECT
*window_rect
, const RECT
*client_rect
,
500 RECT
*visible_rect
, struct window_surface
**surface
)
504 static void CDECL
nulldrv_WindowPosChanged( HWND hwnd
, HWND insert_after
, UINT swp_flags
,
505 const RECT
*window_rect
, const RECT
*client_rect
,
506 const RECT
*visible_rect
, const RECT
*valid_rects
,
507 struct window_surface
*surface
)
511 static BOOL CDECL
nulldrv_SystemParametersInfo( UINT action
, UINT int_param
, void *ptr_param
, UINT flags
)
516 static USER_DRIVER null_driver
=
518 /* keyboard functions */
519 nulldrv_ActivateKeyboardLayout
,
521 nulldrv_GetAsyncKeyState
,
522 nulldrv_GetKeyNameText
,
523 nulldrv_GetKeyboardLayout
,
524 nulldrv_GetKeyboardLayoutList
,
525 nulldrv_GetKeyboardLayoutName
,
526 nulldrv_LoadKeyboardLayout
,
527 nulldrv_MapVirtualKeyEx
,
528 nulldrv_RegisterHotKey
,
530 nulldrv_UnloadKeyboardLayout
,
531 nulldrv_UnregisterHotKey
,
533 /* cursor/icon functions */
534 nulldrv_DestroyCursorIcon
,
536 nulldrv_GetCursorPos
,
537 nulldrv_SetCursorPos
,
539 /* clipboard functions */
540 nulldrv_AcquireClipboard
,
541 nulldrv_CountClipboardFormats
,
542 nulldrv_EmptyClipboard
,
543 nulldrv_EndClipboardUpdate
,
544 nulldrv_EnumClipboardFormats
,
545 nulldrv_GetClipboardData
,
546 nulldrv_IsClipboardFormatAvailable
,
547 nulldrv_SetClipboardData
,
549 nulldrv_ChangeDisplaySettingsEx
,
550 nulldrv_EnumDisplayMonitors
,
551 nulldrv_EnumDisplaySettingsEx
,
552 nulldrv_GetMonitorInfo
,
553 /* windowing functions */
554 nulldrv_CreateDesktopWindow
,
555 nulldrv_CreateWindow
,
556 nulldrv_DestroyWindow
,
558 nulldrv_MsgWaitForMultipleObjectsEx
,
563 nulldrv_SetLayeredWindowAttributes
,
565 nulldrv_SetWindowRgn
,
566 nulldrv_SetWindowIcon
,
567 nulldrv_SetWindowStyle
,
568 nulldrv_SetWindowText
,
571 nulldrv_UpdateLayeredWindow
,
572 nulldrv_WindowMessage
,
573 nulldrv_WindowPosChanging
,
574 nulldrv_WindowPosChanged
,
575 /* system parameters */
576 nulldrv_SystemParametersInfo
580 /**********************************************************************
581 * Lazy loading user driver
583 * Initial driver used before another driver is loaded.
584 * Each entry point simply loads the real driver and chains to it.
587 static HKL CDECL
loaderdrv_ActivateKeyboardLayout( HKL layout
, UINT flags
)
589 return load_driver()->pActivateKeyboardLayout( layout
, flags
);
592 static void CDECL
loaderdrv_Beep(void)
594 load_driver()->pBeep();
597 static SHORT CDECL
loaderdrv_GetAsyncKeyState( INT key
)
599 return load_driver()->pGetAsyncKeyState( key
);
602 static INT CDECL
loaderdrv_GetKeyNameText( LONG lparam
, LPWSTR buffer
, INT size
)
604 return load_driver()->pGetKeyNameText( lparam
, buffer
, size
);
607 static HKL CDECL
loaderdrv_GetKeyboardLayout( DWORD thread_id
)
609 return load_driver()->pGetKeyboardLayout( thread_id
);
612 static UINT CDECL
loaderdrv_GetKeyboardLayoutList( INT size
, HKL
*layouts
)
614 return load_driver()->pGetKeyboardLayoutList( size
, layouts
);
617 static BOOL CDECL
loaderdrv_GetKeyboardLayoutName( LPWSTR name
)
619 return load_driver()->pGetKeyboardLayoutName( name
);
622 static HKL CDECL
loaderdrv_LoadKeyboardLayout( LPCWSTR name
, UINT flags
)
624 return load_driver()->pLoadKeyboardLayout( name
, flags
);
627 static UINT CDECL
loaderdrv_MapVirtualKeyEx( UINT code
, UINT type
, HKL layout
)
629 return load_driver()->pMapVirtualKeyEx( code
, type
, layout
);
632 static BOOL CDECL
loaderdrv_RegisterHotKey( HWND hwnd
, UINT modifiers
, UINT vk
)
634 return load_driver()->pRegisterHotKey( hwnd
, modifiers
, vk
);
637 static INT CDECL
loaderdrv_ToUnicodeEx( UINT virt
, UINT scan
, const BYTE
*state
, LPWSTR str
,
638 int size
, UINT flags
, HKL layout
)
640 return load_driver()->pToUnicodeEx( virt
, scan
, state
, str
, size
, flags
, layout
);
643 static BOOL CDECL
loaderdrv_UnloadKeyboardLayout( HKL layout
)
645 return load_driver()->pUnloadKeyboardLayout( layout
);
648 static void CDECL
loaderdrv_UnregisterHotKey( HWND hwnd
, UINT modifiers
, UINT vk
)
650 load_driver()->pUnregisterHotKey( hwnd
, modifiers
, vk
);
653 static SHORT CDECL
loaderdrv_VkKeyScanEx( WCHAR ch
, HKL layout
)
655 return load_driver()->pVkKeyScanEx( ch
, layout
);
658 static void CDECL
loaderdrv_SetCursor( HCURSOR cursor
)
660 load_driver()->pSetCursor( cursor
);
663 static BOOL CDECL
loaderdrv_GetCursorPos( LPPOINT pt
)
665 return load_driver()->pGetCursorPos( pt
);
668 static BOOL CDECL
loaderdrv_SetCursorPos( INT x
, INT y
)
670 return load_driver()->pSetCursorPos( x
, y
);
673 static BOOL CDECL
loaderdrv_ClipCursor( LPCRECT clip
)
675 return load_driver()->pClipCursor( clip
);
678 static INT CDECL
loaderdrv_AcquireClipboard( HWND hwnd
)
680 return load_driver()->pAcquireClipboard( hwnd
);
683 static BOOL CDECL
loaderdrv_CountClipboardFormats(void)
685 return load_driver()->pCountClipboardFormats();
688 static void CDECL
loaderdrv_EmptyClipboard( BOOL keepunowned
)
690 load_driver()->pEmptyClipboard( keepunowned
);
693 static void CDECL
loaderdrv_EndClipboardUpdate(void)
695 load_driver()->pEndClipboardUpdate();
698 static UINT CDECL
loaderdrv_EnumClipboardFormats( UINT format
)
700 return load_driver()->pEnumClipboardFormats( format
);
703 static HANDLE CDECL
loaderdrv_GetClipboardData( UINT format
)
705 return load_driver()->pGetClipboardData( format
);
708 static BOOL CDECL
loaderdrv_IsClipboardFormatAvailable( UINT format
)
710 return load_driver()->pIsClipboardFormatAvailable( format
);
713 static BOOL CDECL
loaderdrv_SetClipboardData( UINT format
, HANDLE handle
, BOOL owner
)
715 return load_driver()->pSetClipboardData( format
, handle
, owner
);
718 static LONG CDECL
loaderdrv_ChangeDisplaySettingsEx( LPCWSTR name
, LPDEVMODEW mode
, HWND hwnd
,
719 DWORD flags
, LPVOID lparam
)
721 return load_driver()->pChangeDisplaySettingsEx( name
, mode
, hwnd
, flags
, lparam
);
724 static BOOL CDECL
loaderdrv_EnumDisplayMonitors( HDC hdc
, LPRECT rect
, MONITORENUMPROC proc
, LPARAM lp
)
726 return load_driver()->pEnumDisplayMonitors( hdc
, rect
, proc
, lp
);
729 static BOOL CDECL
loaderdrv_EnumDisplaySettingsEx( LPCWSTR name
, DWORD num
, LPDEVMODEW mode
, DWORD flags
)
731 return load_driver()->pEnumDisplaySettingsEx( name
, num
, mode
, flags
);
734 static BOOL CDECL
loaderdrv_GetMonitorInfo( HMONITOR handle
, LPMONITORINFO info
)
736 return load_driver()->pGetMonitorInfo( handle
, info
);
739 static BOOL CDECL
loaderdrv_CreateDesktopWindow( HWND hwnd
)
741 return load_driver()->pCreateDesktopWindow( hwnd
);
744 static BOOL CDECL
loaderdrv_CreateWindow( HWND hwnd
)
746 return load_driver()->pCreateWindow( hwnd
);
749 static void CDECL
loaderdrv_GetDC( HDC hdc
, HWND hwnd
, HWND top_win
, const RECT
*win_rect
,
750 const RECT
*top_rect
, DWORD flags
)
752 load_driver()->pGetDC( hdc
, hwnd
, top_win
, win_rect
, top_rect
, flags
);
755 static void CDECL
loaderdrv_SetLayeredWindowAttributes( HWND hwnd
, COLORREF key
, BYTE alpha
, DWORD flags
)
757 load_driver()->pSetLayeredWindowAttributes( hwnd
, key
, alpha
, flags
);
760 static int CDECL
loaderdrv_SetWindowRgn( HWND hwnd
, HRGN hrgn
, BOOL redraw
)
762 return load_driver()->pSetWindowRgn( hwnd
, hrgn
, redraw
);
765 static BOOL CDECL
loaderdrv_UpdateLayeredWindow( HWND hwnd
, const UPDATELAYEREDWINDOWINFO
*info
,
766 const RECT
*window_rect
)
768 return load_driver()->pUpdateLayeredWindow( hwnd
, info
, window_rect
);
771 static USER_DRIVER lazy_load_driver
=
773 /* keyboard functions */
774 loaderdrv_ActivateKeyboardLayout
,
776 loaderdrv_GetAsyncKeyState
,
777 loaderdrv_GetKeyNameText
,
778 loaderdrv_GetKeyboardLayout
,
779 loaderdrv_GetKeyboardLayoutList
,
780 loaderdrv_GetKeyboardLayoutName
,
781 loaderdrv_LoadKeyboardLayout
,
782 loaderdrv_MapVirtualKeyEx
,
783 loaderdrv_RegisterHotKey
,
784 loaderdrv_ToUnicodeEx
,
785 loaderdrv_UnloadKeyboardLayout
,
786 loaderdrv_UnregisterHotKey
,
787 loaderdrv_VkKeyScanEx
,
788 /* cursor/icon functions */
789 nulldrv_DestroyCursorIcon
,
791 loaderdrv_GetCursorPos
,
792 loaderdrv_SetCursorPos
,
793 loaderdrv_ClipCursor
,
794 /* clipboard functions */
795 loaderdrv_AcquireClipboard
,
796 loaderdrv_CountClipboardFormats
,
797 loaderdrv_EmptyClipboard
,
798 loaderdrv_EndClipboardUpdate
,
799 loaderdrv_EnumClipboardFormats
,
800 loaderdrv_GetClipboardData
,
801 loaderdrv_IsClipboardFormatAvailable
,
802 loaderdrv_SetClipboardData
,
804 loaderdrv_ChangeDisplaySettingsEx
,
805 loaderdrv_EnumDisplayMonitors
,
806 loaderdrv_EnumDisplaySettingsEx
,
807 loaderdrv_GetMonitorInfo
,
808 /* windowing functions */
809 loaderdrv_CreateDesktopWindow
,
810 loaderdrv_CreateWindow
,
811 nulldrv_DestroyWindow
,
813 nulldrv_MsgWaitForMultipleObjectsEx
,
818 loaderdrv_SetLayeredWindowAttributes
,
820 loaderdrv_SetWindowRgn
,
821 nulldrv_SetWindowIcon
,
822 nulldrv_SetWindowStyle
,
823 nulldrv_SetWindowText
,
826 loaderdrv_UpdateLayeredWindow
,
827 nulldrv_WindowMessage
,
828 nulldrv_WindowPosChanging
,
829 nulldrv_WindowPosChanged
,
830 /* system parameters */
831 nulldrv_SystemParametersInfo