Move calling of CBT hooks from WIN_CreateWindowEx() to the driver.
This commit is contained in:
parent
19d66cc1f6
commit
0f2f2b34fa
|
@ -12,6 +12,7 @@
|
||||||
#include "win.h"
|
#include "win.h"
|
||||||
#include "winpos.h"
|
#include "winpos.h"
|
||||||
#include "debugtools.h"
|
#include "debugtools.h"
|
||||||
|
#include "hook.h"
|
||||||
|
|
||||||
DEFAULT_DEBUG_CHANNEL(ttydrv);
|
DEFAULT_DEBUG_CHANNEL(ttydrv);
|
||||||
|
|
||||||
|
@ -28,6 +29,7 @@ DEFAULT_DEBUG_CHANNEL(ttydrv);
|
||||||
BOOL TTYDRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
|
BOOL TTYDRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
|
||||||
{
|
{
|
||||||
BOOL ret;
|
BOOL ret;
|
||||||
|
HWND hwndLinkAfter;
|
||||||
|
|
||||||
#ifdef WINE_CURSES
|
#ifdef WINE_CURSES
|
||||||
WND *wndPtr = WIN_FindWndPtr( hwnd );
|
WND *wndPtr = WIN_FindWndPtr( hwnd );
|
||||||
|
@ -60,6 +62,29 @@ BOOL TTYDRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
|
||||||
FIXME("(%x): stub\n", hwnd);
|
FIXME("(%x): stub\n", hwnd);
|
||||||
#endif /* defined(WINE_CURSES) */
|
#endif /* defined(WINE_CURSES) */
|
||||||
|
|
||||||
|
/* Call the WH_CBT hook */
|
||||||
|
|
||||||
|
hwndLinkAfter = ((cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD)
|
||||||
|
? HWND_BOTTOM : HWND_TOP;
|
||||||
|
|
||||||
|
if (HOOK_IsHooked( WH_CBT ))
|
||||||
|
{
|
||||||
|
CBT_CREATEWNDA cbtc;
|
||||||
|
LRESULT lret;
|
||||||
|
|
||||||
|
cbtc.lpcs = cs;
|
||||||
|
cbtc.hwndInsertAfter = hwndLinkAfter;
|
||||||
|
lret = (unicode) ? HOOK_CallHooksW(WH_CBT, HCBT_CREATEWND,
|
||||||
|
(WPARAM)hwnd, (LPARAM)&cbtc)
|
||||||
|
: HOOK_CallHooksA(WH_CBT, HCBT_CREATEWND,
|
||||||
|
(WPARAM)hwnd, (LPARAM)&cbtc);
|
||||||
|
if (lret)
|
||||||
|
{
|
||||||
|
TRACE("CBT-hook returned !0\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (unicode)
|
if (unicode)
|
||||||
{
|
{
|
||||||
ret = SendMessageW( hwnd, WM_NCCREATE, 0, (LPARAM)cs );
|
ret = SendMessageW( hwnd, WM_NCCREATE, 0, (LPARAM)cs );
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "winpos.h"
|
#include "winpos.h"
|
||||||
#include "dce.h"
|
#include "dce.h"
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
#include "hook.h"
|
||||||
|
|
||||||
DEFAULT_DEBUG_CHANNEL(x11drv);
|
DEFAULT_DEBUG_CHANNEL(x11drv);
|
||||||
|
|
||||||
|
@ -821,6 +822,7 @@ BOOL X11DRV_DestroyWindow( HWND hwnd )
|
||||||
*/
|
*/
|
||||||
BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
|
BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
|
||||||
{
|
{
|
||||||
|
HWND hwndLinkAfter;
|
||||||
Display *display = thread_display();
|
Display *display = thread_display();
|
||||||
WND *wndPtr;
|
WND *wndPtr;
|
||||||
struct x11drv_win_data *data;
|
struct x11drv_win_data *data;
|
||||||
|
@ -855,6 +857,31 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
|
||||||
SetPropA( hwnd, whole_window_atom, (HANDLE)data->whole_window );
|
SetPropA( hwnd, whole_window_atom, (HANDLE)data->whole_window );
|
||||||
SetPropA( hwnd, client_window_atom, (HANDLE)data->client_window );
|
SetPropA( hwnd, client_window_atom, (HANDLE)data->client_window );
|
||||||
|
|
||||||
|
/* Call the WH_CBT hook */
|
||||||
|
|
||||||
|
hwndLinkAfter = ((cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD)
|
||||||
|
? HWND_BOTTOM : HWND_TOP;
|
||||||
|
|
||||||
|
if (HOOK_IsHooked( WH_CBT ))
|
||||||
|
{
|
||||||
|
CBT_CREATEWNDA cbtc;
|
||||||
|
LRESULT lret;
|
||||||
|
|
||||||
|
cbtc.lpcs = cs;
|
||||||
|
cbtc.hwndInsertAfter = hwndLinkAfter;
|
||||||
|
lret = (unicode) ? HOOK_CallHooksW(WH_CBT, HCBT_CREATEWND,
|
||||||
|
(WPARAM)hwnd, (LPARAM)&cbtc)
|
||||||
|
: HOOK_CallHooksA(WH_CBT, HCBT_CREATEWND,
|
||||||
|
(WPARAM)hwnd, (LPARAM)&cbtc);
|
||||||
|
if (lret)
|
||||||
|
{
|
||||||
|
TRACE("CBT-hook returned !0\n");
|
||||||
|
goto failed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Send the WM_GETMINMAXINFO message and fix the size if needed */
|
/* Send the WM_GETMINMAXINFO message and fix the size if needed */
|
||||||
if ((cs->style & WS_THICKFRAME) || !(cs->style & (WS_POPUP | WS_CHILD)))
|
if ((cs->style & WS_THICKFRAME) || !(cs->style & (WS_POPUP | WS_CHILD)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -961,7 +961,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
|
||||||
INT sw = SW_SHOW;
|
INT sw = SW_SHOW;
|
||||||
struct tagCLASS *classPtr;
|
struct tagCLASS *classPtr;
|
||||||
WND *wndPtr;
|
WND *wndPtr;
|
||||||
HWND hwnd, hwndLinkAfter, parent, owner;
|
HWND hwnd, parent, owner;
|
||||||
INT wndExtra;
|
INT wndExtra;
|
||||||
DWORD clsStyle;
|
DWORD clsStyle;
|
||||||
WNDPROC winproc;
|
WNDPROC winproc;
|
||||||
|
@ -1067,32 +1067,6 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom,
|
||||||
|
|
||||||
if (wndExtra) memset( wndPtr->wExtra, 0, wndExtra);
|
if (wndExtra) memset( wndPtr->wExtra, 0, wndExtra);
|
||||||
|
|
||||||
/* Call the WH_CBT hook */
|
|
||||||
|
|
||||||
hwndLinkAfter = ((cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD)
|
|
||||||
? HWND_BOTTOM : HWND_TOP;
|
|
||||||
|
|
||||||
if (HOOK_IsHooked( WH_CBT ))
|
|
||||||
{
|
|
||||||
CBT_CREATEWNDA cbtc;
|
|
||||||
LRESULT ret;
|
|
||||||
|
|
||||||
cbtc.lpcs = cs;
|
|
||||||
cbtc.hwndInsertAfter = hwndLinkAfter;
|
|
||||||
ret = (type == WIN_PROC_32W) ? HOOK_CallHooksW(WH_CBT, HCBT_CREATEWND,
|
|
||||||
(WPARAM)hwnd, (LPARAM)&cbtc)
|
|
||||||
: HOOK_CallHooksA(WH_CBT, HCBT_CREATEWND,
|
|
||||||
(WPARAM)hwnd, (LPARAM)&cbtc);
|
|
||||||
if (ret)
|
|
||||||
{
|
|
||||||
TRACE("CBT-hook returned 0\n");
|
|
||||||
free_window_handle( hwnd );
|
|
||||||
CLASS_RemoveWindow( classPtr );
|
|
||||||
WIN_ReleaseWndPtr(wndPtr);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Correct the window style - stage 2 */
|
/* Correct the window style - stage 2 */
|
||||||
|
|
||||||
if (!(cs->style & WS_CHILD))
|
if (!(cs->style & WS_CHILD))
|
||||||
|
|
Loading…
Reference in New Issue