From: Jacek Caban jacek@codeweavers.com
--- dlls/user32/message.c | 13 ------------- dlls/user32/user32.spec | 2 +- dlls/win32u/message.c | 8 ++++++++ dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 5 +++++ include/ntuser.h | 1 + 8 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 92096e4a81d..9ad4abd21b5 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -1026,19 +1026,6 @@ BOOL WINAPI GetCurrentInputMessageSource( INPUT_MESSAGE_SOURCE *source ) }
-/*********************************************************************** - * WaitMessage (USER.112) Suspend thread pending messages - * WaitMessage (USER32.@) Suspend thread pending messages - * - * WaitMessage() suspends a thread until events appear in the thread's - * queue. - */ -BOOL WINAPI WaitMessage(void) -{ - return NtUserMsgWaitForMultipleObjectsEx( 0, NULL, INFINITE, QS_ALLINPUT, 0 ) != WAIT_FAILED; -} - - /*********************************************************************** * MsgWaitForMultipleObjects (USER32.@) */ diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index a53d02cd064..d9cf610b470 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -820,7 +820,7 @@ @ stdcall WINNLSGetIMEHotkey(long) @ stub WNDPROC_CALLBACK @ stdcall WaitForInputIdle(long long) -@ stdcall WaitMessage() +@ stdcall WaitMessage() NtUserWaitMessage # @ stub Win32PoolAllocationStats @ stdcall WinHelpA(long str long long) @ stdcall WinHelpW(long wstr long long) diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 8db81a57065..ff417169ad1 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2256,6 +2256,14 @@ DWORD WINAPI NtUserWaitForInputIdle( HANDLE process, DWORD timeout, BOOL wow ) return WAIT_TIMEOUT; }
+/*********************************************************************** + * NtUserWaitMessage (win32u.@) + */ +BOOL WINAPI NtUserWaitMessage(void) +{ + return NtUserMsgWaitForMultipleObjectsEx( 0, NULL, INFINITE, QS_ALLINPUT, 0 ) != WAIT_FAILED; +} + /*********************************************************************** * NtUserPeekMessage (win32u.@) */ diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index 6c59c91b5b0..cfe2961c45d 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -308,6 +308,7 @@ static void * const syscalls[] = NtUserValidateRect, NtUserVkKeyScanEx, NtUserWaitForInputIdle, + NtUserWaitMessage, NtUserWindowFromDC, NtUserWindowFromPoint, }; diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 1ffcfcaef5a..af70ad7d3e5 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1308,7 +1308,7 @@ @ stdcall -syscall NtUserWaitForInputIdle(long long long) @ stub NtUserWaitForMsgAndEvent @ stub NtUserWaitForRedirectionStartComplete -@ stub NtUserWaitMessage +@ stdcall -syscall NtUserWaitMessage() @ stdcall -syscall NtUserWindowFromDC(long) @ stub NtUserWindowFromPhysicalPoint @ stdcall -syscall NtUserWindowFromPoint(long long) diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index 24e52a2a476..e84d4dd60c6 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -294,6 +294,7 @@ SYSCALL_ENTRY( NtUserValidateRect ) \ SYSCALL_ENTRY( NtUserVkKeyScanEx ) \ SYSCALL_ENTRY( NtUserWaitForInputIdle ) \ + SYSCALL_ENTRY( NtUserWaitMessage ) \ SYSCALL_ENTRY( NtUserWindowFromDC ) \ SYSCALL_ENTRY( NtUserWindowFromPoint )
diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index c8354e6b04a..0841119c2d6 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -4154,6 +4154,11 @@ NTSTATUS WINAPI wow64_NtUserWaitForInputIdle( UINT *args ) return NtUserWaitForInputIdle( process, timeout, wow ); }
+NTSTATUS WINAPI wow64_NtUserWaitMessage( UINT *args ) +{ + return NtUserWaitMessage(); +} + NTSTATUS WINAPI wow64_NtUserWindowFromDC( UINT *args ) { HDC hdc = get_handle( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index 2ca383c6e69..5b2b24a7f33 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -898,6 +898,7 @@ BOOL WINAPI NtUserUpdateLayeredWindow( HWND hwnd, HDC hdc_dst, const POINT *p BOOL WINAPI NtUserValidateRect( HWND hwnd, const RECT *rect ); WORD WINAPI NtUserVkKeyScanEx( WCHAR chr, HKL layout ); DWORD WINAPI NtUserWaitForInputIdle( HANDLE process, DWORD timeout, BOOL wow ); +BOOL WINAPI NtUserWaitMessage(void); HWND WINAPI NtUserWindowFromDC( HDC hdc ); HWND WINAPI NtUserWindowFromPoint( LONG x, LONG y );
From: Jacek Caban jacek@codeweavers.com
--- dlls/user32/focus.c | 12 +----------- dlls/win32u/input.c | 15 +++++++++++++++ dlls/win32u/sysparams.c | 3 +++ dlls/win32u/win32u_private.h | 1 + include/ntuser.h | 6 ++++++ 5 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c index 2d15aa9c6e7..e79f6f68dc2 100644 --- a/dlls/user32/focus.c +++ b/dlls/user32/focus.c @@ -112,17 +112,7 @@ BOOL WINAPI SetShellWindow(HWND hwndShell) */ HWND WINAPI GetShellWindow(void) { - HWND hwndShell = 0; - - SERVER_START_REQ(set_global_windows) - { - req->flags = 0; - if (!wine_server_call_err(req)) - hwndShell = wine_server_ptr_handle( reply->old_shell_window ); - } - SERVER_END_REQ; - - return hwndShell; + return NtUserGetShellWindow(); }
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 75230e961e0..fb87d6395d3 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2150,3 +2150,18 @@ void toggle_caret( HWND hwnd )
if (ret && !hidden) display_caret( hwnd, &r ); } + +HWND get_shell_window(void) +{ + HWND hwnd = 0; + + SERVER_START_REQ(set_global_windows) + { + req->flags = 0; + if (!wine_server_call_err(req)) + hwnd = wine_server_ptr_handle( reply->old_shell_window ); + } + SERVER_END_REQ; + + return hwnd; +} diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 5854e000fea..89be3bbc6ed 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -5437,6 +5437,9 @@ ULONG_PTR WINAPI NtUserCallNoParam( ULONG code ) case NtUserCallNoParam_GetProcessDefaultLayout: return process_layout;
+ case NtUserCallNoParam_GetShellWindow: + return HandleToUlong( get_shell_window() ); + case NtUserCallNoParam_ReleaseCapture: return release_capture();
diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 8fc00cf3296..1fe2f80da61 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -271,6 +271,7 @@ extern HWND get_capture(void) DECLSPEC_HIDDEN; extern BOOL get_cursor_pos( POINT *pt ) DECLSPEC_HIDDEN; extern HWND get_focus(void) DECLSPEC_HIDDEN; extern DWORD get_input_state(void) DECLSPEC_HIDDEN; +extern HWND get_shell_window(void) DECLSPEC_HIDDEN; extern BOOL WINAPI release_capture(void) DECLSPEC_HIDDEN; extern BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret ) DECLSPEC_HIDDEN; extern BOOL set_caret_blink_time( unsigned int time ) DECLSPEC_HIDDEN; diff --git a/include/ntuser.h b/include/ntuser.h index 5b2b24a7f33..94d5326fc6e 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -910,6 +910,7 @@ enum NtUserCallNoParam_GetDialogBaseUnits, NtUserCallNoParam_GetInputState, NtUserCallNoParam_GetProcessDefaultLayout, + NtUserCallNoParam_GetShellWindow, NtUserCallNoParam_ReleaseCapture, /* temporary exports */ NtUserExitingThread, @@ -941,6 +942,11 @@ static inline DWORD NtUserGetProcessDefaultLayout(void) return NtUserCallNoParam( NtUserCallNoParam_GetProcessDefaultLayout ); }
+static inline HWND NtUserGetShellWindow(void) +{ + return UlongToHandle( NtUserCallNoParam( NtUserCallNoParam_GetShellWindow )); +} + static inline BOOL NtUserReleaseCapture(void) { return NtUserCallNoParam( NtUserCallNoParam_ReleaseCapture );
From: Jacek Caban jacek@codeweavers.com
--- dlls/user32/focus.c | 47 ++--------------------------------------- dlls/user32/user32.spec | 2 +- dlls/win32u/input.c | 42 ++++++++++++++++++++++++++++++++++++ dlls/win32u/syscall.c | 1 + dlls/win32u/win32u.spec | 2 +- dlls/wow64win/syscall.h | 1 + dlls/wow64win/user.c | 8 +++++++ include/ntuser.h | 3 ++- 8 files changed, 58 insertions(+), 48 deletions(-)
diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c index e79f6f68dc2..53802f98b1a 100644 --- a/dlls/user32/focus.c +++ b/dlls/user32/focus.c @@ -55,55 +55,12 @@ HWND WINAPI GetFocus(void) }
-/*********************************************************************** -* SetShellWindowEx (USER32.@) -* hwndShell = Progman[Program Manager] -* |-> SHELLDLL_DefView -* hwndListView = | |-> SysListView32 -* | | |-> tooltips_class32 -* | | -* | |-> SysHeader32 -* | -* |-> ProxyTarget -*/ -BOOL WINAPI SetShellWindowEx(HWND hwndShell, HWND hwndListView) -{ - BOOL ret; - - if (GetShellWindow()) - return FALSE; - - if (GetWindowLongW(hwndShell, GWL_EXSTYLE) & WS_EX_TOPMOST) - return FALSE; - - if (hwndListView != hwndShell) - if (GetWindowLongW(hwndListView, GWL_EXSTYLE) & WS_EX_TOPMOST) - return FALSE; - - if (hwndListView && hwndListView!=hwndShell) - NtUserSetWindowPos( hwndListView, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE ); - - NtUserSetWindowPos( hwndShell, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE ); - - SERVER_START_REQ(set_global_windows) - { - req->flags = SET_GLOBAL_SHELL_WINDOWS; - req->shell_window = wine_server_user_handle( hwndShell ); - req->shell_listview = wine_server_user_handle( hwndListView ); - ret = !wine_server_call_err(req); - } - SERVER_END_REQ; - - return ret; -} - - /******************************************************************* * SetShellWindow (USER32.@) */ -BOOL WINAPI SetShellWindow(HWND hwndShell) +BOOL WINAPI SetShellWindow( HWND hwnd ) { - return SetShellWindowEx(hwndShell, hwndShell); + return NtUserSetShellWindowEx( hwnd, hwnd ); }
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index d9cf610b470..1628c7ca74a 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -708,7 +708,7 @@ @ stdcall SetScrollPos(long long long long) @ stdcall SetScrollRange(long long long long long) @ stdcall SetShellWindow(long) -@ stdcall SetShellWindowEx (long long) +@ stdcall SetShellWindowEx(long long) NtUserSetShellWindowEx @ stdcall SetSysColors(long ptr ptr) NtUserSetSysColors @ stdcall SetSysColorsTemp(ptr ptr long) @ stdcall SetSystemCursor(long long) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index fb87d6395d3..66fbd0746ae 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2165,3 +2165,45 @@ HWND get_shell_window(void)
return hwnd; } + +/*********************************************************************** +* NtUserSetShellWindowEx (win32u.@) +*/ +BOOL WINAPI NtUserSetShellWindowEx( HWND shell, HWND list_view ) +{ + BOOL ret; + + /* shell = Progman[Program Manager] + * |-> SHELLDLL_DefView + * list_view = | |-> SysListView32 + * | | |-> tooltips_class32 + * | | + * | |-> SysHeader32 + * | + * |-> ProxyTarget + */ + + if (get_shell_window()) + return FALSE; + + if (get_window_long( shell, GWL_EXSTYLE ) & WS_EX_TOPMOST) + return FALSE; + + if (list_view != shell && (get_window_long( list_view, GWL_EXSTYLE ) & WS_EX_TOPMOST)) + return FALSE; + + if (list_view && list_view != shell) + NtUserSetWindowPos( list_view, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE ); + + NtUserSetWindowPos( shell, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE ); + + SERVER_START_REQ(set_global_windows) + { + req->flags = SET_GLOBAL_SHELL_WINDOWS; + req->shell_window = wine_server_user_handle( shell ); + req->shell_listview = wine_server_user_handle( list_view ); + ret = !wine_server_call_err(req); + } + SERVER_END_REQ; + return ret; +} diff --git a/dlls/win32u/syscall.c b/dlls/win32u/syscall.c index cfe2961c45d..32812a3d881 100644 --- a/dlls/win32u/syscall.c +++ b/dlls/win32u/syscall.c @@ -273,6 +273,7 @@ static void * const syscalls[] = NtUserSetProcessWindowStation, NtUserSetProp, NtUserSetScrollInfo, + NtUserSetShellWindowEx, NtUserSetSysColors, NtUserSetSystemMenu, NtUserSetSystemTimer, diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index af70ad7d3e5..c3ed3c0559a 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1226,7 +1226,7 @@ @ stdcall -syscall NtUserSetScrollInfo(long long ptr long) @ stub NtUserSetSensorPresence @ stub NtUserSetSharedWindowData -@ stub NtUserSetShellWindowEx +@ stdcall -syscall NtUserSetShellWindowEx(long long) @ stdcall -syscall NtUserSetSysColors(long ptr ptr) @ stub NtUserSetSystemCursor @ stdcall -syscall NtUserSetSystemMenu(long long) diff --git a/dlls/wow64win/syscall.h b/dlls/wow64win/syscall.h index e84d4dd60c6..ecf79f69cce 100644 --- a/dlls/wow64win/syscall.h +++ b/dlls/wow64win/syscall.h @@ -259,6 +259,7 @@ SYSCALL_ENTRY( NtUserSetProcessWindowStation ) \ SYSCALL_ENTRY( NtUserSetProp ) \ SYSCALL_ENTRY( NtUserSetScrollInfo ) \ + SYSCALL_ENTRY( NtUserSetShellWindowEx ) \ SYSCALL_ENTRY( NtUserSetSysColors ) \ SYSCALL_ENTRY( NtUserSetSystemMenu ) \ SYSCALL_ENTRY( NtUserSetSystemTimer ) \ diff --git a/dlls/wow64win/user.c b/dlls/wow64win/user.c index 0841119c2d6..4ce8c94c1af 100644 --- a/dlls/wow64win/user.c +++ b/dlls/wow64win/user.c @@ -3624,6 +3624,14 @@ NTSTATUS WINAPI wow64_NtUserSetScrollInfo( UINT *args ) return NtUserSetScrollInfo( hwnd, bar, info, redraw ); }
+NTSTATUS WINAPI wow64_NtUserSetShellWindowEx( UINT *args ) +{ + HWND shell = get_handle( &args ); + HWND list_view = get_handle( &args ); + + return NtUserSetShellWindowEx( shell, list_view ); +} + NTSTATUS WINAPI wow64_NtUserSetSysColors( UINT *args ) { INT count = get_ulong( &args ); diff --git a/include/ntuser.h b/include/ntuser.h index 94d5326fc6e..7a44f4b0b15 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -803,7 +803,6 @@ DWORD WINAPI NtUserMsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *han DWORD timeout, DWORD mask, DWORD flags ); void WINAPI NtUserNotifyWinEvent( DWORD event, HWND hwnd, LONG object_id, LONG child_id ); HWINSTA WINAPI NtUserOpenWindowStation( OBJECT_ATTRIBUTES *attr, ACCESS_MASK access ); -BOOL WINAPI NtUserSetObjectInformation( HANDLE handle, INT index, void *info, DWORD len ); BOOL WINAPI NtUserOpenClipboard( HWND hwnd, ULONG unk ); HDESK WINAPI NtUserOpenDesktop( OBJECT_ATTRIBUTES *attr, DWORD flags, ACCESS_MASK access ); HDESK WINAPI NtUserOpenInputDesktop( DWORD flags, BOOL inherit, ACCESS_MASK access ); @@ -849,11 +848,13 @@ BOOL WINAPI NtUserSetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE a BOOL WINAPI NtUserSetMenu( HWND hwnd, HMENU menu ); BOOL WINAPI NtUserSetMenuContextHelpId( HMENU handle, DWORD id ); BOOL WINAPI NtUserSetMenuDefaultItem( HMENU handle, UINT item, UINT bypos ); +BOOL WINAPI NtUserSetObjectInformation( HANDLE handle, INT index, void *info, DWORD len ); HWND WINAPI NtUserSetParent( HWND hwnd, HWND parent ); BOOL WINAPI NtUserSetProcessDpiAwarenessContext( ULONG awareness, ULONG unknown ); BOOL WINAPI NtUserSetProcessWindowStation( HWINSTA handle ); BOOL WINAPI NtUserSetProp( HWND hwnd, const WCHAR *str, HANDLE handle ); INT WINAPI NtUserSetScrollInfo( HWND hwnd, INT bar, const SCROLLINFO *info, BOOL redraw ); +BOOL WINAPI NtUserSetShellWindowEx( HWND shell, HWND list_view ); BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *values ); BOOL WINAPI NtUserSetSystemMenu( HWND hwnd, HMENU menu ); UINT_PTR WINAPI NtUserSetSystemTimer( HWND hwnd, UINT_PTR id, UINT timeout );
From: Jacek Caban jacek@codeweavers.com
--- dlls/user32/focus.c | 11 ++--------- dlls/win32u/input.c | 12 ++++++++++++ dlls/win32u/win32u_private.h | 1 + dlls/win32u/window.c | 3 +++ include/ntuser.h | 6 ++++++ 5 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c index 53802f98b1a..4d18c49214e 100644 --- a/dlls/user32/focus.c +++ b/dlls/user32/focus.c @@ -76,16 +76,9 @@ HWND WINAPI GetShellWindow(void) /*********************************************************************** * SetProgmanWindow (USER32.@) */ -HWND WINAPI SetProgmanWindow ( HWND hwnd ) +HWND WINAPI SetProgmanWindow( HWND hwnd ) { - SERVER_START_REQ(set_global_windows) - { - req->flags = SET_GLOBAL_PROGMAN_WINDOW; - req->progman_window = wine_server_user_handle( hwnd ); - if (wine_server_call_err( req )) hwnd = 0; - } - SERVER_END_REQ; - return hwnd; + return NtUserSetProgmanWindow( hwnd ); }
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 66fbd0746ae..783db67031a 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2207,3 +2207,15 @@ BOOL WINAPI NtUserSetShellWindowEx( HWND shell, HWND list_view ) SERVER_END_REQ; return ret; } + +HWND set_progman_window( HWND hwnd ) +{ + SERVER_START_REQ(set_global_windows) + { + req->flags = SET_GLOBAL_PROGMAN_WINDOW; + req->progman_window = wine_server_user_handle( hwnd ); + if (wine_server_call_err( req )) hwnd = 0; + } + SERVER_END_REQ; + return hwnd; +} diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 1fe2f80da61..fd29423cec5 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -277,6 +277,7 @@ extern BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret ) DECL extern BOOL set_caret_blink_time( unsigned int time ) DECLSPEC_HIDDEN; extern BOOL set_caret_pos( int x, int y ) DECLSPEC_HIDDEN; extern BOOL set_foreground_window( HWND hwnd, BOOL mouse ) DECLSPEC_HIDDEN; +extern HWND set_progman_window( HWND hwnd ) DECLSPEC_HIDDEN; extern void toggle_caret( HWND hwnd ) DECLSPEC_HIDDEN; extern void update_mouse_tracking_info( HWND hwnd ) DECLSPEC_HIDDEN;
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 24931eab199..91baca39eaa 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5429,6 +5429,9 @@ ULONG_PTR WINAPI NtUserCallHwnd( HWND hwnd, DWORD code ) case NtUserCallHwnd_SetForegroundWindow: return set_foreground_window( hwnd, FALSE );
+ case NtUserCallHwnd_SetProgmanWindow: + return HandleToUlong( set_progman_window( hwnd )); + /* temporary exports */ case NtUserGetFullWindowHandle: return HandleToUlong( get_full_window_handle( hwnd )); diff --git a/include/ntuser.h b/include/ntuser.h index 7a44f4b0b15..19e8443475d 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -1175,6 +1175,7 @@ enum NtUserCallHwnd_IsWindowUnicode, NtUserCallHwnd_IsWindowVisible, NtUserCallHwnd_SetForegroundWindow, + NtUserCallHwnd_SetProgmanWindow, /* temporary exports */ NtUserGetFullWindowHandle, NtUserIsCurrehtProcessWindow, @@ -1272,6 +1273,11 @@ static inline BOOL NtUserSetForegroundWindow( HWND hwnd ) return NtUserCallHwnd( hwnd, NtUserCallHwnd_SetForegroundWindow ); }
+static inline HWND NtUserSetProgmanWindow( HWND hwnd ) +{ + return UlongToHandle( NtUserCallHwnd( hwnd, NtUserCallHwnd_SetProgmanWindow )); +} + /* NtUserCallHwndParam codes, not compatible with Windows */ enum {
From: Jacek Caban jacek@codeweavers.com
--- dlls/user32/focus.c | 11 +---------- dlls/win32u/input.c | 14 ++++++++++++++ dlls/win32u/sysparams.c | 3 +++ dlls/win32u/win32u_private.h | 1 + include/ntuser.h | 6 ++++++ 5 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c index 4d18c49214e..18084f7dbfd 100644 --- a/dlls/user32/focus.c +++ b/dlls/user32/focus.c @@ -87,16 +87,7 @@ HWND WINAPI SetProgmanWindow( HWND hwnd ) */ HWND WINAPI GetProgmanWindow(void) { - HWND ret = 0; - - SERVER_START_REQ(set_global_windows) - { - req->flags = 0; - if (!wine_server_call_err(req)) - ret = wine_server_ptr_handle( reply->old_progman_window ); - } - SERVER_END_REQ; - return ret; + return NtUserGetProgmanWindow(); }
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 783db67031a..6d727a934c8 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2208,6 +2208,20 @@ BOOL WINAPI NtUserSetShellWindowEx( HWND shell, HWND list_view ) return ret; }
+HWND get_progman_window(void) +{ + HWND ret = 0; + + SERVER_START_REQ(set_global_windows) + { + req->flags = 0; + if (!wine_server_call_err(req)) + ret = wine_server_ptr_handle( reply->old_progman_window ); + } + SERVER_END_REQ; + return ret; +} + HWND set_progman_window( HWND hwnd ) { SERVER_START_REQ(set_global_windows) diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 89be3bbc6ed..1bd90d85332 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -5437,6 +5437,9 @@ ULONG_PTR WINAPI NtUserCallNoParam( ULONG code ) case NtUserCallNoParam_GetProcessDefaultLayout: return process_layout;
+ case NtUserCallNoParam_GetProgmanWindow: + return HandleToUlong( get_progman_window() ); + case NtUserCallNoParam_GetShellWindow: return HandleToUlong( get_shell_window() );
diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index fd29423cec5..67efa7ddefc 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -271,6 +271,7 @@ extern HWND get_capture(void) DECLSPEC_HIDDEN; extern BOOL get_cursor_pos( POINT *pt ) DECLSPEC_HIDDEN; extern HWND get_focus(void) DECLSPEC_HIDDEN; extern DWORD get_input_state(void) DECLSPEC_HIDDEN; +extern HWND get_progman_window(void) DECLSPEC_HIDDEN; extern HWND get_shell_window(void) DECLSPEC_HIDDEN; extern BOOL WINAPI release_capture(void) DECLSPEC_HIDDEN; extern BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret ) DECLSPEC_HIDDEN; diff --git a/include/ntuser.h b/include/ntuser.h index 19e8443475d..3fc0bc71cd4 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -911,6 +911,7 @@ enum NtUserCallNoParam_GetDialogBaseUnits, NtUserCallNoParam_GetInputState, NtUserCallNoParam_GetProcessDefaultLayout, + NtUserCallNoParam_GetProgmanWindow, NtUserCallNoParam_GetShellWindow, NtUserCallNoParam_ReleaseCapture, /* temporary exports */ @@ -943,6 +944,11 @@ static inline DWORD NtUserGetProcessDefaultLayout(void) return NtUserCallNoParam( NtUserCallNoParam_GetProcessDefaultLayout ); }
+static inline HWND NtUserGetProgmanWindow(void) +{ + return UlongToHandle( NtUserCallNoParam( NtUserCallNoParam_GetProgmanWindow )); +} + static inline HWND NtUserGetShellWindow(void) { return UlongToHandle( NtUserCallNoParam( NtUserCallNoParam_GetShellWindow ));
From: Jacek Caban jacek@codeweavers.com
--- dlls/user32/focus.c | 11 ++--------- dlls/win32u/input.c | 15 +++++++++++++++ dlls/win32u/win32u_private.h | 1 + dlls/win32u/window.c | 3 +++ include/ntuser.h | 6 ++++++ 5 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c index 18084f7dbfd..4fde8a9df96 100644 --- a/dlls/user32/focus.c +++ b/dlls/user32/focus.c @@ -97,16 +97,9 @@ HWND WINAPI GetProgmanWindow(void) * hwnd = MSTaskSwWClass * |-> SysTabControl32 */ -HWND WINAPI SetTaskmanWindow ( HWND hwnd ) +HWND WINAPI SetTaskmanWindow( HWND hwnd ) { - SERVER_START_REQ(set_global_windows) - { - req->flags = SET_GLOBAL_TASKMAN_WINDOW; - req->taskman_window = wine_server_user_handle( hwnd ); - if (wine_server_call_err( req )) hwnd = 0; - } - SERVER_END_REQ; - return hwnd; + return NtUserSetTaskmanWindow( hwnd ); }
/*********************************************************************** diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 6d727a934c8..e12a76f434e 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2233,3 +2233,18 @@ HWND set_progman_window( HWND hwnd ) SERVER_END_REQ; return hwnd; } + +HWND set_taskman_window( HWND hwnd ) +{ + /* hwnd = MSTaskSwWClass + * |-> SysTabControl32 + */ + SERVER_START_REQ(set_global_windows) + { + req->flags = SET_GLOBAL_TASKMAN_WINDOW; + req->taskman_window = wine_server_user_handle( hwnd ); + if (wine_server_call_err( req )) hwnd = 0; + } + SERVER_END_REQ; + return hwnd; +} diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 67efa7ddefc..3b76d2f0d5b 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -279,6 +279,7 @@ extern BOOL set_caret_blink_time( unsigned int time ) DECLSPEC_HIDDEN; extern BOOL set_caret_pos( int x, int y ) DECLSPEC_HIDDEN; extern BOOL set_foreground_window( HWND hwnd, BOOL mouse ) DECLSPEC_HIDDEN; extern HWND set_progman_window( HWND hwnd ) DECLSPEC_HIDDEN; +extern HWND set_taskman_window( HWND hwnd ) DECLSPEC_HIDDEN; extern void toggle_caret( HWND hwnd ) DECLSPEC_HIDDEN; extern void update_mouse_tracking_info( HWND hwnd ) DECLSPEC_HIDDEN;
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 91baca39eaa..19348338c46 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5432,6 +5432,9 @@ ULONG_PTR WINAPI NtUserCallHwnd( HWND hwnd, DWORD code ) case NtUserCallHwnd_SetProgmanWindow: return HandleToUlong( set_progman_window( hwnd ));
+ case NtUserCallHwnd_SetTaskmanWindow: + return HandleToUlong( set_taskman_window( hwnd )); + /* temporary exports */ case NtUserGetFullWindowHandle: return HandleToUlong( get_full_window_handle( hwnd )); diff --git a/include/ntuser.h b/include/ntuser.h index 3fc0bc71cd4..5e94be6b9dc 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -1182,6 +1182,7 @@ enum NtUserCallHwnd_IsWindowVisible, NtUserCallHwnd_SetForegroundWindow, NtUserCallHwnd_SetProgmanWindow, + NtUserCallHwnd_SetTaskmanWindow, /* temporary exports */ NtUserGetFullWindowHandle, NtUserIsCurrehtProcessWindow, @@ -1284,6 +1285,11 @@ static inline HWND NtUserSetProgmanWindow( HWND hwnd ) return UlongToHandle( NtUserCallHwnd( hwnd, NtUserCallHwnd_SetProgmanWindow )); }
+static inline HWND NtUserSetTaskmanWindow( HWND hwnd ) +{ + return UlongToHandle( NtUserCallHwnd( hwnd, NtUserCallHwnd_SetTaskmanWindow )); +} + /* NtUserCallHwndParam codes, not compatible with Windows */ enum {
From: Jacek Caban jacek@codeweavers.com
--- dlls/user32/focus.c | 11 +---------- dlls/win32u/input.c | 14 ++++++++++++++ dlls/win32u/sysparams.c | 3 +++ dlls/win32u/win32u_private.h | 1 + include/ntuser.h | 6 ++++++ 5 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c index 4fde8a9df96..3d996b61510 100644 --- a/dlls/user32/focus.c +++ b/dlls/user32/focus.c @@ -107,14 +107,5 @@ HWND WINAPI SetTaskmanWindow( HWND hwnd ) */ HWND WINAPI GetTaskmanWindow(void) { - HWND ret = 0; - - SERVER_START_REQ(set_global_windows) - { - req->flags = 0; - if (!wine_server_call_err(req)) - ret = wine_server_ptr_handle( reply->old_taskman_window ); - } - SERVER_END_REQ; - return ret; + return NtUserGetTaskmanWindow(); } diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index e12a76f434e..eaad697a63e 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -2234,6 +2234,20 @@ HWND set_progman_window( HWND hwnd ) return hwnd; }
+HWND get_taskman_window(void) +{ + HWND ret = 0; + + SERVER_START_REQ(set_global_windows) + { + req->flags = 0; + if (!wine_server_call_err(req)) + ret = wine_server_ptr_handle( reply->old_taskman_window ); + } + SERVER_END_REQ; + return ret; +} + HWND set_taskman_window( HWND hwnd ) { /* hwnd = MSTaskSwWClass diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 1bd90d85332..13aaaa308c9 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -5443,6 +5443,9 @@ ULONG_PTR WINAPI NtUserCallNoParam( ULONG code ) case NtUserCallNoParam_GetShellWindow: return HandleToUlong( get_shell_window() );
+ case NtUserCallNoParam_GetTaskmanWindow: + return HandleToUlong( get_taskman_window() ); + case NtUserCallNoParam_ReleaseCapture: return release_capture();
diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 3b76d2f0d5b..8e294b7924a 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -273,6 +273,7 @@ extern HWND get_focus(void) DECLSPEC_HIDDEN; extern DWORD get_input_state(void) DECLSPEC_HIDDEN; extern HWND get_progman_window(void) DECLSPEC_HIDDEN; extern HWND get_shell_window(void) DECLSPEC_HIDDEN; +extern HWND get_taskman_window(void) DECLSPEC_HIDDEN; extern BOOL WINAPI release_capture(void) DECLSPEC_HIDDEN; extern BOOL set_capture_window( HWND hwnd, UINT gui_flags, HWND *prev_ret ) DECLSPEC_HIDDEN; extern BOOL set_caret_blink_time( unsigned int time ) DECLSPEC_HIDDEN; diff --git a/include/ntuser.h b/include/ntuser.h index 5e94be6b9dc..7bbe7037f20 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -913,6 +913,7 @@ enum NtUserCallNoParam_GetProcessDefaultLayout, NtUserCallNoParam_GetProgmanWindow, NtUserCallNoParam_GetShellWindow, + NtUserCallNoParam_GetTaskmanWindow, NtUserCallNoParam_ReleaseCapture, /* temporary exports */ NtUserExitingThread, @@ -954,6 +955,11 @@ static inline HWND NtUserGetShellWindow(void) return UlongToHandle( NtUserCallNoParam( NtUserCallNoParam_GetShellWindow )); }
+static inline HWND NtUserGetTaskmanWindow(void) +{ + return UlongToHandle( NtUserCallNoParam( NtUserCallNoParam_GetTaskmanWindow )); +} + static inline BOOL NtUserReleaseCapture(void) { return NtUserCallNoParam( NtUserCallNoParam_ReleaseCapture );
From: Jacek Caban jacek@codeweavers.com
--- dlls/user32/Makefile.in | 1 - dlls/user32/focus.c | 111 ---------------------------------------- dlls/user32/input.c | 84 ++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+), 112 deletions(-) delete mode 100644 dlls/user32/focus.c
diff --git a/dlls/user32/Makefile.in b/dlls/user32/Makefile.in index 0cf2d575e87..112afa4c9a0 100644 --- a/dlls/user32/Makefile.in +++ b/dlls/user32/Makefile.in @@ -20,7 +20,6 @@ C_SRCS = \ dialog.c \ edit.c \ exticon.c \ - focus.c \ hook.c \ icontitle.c \ input.c \ diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c deleted file mode 100644 index 3d996b61510..00000000000 --- a/dlls/user32/focus.c +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Focus and activation functions - * - * Copyright 1993 David Metcalfe - * Copyright 1995 Alex Korobka - * Copyright 1994, 2002 Alexandre Julliard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "user_private.h" -#include "wine/server.h" - - -/******************************************************************* - * SetForegroundWindow (USER32.@) - */ -BOOL WINAPI SetForegroundWindow( HWND hwnd ) -{ - return NtUserSetForegroundWindow( hwnd ); -} - - -/******************************************************************* - * GetActiveWindow (USER32.@) - */ -HWND WINAPI GetActiveWindow(void) -{ - GUITHREADINFO info; - info.cbSize = sizeof(info); - return NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) ? info.hwndActive : 0; -} - - -/***************************************************************** - * GetFocus (USER32.@) - */ -HWND WINAPI GetFocus(void) -{ - GUITHREADINFO info; - info.cbSize = sizeof(info); - return NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) ? info.hwndFocus : 0; -} - - -/******************************************************************* -* SetShellWindow (USER32.@) -*/ -BOOL WINAPI SetShellWindow( HWND hwnd ) -{ - return NtUserSetShellWindowEx( hwnd, hwnd ); -} - - -/******************************************************************* -* GetShellWindow (USER32.@) -*/ -HWND WINAPI GetShellWindow(void) -{ - return NtUserGetShellWindow(); -} - - -/*********************************************************************** - * SetProgmanWindow (USER32.@) - */ -HWND WINAPI SetProgmanWindow( HWND hwnd ) -{ - return NtUserSetProgmanWindow( hwnd ); -} - - -/*********************************************************************** - * GetProgmanWindow (USER32.@) - */ -HWND WINAPI GetProgmanWindow(void) -{ - return NtUserGetProgmanWindow(); -} - - -/*********************************************************************** - * SetTaskmanWindow (USER32.@) - * NOTES - * hwnd = MSTaskSwWClass - * |-> SysTabControl32 - */ -HWND WINAPI SetTaskmanWindow( HWND hwnd ) -{ - return NtUserSetTaskmanWindow( hwnd ); -} - -/*********************************************************************** - * GetTaskmanWindow (USER32.@) - */ -HWND WINAPI GetTaskmanWindow(void) -{ - return NtUserGetTaskmanWindow(); -} diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 34e3a620cc5..c5387cf9212 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -770,3 +770,87 @@ BOOL WINAPI GetPointerTouchInfoHistory( UINT32 id, UINT32 *count, POINTER_TOUCH_ SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); return FALSE; } + + +/******************************************************************* + * SetForegroundWindow (USER32.@) + */ +BOOL WINAPI SetForegroundWindow( HWND hwnd ) +{ + return NtUserSetForegroundWindow( hwnd ); +} + + +/******************************************************************* + * GetActiveWindow (USER32.@) + */ +HWND WINAPI GetActiveWindow(void) +{ + GUITHREADINFO info; + info.cbSize = sizeof(info); + return NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) ? info.hwndActive : 0; +} + + +/***************************************************************** + * GetFocus (USER32.@) + */ +HWND WINAPI GetFocus(void) +{ + GUITHREADINFO info; + info.cbSize = sizeof(info); + return NtUserGetGUIThreadInfo( GetCurrentThreadId(), &info ) ? info.hwndFocus : 0; +} + + +/******************************************************************* + * SetShellWindow (USER32.@) + */ +BOOL WINAPI SetShellWindow( HWND hwnd ) +{ + return NtUserSetShellWindowEx( hwnd, hwnd ); +} + + +/******************************************************************* + * GetShellWindow (USER32.@) + */ +HWND WINAPI GetShellWindow(void) +{ + return NtUserGetShellWindow(); +} + + +/*********************************************************************** + * SetProgmanWindow (USER32.@) + */ +HWND WINAPI SetProgmanWindow( HWND hwnd ) +{ + return NtUserSetProgmanWindow( hwnd ); +} + + +/*********************************************************************** + * GetProgmanWindow (USER32.@) + */ +HWND WINAPI GetProgmanWindow(void) +{ + return NtUserGetProgmanWindow(); +} + + +/*********************************************************************** + * SetTaskmanWindow (USER32.@) + */ +HWND WINAPI SetTaskmanWindow( HWND hwnd ) +{ + return NtUserSetTaskmanWindow( hwnd ); +} + +/*********************************************************************** + * GetTaskmanWindow (USER32.@) + */ +HWND WINAPI GetTaskmanWindow(void) +{ + return NtUserGetTaskmanWindow(); +}