Made access to the wnd struct thread-safe.
This commit is contained in:
parent
2e1cafa288
commit
6b1b41cf85
|
@ -79,6 +79,7 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
|||
WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
RECT rect;
|
||||
LRESULT retvalue;
|
||||
POINT pt = { LOWORD(lParam), HIWORD(lParam) };
|
||||
WND *wndPtr = WIN_FindWndPtr(hWnd);
|
||||
BUTTONINFO *infoPtr = (BUTTONINFO *)wndPtr->wExtra;
|
||||
|
@ -87,6 +88,7 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
|||
switch (uMsg)
|
||||
{
|
||||
case WM_GETDLGCODE:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
switch(style)
|
||||
{
|
||||
case BS_PUSHBUTTON: return DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON;
|
||||
|
@ -109,12 +111,18 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
|||
checkBoxWidth = bmp.bmWidth / 4;
|
||||
checkBoxHeight = bmp.bmHeight / 3;
|
||||
}
|
||||
if (style < 0L || style >= MAX_BTN_TYPE) return -1; /* abort */
|
||||
if (style < 0L || style >= MAX_BTN_TYPE)
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return -1; /* abort */
|
||||
}
|
||||
infoPtr->state = BUTTON_UNCHECKED;
|
||||
infoPtr->hFont = 0;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return 0;
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return 1;
|
||||
|
||||
case WM_PAINT:
|
||||
|
@ -171,6 +179,7 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
|||
break;
|
||||
|
||||
case WM_NCHITTEST:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
if(style == BS_GROUPBOX) return HTTRANSPARENT;
|
||||
return DefWindowProcA( hWnd, uMsg, wParam, lParam );
|
||||
|
||||
|
@ -178,6 +187,7 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
|||
DEFWND_SetText( wndPtr, (LPCSTR)lParam );
|
||||
if( wndPtr->dwStyle & WS_VISIBLE )
|
||||
PAINT_BUTTON( wndPtr, style, ODA_DRAWENTIRE );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return 0;
|
||||
|
||||
case WM_SETFONT:
|
||||
|
@ -187,7 +197,9 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
|||
break;
|
||||
|
||||
case WM_GETFONT:
|
||||
return infoPtr->hFont;
|
||||
retvalue = infoPtr->hFont;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
|
||||
case WM_SETFOCUS:
|
||||
infoPtr->state |= BUTTON_HASFOCUS;
|
||||
|
@ -219,7 +231,9 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
|||
|
||||
case BM_GETCHECK16:
|
||||
case BM_GETCHECK:
|
||||
return infoPtr->state & 3;
|
||||
retvalue = infoPtr->state & 3;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
|
||||
case BM_SETCHECK16:
|
||||
case BM_SETCHECK:
|
||||
|
@ -242,7 +256,9 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
|||
|
||||
case BM_GETSTATE16:
|
||||
case BM_GETSTATE:
|
||||
return infoPtr->state;
|
||||
retvalue = infoPtr->state;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
|
||||
case BM_SETSTATE16:
|
||||
case BM_SETSTATE:
|
||||
|
@ -260,8 +276,10 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
|||
break;
|
||||
|
||||
default:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -522,11 +540,14 @@ static void BUTTON_CheckAutoRadioButton( WND *wndPtr )
|
|||
start = sibling = GetNextDlgGroupItem( parent, wndPtr->hwndSelf, TRUE );
|
||||
do
|
||||
{
|
||||
WND *tmpWnd;
|
||||
if (!sibling) break;
|
||||
tmpWnd = WIN_FindWndPtr(sibling);
|
||||
if ((wndPtr->hwndSelf != sibling) &&
|
||||
((WIN_FindWndPtr(sibling)->dwStyle & 0x0f) == BS_AUTORADIOBUTTON))
|
||||
((tmpWnd->dwStyle & 0x0f) == BS_AUTORADIOBUTTON))
|
||||
SendMessageA( sibling, BM_SETCHECK, BUTTON_UNCHECKED, 0 );
|
||||
sibling = GetNextDlgGroupItem( parent, sibling, FALSE );
|
||||
WIN_ReleaseWndPtr(tmpWnd);
|
||||
} while (sibling != start);
|
||||
}
|
||||
|
||||
|
|
248
controls/combo.c
248
controls/combo.c
|
@ -1286,6 +1286,7 @@ static void COMBO_MouseMove( LPHEADCOMBO lphc, WPARAM wParam, LPARAM lParam )
|
|||
LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
||||
WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
LRESULT retvalue;
|
||||
WND* pWnd = WIN_FindWndPtr(hwnd);
|
||||
|
||||
if( pWnd )
|
||||
|
@ -1302,58 +1303,59 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
|||
/* System messages */
|
||||
|
||||
case WM_NCCREATE:
|
||||
return COMBO_NCCreate(pWnd, lParam);
|
||||
|
||||
retvalue = COMBO_NCCreate(pWnd, lParam);
|
||||
goto END;
|
||||
case WM_NCDESTROY:
|
||||
COMBO_NCDestroy(lphc);
|
||||
break;
|
||||
|
||||
case WM_CREATE:
|
||||
return COMBO_Create(lphc, pWnd, lParam);
|
||||
retvalue = COMBO_Create(lphc, pWnd, lParam);
|
||||
goto END;
|
||||
|
||||
case WM_PAINT:
|
||||
/* wParam may contain a valid HDC! */
|
||||
return COMBO_Paint(lphc, wParam);
|
||||
|
||||
retvalue = COMBO_Paint(lphc, wParam);
|
||||
goto END;
|
||||
case WM_ERASEBKGND:
|
||||
return TRUE;
|
||||
|
||||
retvalue = TRUE;
|
||||
goto END;
|
||||
case WM_GETDLGCODE:
|
||||
return (LRESULT)(DLGC_WANTARROWS | DLGC_WANTCHARS);
|
||||
|
||||
retvalue = (LRESULT)(DLGC_WANTARROWS | DLGC_WANTCHARS);
|
||||
goto END;
|
||||
case WM_SIZE:
|
||||
if( lphc->hWndLBox &&
|
||||
!(lphc->wState & CBF_NORESIZE) ) COMBO_Size( lphc );
|
||||
return TRUE;
|
||||
|
||||
retvalue = TRUE;
|
||||
goto END;
|
||||
case WM_SETFONT:
|
||||
COMBO_Font( lphc, (HFONT16)wParam, (BOOL)lParam );
|
||||
return TRUE;
|
||||
|
||||
retvalue = TRUE;
|
||||
goto END;
|
||||
case WM_GETFONT:
|
||||
return (LRESULT)lphc->hFont;
|
||||
|
||||
retvalue = (LRESULT)lphc->hFont;
|
||||
goto END;
|
||||
case WM_SETFOCUS:
|
||||
if( lphc->wState & CBF_EDIT )
|
||||
SetFocus( lphc->hWndEdit );
|
||||
else
|
||||
COMBO_SetFocus( lphc );
|
||||
return TRUE;
|
||||
|
||||
retvalue = TRUE;
|
||||
goto END;
|
||||
case WM_KILLFOCUS:
|
||||
#define hwndFocus ((HWND16)wParam)
|
||||
if( !hwndFocus ||
|
||||
(hwndFocus != lphc->hWndEdit && hwndFocus != lphc->hWndLBox ))
|
||||
COMBO_KillFocus( lphc );
|
||||
#undef hwndFocus
|
||||
return TRUE;
|
||||
|
||||
retvalue = TRUE;
|
||||
goto END;
|
||||
case WM_COMMAND:
|
||||
return COMBO_Command( lphc, wParam, (HWND)lParam );
|
||||
|
||||
retvalue = COMBO_Command( lphc, wParam, (HWND)lParam );
|
||||
goto END;
|
||||
case WM_GETTEXT:
|
||||
return COMBO_GetText( lphc, (UINT)wParam, (LPSTR)lParam );
|
||||
|
||||
retvalue = COMBO_GetText( lphc, (UINT)wParam, (LPSTR)lParam );
|
||||
goto END;
|
||||
case WM_SETTEXT:
|
||||
case WM_GETTEXTLENGTH:
|
||||
case WM_CLEAR:
|
||||
|
@ -1361,21 +1363,24 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
|||
case WM_PASTE:
|
||||
case WM_COPY:
|
||||
if( lphc->wState & CBF_EDIT )
|
||||
return SendMessageA( lphc->hWndEdit, message, wParam, lParam );
|
||||
return CB_ERR;
|
||||
|
||||
{
|
||||
retvalue = SendMessageA( lphc->hWndEdit, message, wParam, lParam );
|
||||
goto END;
|
||||
}
|
||||
retvalue = CB_ERR;
|
||||
goto END;
|
||||
case WM_DRAWITEM:
|
||||
case WM_DELETEITEM:
|
||||
case WM_COMPAREITEM:
|
||||
case WM_MEASUREITEM:
|
||||
return COMBO_ItemOp( lphc, message, wParam, lParam );
|
||||
|
||||
retvalue = COMBO_ItemOp( lphc, message, wParam, lParam );
|
||||
goto END;
|
||||
case WM_ENABLE:
|
||||
if( lphc->wState & CBF_EDIT )
|
||||
EnableWindow( lphc->hWndEdit, (BOOL)wParam );
|
||||
EnableWindow( lphc->hWndLBox, (BOOL)wParam );
|
||||
return TRUE;
|
||||
|
||||
retvalue = TRUE;
|
||||
goto END;
|
||||
case WM_SETREDRAW:
|
||||
if( wParam )
|
||||
lphc->wState &= ~CBF_NOREDRAW;
|
||||
|
@ -1385,8 +1390,8 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
|||
if( lphc->wState & CBF_EDIT )
|
||||
SendMessageA( lphc->hWndEdit, message, wParam, lParam );
|
||||
SendMessageA( lphc->hWndLBox, message, wParam, lParam );
|
||||
return 0;
|
||||
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
case WM_SYSKEYDOWN:
|
||||
if( KEYDATA_ALT & HIWORD(lParam) )
|
||||
if( wParam == VK_UP || wParam == VK_DOWN )
|
||||
|
@ -1396,106 +1401,113 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
|||
case WM_CHAR:
|
||||
case WM_KEYDOWN:
|
||||
if( lphc->wState & CBF_EDIT )
|
||||
return SendMessageA( lphc->hWndEdit, message, wParam, lParam );
|
||||
retvalue = SendMessageA( lphc->hWndEdit, message, wParam, lParam );
|
||||
else
|
||||
return SendMessageA( lphc->hWndLBox, message, wParam, lParam );
|
||||
retvalue = SendMessageA( lphc->hWndLBox, message, wParam, lParam );
|
||||
|
||||
case WM_LBUTTONDOWN:
|
||||
if( !(lphc->wState & CBF_FOCUSED) ) SetFocus( lphc->self->hwndSelf );
|
||||
if( lphc->wState & CBF_FOCUSED ) COMBO_LButtonDown( lphc, lParam );
|
||||
return TRUE;
|
||||
|
||||
retvalue = TRUE;
|
||||
goto END;
|
||||
case WM_LBUTTONUP:
|
||||
COMBO_LButtonUp( lphc, lParam );
|
||||
return TRUE;
|
||||
|
||||
retvalue = TRUE;
|
||||
goto END;
|
||||
case WM_MOUSEMOVE:
|
||||
if( lphc->wState & CBF_CAPTURE )
|
||||
COMBO_MouseMove( lphc, wParam, lParam );
|
||||
return TRUE;
|
||||
|
||||
retvalue = TRUE;
|
||||
goto END;
|
||||
/* Combo messages */
|
||||
|
||||
case CB_ADDSTRING16:
|
||||
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||
case CB_ADDSTRING:
|
||||
return SendMessageA( lphc->hWndLBox, LB_ADDSTRING, 0, lParam);
|
||||
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_ADDSTRING, 0, lParam);
|
||||
goto END;
|
||||
case CB_INSERTSTRING16:
|
||||
wParam = (INT)(INT16)wParam;
|
||||
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||
case CB_INSERTSTRING:
|
||||
return SendMessageA( lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam);
|
||||
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam);
|
||||
goto END;
|
||||
case CB_DELETESTRING16:
|
||||
case CB_DELETESTRING:
|
||||
return SendMessageA( lphc->hWndLBox, LB_DELETESTRING, wParam, 0);
|
||||
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_DELETESTRING, wParam, 0);
|
||||
goto END;
|
||||
case CB_SELECTSTRING16:
|
||||
wParam = (INT)(INT16)wParam;
|
||||
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||
case CB_SELECTSTRING:
|
||||
return COMBO_SelectString( lphc, (INT)wParam, (LPSTR)lParam );
|
||||
|
||||
retvalue = COMBO_SelectString( lphc, (INT)wParam, (LPSTR)lParam );
|
||||
goto END;
|
||||
case CB_FINDSTRING16:
|
||||
wParam = (INT)(INT16)wParam;
|
||||
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||
case CB_FINDSTRING:
|
||||
return SendMessageA( lphc->hWndLBox, LB_FINDSTRING, wParam, lParam);
|
||||
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_FINDSTRING, wParam, lParam);
|
||||
goto END;
|
||||
case CB_FINDSTRINGEXACT16:
|
||||
wParam = (INT)(INT16)wParam;
|
||||
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||
case CB_FINDSTRINGEXACT:
|
||||
return SendMessageA( lphc->hWndLBox, LB_FINDSTRINGEXACT,
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_FINDSTRINGEXACT,
|
||||
wParam, lParam );
|
||||
goto END;
|
||||
case CB_SETITEMHEIGHT16:
|
||||
wParam = (INT)(INT16)wParam; /* signed integer */
|
||||
case CB_SETITEMHEIGHT:
|
||||
return COMBO_SetItemHeight( lphc, (INT)wParam, (INT)lParam);
|
||||
|
||||
retvalue = COMBO_SetItemHeight( lphc, (INT)wParam, (INT)lParam);
|
||||
goto END;
|
||||
case CB_GETITEMHEIGHT16:
|
||||
wParam = (INT)(INT16)wParam;
|
||||
case CB_GETITEMHEIGHT:
|
||||
if( (INT)wParam >= 0 ) /* listbox item */
|
||||
return SendMessageA( lphc->hWndLBox, LB_GETITEMHEIGHT, wParam, 0);
|
||||
return (lphc->RectEdit.bottom - lphc->RectEdit.top);
|
||||
|
||||
{
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETITEMHEIGHT, wParam, 0);
|
||||
goto END;
|
||||
}
|
||||
retvalue = (lphc->RectEdit.bottom - lphc->RectEdit.top);
|
||||
goto END;
|
||||
case CB_RESETCONTENT16:
|
||||
case CB_RESETCONTENT:
|
||||
SendMessageA( lphc->hWndLBox, LB_RESETCONTENT, 0, 0 );
|
||||
CBPaintText( lphc, 0 );
|
||||
return TRUE;
|
||||
|
||||
retvalue = TRUE;
|
||||
goto END;
|
||||
case CB_INITSTORAGE:
|
||||
return SendMessageA( lphc->hWndLBox, LB_INITSTORAGE, wParam, lParam);
|
||||
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_INITSTORAGE, wParam, lParam);
|
||||
goto END;
|
||||
case CB_GETHORIZONTALEXTENT:
|
||||
return SendMessageA( lphc->hWndLBox, LB_GETHORIZONTALEXTENT, 0, 0);
|
||||
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETHORIZONTALEXTENT, 0, 0);
|
||||
goto END;
|
||||
case CB_SETHORIZONTALEXTENT:
|
||||
return SendMessageA( lphc->hWndLBox, LB_SETHORIZONTALEXTENT, wParam, 0);
|
||||
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_SETHORIZONTALEXTENT, wParam, 0);
|
||||
goto END;
|
||||
case CB_GETTOPINDEX:
|
||||
return SendMessageA( lphc->hWndLBox, LB_GETTOPINDEX, 0, 0);
|
||||
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETTOPINDEX, 0, 0);
|
||||
goto END;
|
||||
case CB_GETLOCALE:
|
||||
return SendMessageA( lphc->hWndLBox, LB_GETLOCALE, 0, 0);
|
||||
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETLOCALE, 0, 0);
|
||||
goto END;
|
||||
case CB_SETLOCALE:
|
||||
return SendMessageA( lphc->hWndLBox, LB_SETLOCALE, wParam, 0);
|
||||
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_SETLOCALE, wParam, 0);
|
||||
goto END;
|
||||
case CB_GETDROPPEDWIDTH:
|
||||
if( lphc->droppedWidth )
|
||||
return lphc->droppedWidth;
|
||||
return lphc->RectCombo.right - lphc->RectCombo.left -
|
||||
{
|
||||
retvalue = lphc->droppedWidth;
|
||||
goto END;
|
||||
}
|
||||
retvalue = lphc->RectCombo.right - lphc->RectCombo.left -
|
||||
(lphc->wState & CBF_EDIT) ? CBitOffset : 0;
|
||||
|
||||
goto END;
|
||||
case CB_SETDROPPEDWIDTH:
|
||||
if( (CB_GETTYPE(lphc) != CBS_SIMPLE) &&
|
||||
(INT)wParam < 32768 ) lphc->droppedWidth = (INT)wParam;
|
||||
return CB_ERR;
|
||||
|
||||
retvalue = CB_ERR;
|
||||
goto END;
|
||||
case CB_GETDROPPEDCONTROLRECT16:
|
||||
lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||
if( lParam )
|
||||
|
@ -1504,22 +1516,23 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
|||
CBGetDroppedControlRect( lphc, &r );
|
||||
CONV_RECT32TO16( &r, (LPRECT16)lParam );
|
||||
}
|
||||
return CB_OKAY;
|
||||
|
||||
retvalue = CB_OKAY;
|
||||
goto END;
|
||||
case CB_GETDROPPEDCONTROLRECT:
|
||||
if( lParam ) CBGetDroppedControlRect(lphc, (LPRECT)lParam );
|
||||
return CB_OKAY;
|
||||
|
||||
retvalue = CB_OKAY;
|
||||
goto END;
|
||||
case CB_GETDROPPEDSTATE16:
|
||||
case CB_GETDROPPEDSTATE:
|
||||
return (lphc->wState & CBF_DROPPED) ? TRUE : FALSE;
|
||||
|
||||
retvalue = (lphc->wState & CBF_DROPPED) ? TRUE : FALSE;
|
||||
goto END;
|
||||
case CB_DIR16:
|
||||
lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||
/* fall through */
|
||||
case CB_DIR:
|
||||
return COMBO_Directory( lphc, (UINT)wParam,
|
||||
retvalue = COMBO_Directory( lphc, (UINT)wParam,
|
||||
(LPSTR)lParam, (message == CB_DIR));
|
||||
goto END;
|
||||
case CB_SHOWDROPDOWN16:
|
||||
case CB_SHOWDROPDOWN:
|
||||
if( CB_GETTYPE(lphc) != CBS_SIMPLE )
|
||||
|
@ -1533,16 +1546,16 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
|||
if( lphc->wState & CBF_DROPPED )
|
||||
CBRollUp( lphc, FALSE, TRUE );
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
retvalue = TRUE;
|
||||
goto END;
|
||||
case CB_GETCOUNT16:
|
||||
case CB_GETCOUNT:
|
||||
return SendMessageA( lphc->hWndLBox, LB_GETCOUNT, 0, 0);
|
||||
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETCOUNT, 0, 0);
|
||||
goto END;
|
||||
case CB_GETCURSEL16:
|
||||
case CB_GETCURSEL:
|
||||
return SendMessageA( lphc->hWndLBox, LB_GETCURSEL, 0, 0);
|
||||
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETCURSEL, 0, 0);
|
||||
goto END;
|
||||
case CB_SETCURSEL16:
|
||||
wParam = (INT)(INT16)wParam;
|
||||
case CB_SETCURSEL:
|
||||
|
@ -1554,29 +1567,29 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
|||
CBPaintText( lphc, 0 );
|
||||
lphc->wState &= ~CBF_SELCHANGE;
|
||||
}
|
||||
return lParam;
|
||||
|
||||
retvalue = lParam;
|
||||
goto END;
|
||||
case CB_GETLBTEXT16:
|
||||
wParam = (INT)(INT16)wParam;
|
||||
lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||
case CB_GETLBTEXT:
|
||||
return SendMessageA( lphc->hWndLBox, LB_GETTEXT, wParam, lParam);
|
||||
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETTEXT, wParam, lParam);
|
||||
goto END;
|
||||
case CB_GETLBTEXTLEN16:
|
||||
wParam = (INT)(INT16)wParam;
|
||||
case CB_GETLBTEXTLEN:
|
||||
return SendMessageA( lphc->hWndLBox, LB_GETTEXTLEN, wParam, 0);
|
||||
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETTEXTLEN, wParam, 0);
|
||||
goto END;
|
||||
case CB_GETITEMDATA16:
|
||||
wParam = (INT)(INT16)wParam;
|
||||
case CB_GETITEMDATA:
|
||||
return SendMessageA( lphc->hWndLBox, LB_GETITEMDATA, wParam, 0);
|
||||
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETITEMDATA, wParam, 0);
|
||||
goto END;
|
||||
case CB_SETITEMDATA16:
|
||||
wParam = (INT)(INT16)wParam;
|
||||
case CB_SETITEMDATA:
|
||||
return SendMessageA( lphc->hWndLBox, LB_SETITEMDATA, wParam, lParam);
|
||||
|
||||
retvalue = SendMessageA( lphc->hWndLBox, LB_SETITEMDATA, wParam, lParam);
|
||||
goto END;
|
||||
case CB_GETEDITSEL16:
|
||||
wParam = lParam = 0; /* just in case */
|
||||
case CB_GETEDITSEL:
|
||||
|
@ -1584,37 +1597,48 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
|||
{
|
||||
INT a, b;
|
||||
|
||||
return SendMessageA( lphc->hWndEdit, EM_GETSEL,
|
||||
retvalue = SendMessageA( lphc->hWndEdit, EM_GETSEL,
|
||||
(wParam) ? wParam : (WPARAM)&a,
|
||||
(lParam) ? lParam : (LPARAM)&b );
|
||||
goto END;
|
||||
}
|
||||
return CB_ERR;
|
||||
|
||||
retvalue = CB_ERR;
|
||||
goto END;
|
||||
case CB_SETEDITSEL16:
|
||||
case CB_SETEDITSEL:
|
||||
if( lphc->wState & CBF_EDIT )
|
||||
return SendMessageA( lphc->hWndEdit, EM_SETSEL,
|
||||
{
|
||||
retvalue = SendMessageA( lphc->hWndEdit, EM_SETSEL,
|
||||
(INT)(INT16)LOWORD(lParam), (INT)(INT16)HIWORD(lParam) );
|
||||
return CB_ERR;
|
||||
|
||||
goto END;
|
||||
}
|
||||
retvalue = CB_ERR;
|
||||
goto END;
|
||||
case CB_SETEXTENDEDUI16:
|
||||
case CB_SETEXTENDEDUI:
|
||||
if( CB_GETTYPE(lphc) == CBS_SIMPLE ) return CB_ERR;
|
||||
|
||||
if( CB_GETTYPE(lphc) == CBS_SIMPLE )
|
||||
{
|
||||
retvalue = CB_ERR;
|
||||
goto END;
|
||||
}
|
||||
if( wParam )
|
||||
lphc->wState |= CBF_EUI;
|
||||
else lphc->wState &= ~CBF_EUI;
|
||||
return CB_OKAY;
|
||||
|
||||
retvalue = CB_OKAY;
|
||||
goto END;
|
||||
case CB_GETEXTENDEDUI16:
|
||||
case CB_GETEXTENDEDUI:
|
||||
return (lphc->wState & CBF_EUI) ? TRUE : FALSE;
|
||||
|
||||
retvalue = (lphc->wState & CBF_EUI) ? TRUE : FALSE;
|
||||
goto END;
|
||||
case (WM_USER + 0x1B):
|
||||
WARN(combo, "[%04x]: undocumented msg!\n", hwnd );
|
||||
}
|
||||
return DefWindowProcA(hwnd, message, wParam, lParam);
|
||||
retvalue = DefWindowProcA(hwnd, message, wParam, lParam);
|
||||
goto END;
|
||||
}
|
||||
return CB_ERR;
|
||||
retvalue = CB_ERR;
|
||||
END:
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,8 +24,12 @@
|
|||
*/
|
||||
int DESKTOP_GetScreenWidth()
|
||||
{
|
||||
int retvalue;
|
||||
DESKTOP *pDesktop = (DESKTOP *) WIN_GetDesktop()->wExtra;
|
||||
return MONITOR_GetWidth(pDesktop->pPrimaryMonitor);
|
||||
retvalue = MONITOR_GetWidth(pDesktop->pPrimaryMonitor);
|
||||
WIN_ReleaseDesktop();
|
||||
return retvalue;
|
||||
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -35,8 +39,12 @@ int DESKTOP_GetScreenWidth()
|
|||
*/
|
||||
int DESKTOP_GetScreenHeight()
|
||||
{
|
||||
int retvalue;
|
||||
DESKTOP *pDesktop = (DESKTOP *) WIN_GetDesktop()->wExtra;
|
||||
return MONITOR_GetHeight(pDesktop->pPrimaryMonitor);
|
||||
retvalue = MONITOR_GetHeight(pDesktop->pPrimaryMonitor);
|
||||
WIN_ReleaseDesktop();
|
||||
return retvalue;
|
||||
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -46,8 +54,12 @@ int DESKTOP_GetScreenHeight()
|
|||
*/
|
||||
int DESKTOP_GetScreenDepth()
|
||||
{
|
||||
int retvalue;
|
||||
DESKTOP *pDesktop = (DESKTOP *) WIN_GetDesktop()->wExtra;
|
||||
return MONITOR_GetDepth(pDesktop->pPrimaryMonitor);
|
||||
retvalue = MONITOR_GetDepth(pDesktop->pPrimaryMonitor);
|
||||
WIN_ReleaseDesktop();
|
||||
return retvalue;
|
||||
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -119,6 +131,8 @@ static LRESULT DESKTOP_DoEraseBkgnd( HWND hwnd, HDC hdc,
|
|||
if (Wnd->hrgnUpdate > 1) DeleteObject( Wnd->hrgnUpdate );
|
||||
Wnd->hrgnUpdate = 0;
|
||||
|
||||
WIN_ReleaseWndPtr(Wnd);
|
||||
|
||||
GetClientRect( hwnd, &rect );
|
||||
|
||||
/* Paint desktop pattern (only if wall paper does not cover everything) */
|
||||
|
@ -173,6 +187,7 @@ static LRESULT DESKTOP_DoEraseBkgnd( HWND hwnd, HDC hdc,
|
|||
LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message,
|
||||
WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
LRESULT retvalue;
|
||||
WND *wndPtr = WIN_FindWndPtr( hwnd );
|
||||
DESKTOP *desktopPtr = (DESKTOP *)wndPtr->wExtra;
|
||||
|
||||
|
@ -187,23 +202,36 @@ LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message,
|
|||
desktopPtr->hbitmapWallPaper = 0;
|
||||
SetDeskPattern();
|
||||
SetDeskWallPaper( (LPSTR)-1 );
|
||||
return 1;
|
||||
retvalue = 1;
|
||||
goto END;
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
if (X11DRV_WND_GetXRootWindow(wndPtr) ==
|
||||
DefaultRootWindow(display))
|
||||
return 1;
|
||||
return DESKTOP_DoEraseBkgnd( hwnd, (HDC)wParam, desktopPtr );
|
||||
{
|
||||
retvalue = 1;
|
||||
goto END;
|
||||
}
|
||||
retvalue = DESKTOP_DoEraseBkgnd( hwnd, (HDC)wParam, desktopPtr );
|
||||
goto END;
|
||||
|
||||
case WM_SYSCOMMAND:
|
||||
if ((wParam & 0xfff0) != SC_CLOSE) return 0;
|
||||
if ((wParam & 0xfff0) != SC_CLOSE)
|
||||
{
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
}
|
||||
ExitWindows16( 0, 0 );
|
||||
|
||||
case WM_SETCURSOR:
|
||||
return (LRESULT)SetCursor16( LoadCursor16( 0, IDC_ARROW16 ) );
|
||||
retvalue = (LRESULT)SetCursor16( LoadCursor16( 0, IDC_ARROW16 ) );
|
||||
goto END;
|
||||
}
|
||||
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -212,11 +240,14 @@ LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message,
|
|||
*/
|
||||
BOOL WINAPI PaintDesktop(HDC hdc)
|
||||
{
|
||||
BOOL retvalue;
|
||||
HWND hwnd = GetDesktopWindow();
|
||||
WND *wndPtr = WIN_FindWndPtr( hwnd );
|
||||
DESKTOP *desktopPtr = (DESKTOP *)wndPtr->wExtra;
|
||||
retvalue = DESKTOP_DoEraseBkgnd( hwnd, hdc, desktopPtr );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
|
||||
return DESKTOP_DoEraseBkgnd( hwnd, hdc, desktopPtr );
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -270,6 +301,7 @@ BOOL WINAPI SetDeskWallPaper( LPCSTR filename )
|
|||
desktopPtr->bitmapSize.cx = (bmp.bmWidth != 0) ? bmp.bmWidth : 1;
|
||||
desktopPtr->bitmapSize.cy = (bmp.bmHeight != 0) ? bmp.bmHeight : 1;
|
||||
}
|
||||
WIN_ReleaseDesktop();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -301,6 +333,7 @@ BOOL DESKTOP_SetPattern( LPCSTR pattern )
|
|||
DeleteObject( hbitmap );
|
||||
}
|
||||
else desktopPtr->hbrushPattern = CreateSolidBrush( GetSysColor(COLOR_BACKGROUND) );
|
||||
WIN_ReleaseDesktop();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -310,15 +310,21 @@ LRESULT WINAPI EditWndProc( HWND hwnd, UINT msg,
|
|||
case WM_DESTROY:
|
||||
DPRINTF_EDIT_MSG32("WM_DESTROY");
|
||||
EDIT_WM_Destroy(wnd, es);
|
||||
return 0;
|
||||
result = 0;
|
||||
goto END;
|
||||
|
||||
case WM_NCCREATE:
|
||||
DPRINTF_EDIT_MSG32("WM_NCCREATE");
|
||||
return EDIT_WM_NCCreate(wnd, (LPCREATESTRUCTA)lParam);
|
||||
result = EDIT_WM_NCCreate(wnd, (LPCREATESTRUCTA)lParam);
|
||||
goto END;
|
||||
}
|
||||
|
||||
if (!es)
|
||||
return DefWindowProcA(hwnd, msg, wParam, lParam);
|
||||
{
|
||||
result = DefWindowProcA(hwnd, msg, wParam, lParam);
|
||||
goto END;
|
||||
}
|
||||
|
||||
|
||||
EDIT_LockBuffer(wnd, es);
|
||||
switch (msg) {
|
||||
|
@ -633,7 +639,7 @@ LRESULT WINAPI EditWndProc( HWND hwnd, UINT msg,
|
|||
wnd->dwStyle &= ~ES_READONLY;
|
||||
es->style &= ~ES_READONLY;
|
||||
}
|
||||
return 1;
|
||||
result = 1;
|
||||
break;
|
||||
|
||||
case EM_SETWORDBREAKPROC16:
|
||||
|
@ -856,7 +862,10 @@ LRESULT WINAPI EditWndProc( HWND hwnd, UINT msg,
|
|||
break;
|
||||
}
|
||||
EDIT_UnlockBuffer(wnd, es, FALSE);
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wnd);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ HWND ICONTITLE_Create( WND* wnd )
|
|||
wndPtr->owner = wnd; /* MDI depends on this */
|
||||
wndPtr->dwStyle &= ~(WS_CAPTION | WS_BORDER);
|
||||
if( wnd->dwStyle & WS_DISABLED ) wndPtr->dwStyle |= WS_DISABLED;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return hWnd;
|
||||
}
|
||||
return 0;
|
||||
|
@ -187,24 +188,25 @@ static BOOL ICONTITLE_Paint( WND* wnd, HDC hDC, BOOL bActive )
|
|||
LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg,
|
||||
WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
LRESULT retvalue;
|
||||
WND *wnd = WIN_FindWndPtr( hWnd );
|
||||
|
||||
switch( msg )
|
||||
{
|
||||
case WM_NCHITTEST:
|
||||
return HTCAPTION;
|
||||
|
||||
retvalue = HTCAPTION;
|
||||
goto END;
|
||||
case WM_NCMOUSEMOVE:
|
||||
case WM_NCLBUTTONDBLCLK:
|
||||
return SendMessageA( wnd->owner->hwndSelf, msg, wParam, lParam );
|
||||
|
||||
retvalue = SendMessageA( wnd->owner->hwndSelf, msg, wParam, lParam );
|
||||
goto END;
|
||||
case WM_ACTIVATE:
|
||||
if( wParam ) SetActiveWindow( wnd->owner->hwndSelf );
|
||||
/* fall through */
|
||||
|
||||
case WM_CLOSE:
|
||||
return 0;
|
||||
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
case WM_SHOWWINDOW:
|
||||
if( wnd && wParam )
|
||||
{
|
||||
|
@ -220,25 +222,30 @@ LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg,
|
|||
titleRect.right, titleRect.bottom,
|
||||
SWP_NOACTIVATE | SWP_NOZORDER );
|
||||
}
|
||||
return 0;
|
||||
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
case WM_ERASEBKGND:
|
||||
if( wnd )
|
||||
{
|
||||
WND* iconWnd = wnd->owner;
|
||||
WND* iconWnd = WIN_LockWndPtr(wnd->owner);
|
||||
|
||||
if( iconWnd->dwStyle & WS_CHILD )
|
||||
lParam = SendMessageA( iconWnd->hwndSelf, WM_ISACTIVEICON, 0, 0 );
|
||||
else
|
||||
lParam = (iconWnd->hwndSelf == GetActiveWindow16());
|
||||
|
||||
WIN_ReleaseWndPtr(iconWnd);
|
||||
if( ICONTITLE_Paint( wnd, (HDC)wParam, (BOOL)lParam ) )
|
||||
ValidateRect( hWnd, NULL );
|
||||
return 1;
|
||||
retvalue = 1;
|
||||
goto END;
|
||||
}
|
||||
}
|
||||
|
||||
return DefWindowProcA( hWnd, msg, wParam, lParam );
|
||||
retvalue = DefWindowProcA( hWnd, msg, wParam, lParam );
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wnd);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2120,19 +2120,26 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
|||
LRESULT ret;
|
||||
LB_DESCR *descr;
|
||||
WND *wnd = WIN_FindWndPtr( hwnd );
|
||||
LRESULT retvalue;
|
||||
|
||||
if (!wnd) return 0;
|
||||
if (!(descr = *(LB_DESCR **)wnd->wExtra))
|
||||
{
|
||||
if (msg == WM_CREATE)
|
||||
{
|
||||
if (!LISTBOX_Create( wnd, NULL )) return -1;
|
||||
if (!LISTBOX_Create( wnd, NULL ))
|
||||
{
|
||||
retvalue = -1;
|
||||
goto END;
|
||||
}
|
||||
TRACE(listbox, "creating wnd=%04x descr=%p\n",
|
||||
hwnd, *(LB_DESCR **)wnd->wExtra );
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
}
|
||||
/* Ignore all other messages before we get a WM_CREATE */
|
||||
return DefWindowProcA( hwnd, msg, wParam, lParam );
|
||||
retvalue = DefWindowProcA( hwnd, msg, wParam, lParam );
|
||||
goto END;
|
||||
}
|
||||
|
||||
TRACE(listbox, "[%04x]: msg %s wp %08x lp %08lx\n",
|
||||
|
@ -2142,104 +2149,133 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
|||
case LB_RESETCONTENT16:
|
||||
case LB_RESETCONTENT:
|
||||
LISTBOX_ResetContent( wnd, descr );
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case LB_ADDSTRING16:
|
||||
if (HAS_STRINGS(descr)) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||
/* fall through */
|
||||
case LB_ADDSTRING:
|
||||
wParam = LISTBOX_FindStringPos( wnd, descr, (LPCSTR)lParam, FALSE );
|
||||
return LISTBOX_InsertString( wnd, descr, wParam, (LPCSTR)lParam );
|
||||
retvalue = LISTBOX_InsertString( wnd, descr, wParam, (LPCSTR)lParam );
|
||||
goto END;
|
||||
|
||||
case LB_INSERTSTRING16:
|
||||
if (HAS_STRINGS(descr)) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||
wParam = (INT)(INT16)wParam;
|
||||
/* fall through */
|
||||
case LB_INSERTSTRING:
|
||||
return LISTBOX_InsertString( wnd, descr, wParam, (LPCSTR)lParam );
|
||||
retvalue = LISTBOX_InsertString( wnd, descr, wParam, (LPCSTR)lParam );
|
||||
goto END;
|
||||
|
||||
case LB_ADDFILE16:
|
||||
if (HAS_STRINGS(descr)) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||
/* fall through */
|
||||
case LB_ADDFILE:
|
||||
wParam = LISTBOX_FindFileStrPos( wnd, descr, (LPCSTR)lParam );
|
||||
return LISTBOX_InsertString( wnd, descr, wParam, (LPCSTR)lParam );
|
||||
retvalue = LISTBOX_InsertString( wnd, descr, wParam, (LPCSTR)lParam );
|
||||
goto END;
|
||||
|
||||
case LB_DELETESTRING16:
|
||||
case LB_DELETESTRING:
|
||||
return LISTBOX_RemoveItem( wnd, descr, wParam );
|
||||
retvalue = LISTBOX_RemoveItem( wnd, descr, wParam );
|
||||
goto END;
|
||||
|
||||
case LB_GETITEMDATA16:
|
||||
case LB_GETITEMDATA:
|
||||
if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
|
||||
return LB_ERR;
|
||||
return descr->items[wParam].data;
|
||||
{
|
||||
retvalue = LB_ERR;
|
||||
goto END;
|
||||
}
|
||||
retvalue = descr->items[wParam].data;
|
||||
goto END;
|
||||
|
||||
case LB_SETITEMDATA16:
|
||||
case LB_SETITEMDATA:
|
||||
if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
|
||||
return LB_ERR;
|
||||
{
|
||||
retvalue = LB_ERR;
|
||||
goto END;
|
||||
}
|
||||
descr->items[wParam].data = (DWORD)lParam;
|
||||
return LB_OKAY;
|
||||
retvalue = LB_OKAY;
|
||||
goto END;
|
||||
|
||||
case LB_GETCOUNT16:
|
||||
case LB_GETCOUNT:
|
||||
return descr->nb_items;
|
||||
retvalue = descr->nb_items;
|
||||
goto END;
|
||||
|
||||
case LB_GETTEXT16:
|
||||
lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||
/* fall through */
|
||||
case LB_GETTEXT:
|
||||
return LISTBOX_GetText( wnd, descr, wParam, (LPSTR)lParam );
|
||||
retvalue = LISTBOX_GetText( wnd, descr, wParam, (LPSTR)lParam );
|
||||
goto END;
|
||||
|
||||
case LB_GETTEXTLEN16:
|
||||
/* fall through */
|
||||
case LB_GETTEXTLEN:
|
||||
if (wParam >= descr->nb_items) return LB_ERR;
|
||||
return (HAS_STRINGS(descr) ? strlen(descr->items[wParam].str)
|
||||
if (wParam >= descr->nb_items)
|
||||
{
|
||||
retvalue = LB_ERR;
|
||||
goto END;
|
||||
}
|
||||
retvalue = (HAS_STRINGS(descr) ? strlen(descr->items[wParam].str)
|
||||
: sizeof(DWORD));
|
||||
goto END;
|
||||
|
||||
case LB_GETCURSEL16:
|
||||
case LB_GETCURSEL:
|
||||
return descr->selected_item;
|
||||
retvalue = descr->selected_item;
|
||||
goto END;
|
||||
|
||||
case LB_GETTOPINDEX16:
|
||||
case LB_GETTOPINDEX:
|
||||
return descr->top_item;
|
||||
retvalue = descr->top_item;
|
||||
goto END;
|
||||
|
||||
case LB_GETITEMHEIGHT16:
|
||||
case LB_GETITEMHEIGHT:
|
||||
return LISTBOX_GetItemHeight( wnd, descr, wParam );
|
||||
retvalue = LISTBOX_GetItemHeight( wnd, descr, wParam );
|
||||
goto END;
|
||||
|
||||
case LB_SETITEMHEIGHT16:
|
||||
lParam = LOWORD(lParam);
|
||||
/* fall through */
|
||||
case LB_SETITEMHEIGHT:
|
||||
return LISTBOX_SetItemHeight( wnd, descr, wParam, lParam );
|
||||
retvalue = LISTBOX_SetItemHeight( wnd, descr, wParam, lParam );
|
||||
goto END;
|
||||
|
||||
case LB_ITEMFROMPOINT:
|
||||
{
|
||||
POINT pt = { LOWORD(lParam), HIWORD(lParam) };
|
||||
RECT rect = { 0, 0, descr->width, descr->height };
|
||||
return MAKELONG( LISTBOX_GetItemFromPoint(wnd, descr, pt.x, pt.y),
|
||||
retvalue = MAKELONG( LISTBOX_GetItemFromPoint(wnd, descr, pt.x, pt.y),
|
||||
PtInRect( &rect, pt ) );
|
||||
goto END;
|
||||
}
|
||||
|
||||
case LB_SETCARETINDEX16:
|
||||
case LB_SETCARETINDEX:
|
||||
return LISTBOX_SetCaretIndex( wnd, descr, wParam, !lParam );
|
||||
retvalue = LISTBOX_SetCaretIndex( wnd, descr, wParam, !lParam );
|
||||
goto END;
|
||||
|
||||
case LB_GETCARETINDEX16:
|
||||
case LB_GETCARETINDEX:
|
||||
return descr->focus_item;
|
||||
retvalue = descr->focus_item;
|
||||
goto END;
|
||||
|
||||
case LB_SETTOPINDEX16:
|
||||
case LB_SETTOPINDEX:
|
||||
return LISTBOX_SetTopItem( wnd, descr, wParam, TRUE );
|
||||
retvalue = LISTBOX_SetTopItem( wnd, descr, wParam, TRUE );
|
||||
goto END;
|
||||
|
||||
case LB_SETCOLUMNWIDTH16:
|
||||
case LB_SETCOLUMNWIDTH:
|
||||
return LISTBOX_SetColumnWidth( wnd, descr, wParam );
|
||||
retvalue = LISTBOX_SetColumnWidth( wnd, descr, wParam );
|
||||
goto END;
|
||||
|
||||
case LB_GETITEMRECT16:
|
||||
{
|
||||
|
@ -2247,24 +2283,28 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
|||
ret = LISTBOX_GetItemRect( wnd, descr, (INT16)wParam, &rect );
|
||||
CONV_RECT32TO16( &rect, (RECT16 *)PTR_SEG_TO_LIN(lParam) );
|
||||
}
|
||||
return ret;
|
||||
retvalue = ret;
|
||||
goto END;
|
||||
|
||||
case LB_GETITEMRECT:
|
||||
return LISTBOX_GetItemRect( wnd, descr, wParam, (RECT *)lParam );
|
||||
retvalue = LISTBOX_GetItemRect( wnd, descr, wParam, (RECT *)lParam );
|
||||
goto END;
|
||||
|
||||
case LB_FINDSTRING16:
|
||||
wParam = (INT)(INT16)wParam;
|
||||
if (HAS_STRINGS(descr)) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||
/* fall through */
|
||||
case LB_FINDSTRING:
|
||||
return LISTBOX_FindString( wnd, descr, wParam, (LPCSTR)lParam, FALSE );
|
||||
retvalue = LISTBOX_FindString( wnd, descr, wParam, (LPCSTR)lParam, FALSE );
|
||||
goto END;
|
||||
|
||||
case LB_FINDSTRINGEXACT16:
|
||||
wParam = (INT)(INT16)wParam;
|
||||
if (HAS_STRINGS(descr)) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||
/* fall through */
|
||||
case LB_FINDSTRINGEXACT:
|
||||
return LISTBOX_FindString( wnd, descr, wParam, (LPCSTR)lParam, TRUE );
|
||||
retvalue = LISTBOX_FindString( wnd, descr, wParam, (LPCSTR)lParam, TRUE );
|
||||
goto END;
|
||||
|
||||
case LB_SELECTSTRING16:
|
||||
wParam = (INT)(INT16)wParam;
|
||||
|
@ -2274,9 +2314,14 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
|||
{
|
||||
INT index = LISTBOX_FindString( wnd, descr, wParam,
|
||||
(LPCSTR)lParam, FALSE );
|
||||
if (index == LB_ERR) return LB_ERR;
|
||||
if (index == LB_ERR)
|
||||
{
|
||||
retvalue = LB_ERR;
|
||||
goto END;
|
||||
}
|
||||
LISTBOX_SetSelection( wnd, descr, index, TRUE, FALSE );
|
||||
return index;
|
||||
retvalue = index;
|
||||
goto END;
|
||||
}
|
||||
|
||||
case LB_GETSEL16:
|
||||
|
@ -2284,128 +2329,171 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
|||
/* fall through */
|
||||
case LB_GETSEL:
|
||||
if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
|
||||
return LB_ERR;
|
||||
return descr->items[wParam].selected;
|
||||
{
|
||||
retvalue = LB_ERR;
|
||||
goto END;
|
||||
}
|
||||
retvalue = descr->items[wParam].selected;
|
||||
goto END;
|
||||
|
||||
case LB_SETSEL16:
|
||||
lParam = (INT)(INT16)lParam;
|
||||
/* fall through */
|
||||
case LB_SETSEL:
|
||||
return LISTBOX_SetSelection( wnd, descr, lParam, wParam, FALSE );
|
||||
retvalue = LISTBOX_SetSelection( wnd, descr, lParam, wParam, FALSE );
|
||||
goto END;
|
||||
|
||||
case LB_SETCURSEL16:
|
||||
wParam = (INT)(INT16)wParam;
|
||||
/* fall through */
|
||||
case LB_SETCURSEL:
|
||||
LISTBOX_SetCaretIndex( wnd, descr, wParam, TRUE );
|
||||
return LISTBOX_SetSelection( wnd, descr, wParam, TRUE, FALSE );
|
||||
retvalue = LISTBOX_SetSelection( wnd, descr, wParam, TRUE, FALSE );
|
||||
goto END;
|
||||
|
||||
case LB_GETSELCOUNT16:
|
||||
case LB_GETSELCOUNT:
|
||||
return LISTBOX_GetSelCount( wnd, descr );
|
||||
retvalue = LISTBOX_GetSelCount( wnd, descr );
|
||||
goto END;
|
||||
|
||||
case LB_GETSELITEMS16:
|
||||
return LISTBOX_GetSelItems16( wnd, descr, wParam,
|
||||
retvalue = LISTBOX_GetSelItems16( wnd, descr, wParam,
|
||||
(LPINT16)PTR_SEG_TO_LIN(lParam) );
|
||||
goto END;
|
||||
|
||||
case LB_GETSELITEMS:
|
||||
return LISTBOX_GetSelItems( wnd, descr, wParam, (LPINT)lParam );
|
||||
retvalue = LISTBOX_GetSelItems( wnd, descr, wParam, (LPINT)lParam );
|
||||
goto END;
|
||||
|
||||
case LB_SELITEMRANGE16:
|
||||
case LB_SELITEMRANGE:
|
||||
if (LOWORD(lParam) <= HIWORD(lParam))
|
||||
return LISTBOX_SelectItemRange( wnd, descr, LOWORD(lParam),
|
||||
{
|
||||
retvalue = LISTBOX_SelectItemRange( wnd, descr, LOWORD(lParam),
|
||||
HIWORD(lParam), wParam );
|
||||
}
|
||||
else
|
||||
return LISTBOX_SelectItemRange( wnd, descr, HIWORD(lParam),
|
||||
{
|
||||
retvalue = LISTBOX_SelectItemRange( wnd, descr, HIWORD(lParam),
|
||||
LOWORD(lParam), wParam );
|
||||
}
|
||||
goto END;
|
||||
|
||||
case LB_SELITEMRANGEEX16:
|
||||
case LB_SELITEMRANGEEX:
|
||||
if ((INT)lParam >= (INT)wParam)
|
||||
return LISTBOX_SelectItemRange( wnd, descr, wParam, lParam, TRUE );
|
||||
retvalue = LISTBOX_SelectItemRange( wnd, descr, wParam, lParam, TRUE );
|
||||
else
|
||||
return LISTBOX_SelectItemRange( wnd, descr, lParam, wParam, FALSE);
|
||||
retvalue = LISTBOX_SelectItemRange( wnd, descr, lParam, wParam, FALSE);
|
||||
goto END;
|
||||
|
||||
case LB_GETHORIZONTALEXTENT16:
|
||||
case LB_GETHORIZONTALEXTENT:
|
||||
return descr->horz_extent;
|
||||
retvalue = descr->horz_extent;
|
||||
goto END;
|
||||
|
||||
case LB_SETHORIZONTALEXTENT16:
|
||||
case LB_SETHORIZONTALEXTENT:
|
||||
return LISTBOX_SetHorizontalExtent( wnd, descr, wParam );
|
||||
retvalue = LISTBOX_SetHorizontalExtent( wnd, descr, wParam );
|
||||
goto END;
|
||||
|
||||
case LB_GETANCHORINDEX16:
|
||||
case LB_GETANCHORINDEX:
|
||||
return descr->anchor_item;
|
||||
retvalue = descr->anchor_item;
|
||||
goto END;
|
||||
|
||||
case LB_SETANCHORINDEX16:
|
||||
wParam = (INT)(INT16)wParam;
|
||||
/* fall through */
|
||||
case LB_SETANCHORINDEX:
|
||||
if (((INT)wParam < -1) || ((INT)wParam >= descr->nb_items))
|
||||
return LB_ERR;
|
||||
{
|
||||
retvalue = LB_ERR;
|
||||
goto END;
|
||||
}
|
||||
descr->anchor_item = (INT)wParam;
|
||||
return LB_OKAY;
|
||||
retvalue = LB_OKAY;
|
||||
goto END;
|
||||
|
||||
case LB_DIR16:
|
||||
return LISTBOX_Directory( wnd, descr, wParam,
|
||||
retvalue = LISTBOX_Directory( wnd, descr, wParam,
|
||||
(LPCSTR)PTR_SEG_TO_LIN(lParam), FALSE );
|
||||
goto END;
|
||||
|
||||
case LB_DIR:
|
||||
return LISTBOX_Directory( wnd, descr, wParam, (LPCSTR)lParam, TRUE );
|
||||
retvalue = LISTBOX_Directory( wnd, descr, wParam, (LPCSTR)lParam, TRUE );
|
||||
goto END;
|
||||
|
||||
case LB_GETLOCALE:
|
||||
return descr->locale;
|
||||
retvalue = descr->locale;
|
||||
goto END;
|
||||
|
||||
case LB_SETLOCALE:
|
||||
descr->locale = (LCID)wParam; /* FIXME: should check for valid lcid */
|
||||
return LB_OKAY;
|
||||
retvalue = LB_OKAY;
|
||||
goto END;
|
||||
|
||||
case LB_INITSTORAGE:
|
||||
return LISTBOX_InitStorage( wnd, descr, wParam, (DWORD)lParam );
|
||||
retvalue = LISTBOX_InitStorage( wnd, descr, wParam, (DWORD)lParam );
|
||||
goto END;
|
||||
|
||||
case LB_SETCOUNT:
|
||||
return LISTBOX_SetCount( wnd, descr, (INT)wParam );
|
||||
retvalue = LISTBOX_SetCount( wnd, descr, (INT)wParam );
|
||||
goto END;
|
||||
|
||||
case LB_SETTABSTOPS16:
|
||||
return LISTBOX_SetTabStops( wnd, descr, (INT)(INT16)wParam,
|
||||
retvalue = LISTBOX_SetTabStops( wnd, descr, (INT)(INT16)wParam,
|
||||
(LPINT)PTR_SEG_TO_LIN(lParam), TRUE );
|
||||
goto END;
|
||||
|
||||
case LB_SETTABSTOPS:
|
||||
return LISTBOX_SetTabStops( wnd, descr, wParam,
|
||||
retvalue = LISTBOX_SetTabStops( wnd, descr, wParam,
|
||||
(LPINT)lParam, FALSE );
|
||||
goto END;
|
||||
|
||||
case LB_CARETON16:
|
||||
case LB_CARETON:
|
||||
if (descr->caret_on) return LB_OKAY;
|
||||
if (descr->caret_on)
|
||||
{
|
||||
retvalue = LB_OKAY;
|
||||
goto END;
|
||||
}
|
||||
descr->caret_on = TRUE;
|
||||
if ((descr->focus_item != -1) && (GetFocus() == wnd->hwndSelf))
|
||||
LISTBOX_RepaintItem( wnd, descr, descr->focus_item, ODA_FOCUS );
|
||||
return LB_OKAY;
|
||||
retvalue = LB_OKAY;
|
||||
goto END;
|
||||
|
||||
case LB_CARETOFF16:
|
||||
case LB_CARETOFF:
|
||||
if (!descr->caret_on) return LB_OKAY;
|
||||
if (!descr->caret_on)
|
||||
{
|
||||
retvalue = LB_OKAY;
|
||||
goto END;
|
||||
}
|
||||
descr->caret_on = FALSE;
|
||||
if ((descr->focus_item != -1) && (GetFocus() == wnd->hwndSelf))
|
||||
LISTBOX_RepaintItem( wnd, descr, descr->focus_item, ODA_FOCUS );
|
||||
return LB_OKAY;
|
||||
retvalue = LB_OKAY;
|
||||
goto END;
|
||||
|
||||
case WM_DESTROY:
|
||||
return LISTBOX_Destroy( wnd, descr );
|
||||
retvalue = LISTBOX_Destroy( wnd, descr );
|
||||
goto END;
|
||||
|
||||
case WM_ENABLE:
|
||||
InvalidateRect( hwnd, NULL, TRUE );
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_SETREDRAW:
|
||||
LISTBOX_SetRedraw( wnd, descr, wParam != 0 );
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_GETDLGCODE:
|
||||
return DLGC_WANTARROWS | DLGC_WANTCHARS;
|
||||
|
||||
retvalue =DLGC_WANTARROWS | DLGC_WANTCHARS;
|
||||
goto END;
|
||||
case WM_PAINT:
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
|
@ -2414,67 +2502,67 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
|||
ret = LISTBOX_Paint( wnd, descr, hdc );
|
||||
if( !wParam ) EndPaint( hwnd, &ps );
|
||||
}
|
||||
return ret;
|
||||
|
||||
retvalue =ret;
|
||||
goto END;
|
||||
case WM_SIZE:
|
||||
LISTBOX_UpdateSize( wnd, descr );
|
||||
return 0;
|
||||
|
||||
retvalue =0;
|
||||
goto END;
|
||||
case WM_GETFONT:
|
||||
return descr->font;
|
||||
|
||||
retvalue =descr->font;
|
||||
goto END;
|
||||
case WM_SETFONT:
|
||||
LISTBOX_SetFont( wnd, descr, (HFONT)wParam );
|
||||
if (lParam) InvalidateRect( wnd->hwndSelf, 0, TRUE );
|
||||
return 0;
|
||||
|
||||
retvalue =0;
|
||||
goto END;
|
||||
case WM_SETFOCUS:
|
||||
descr->caret_on = TRUE;
|
||||
if (descr->focus_item != -1)
|
||||
LISTBOX_RepaintItem( wnd, descr, descr->focus_item, ODA_FOCUS );
|
||||
SEND_NOTIFICATION( wnd, descr, LBN_SETFOCUS );
|
||||
return 0;
|
||||
|
||||
retvalue =0;
|
||||
goto END;
|
||||
case WM_KILLFOCUS:
|
||||
if ((descr->focus_item != -1) && descr->caret_on)
|
||||
LISTBOX_RepaintItem( wnd, descr, descr->focus_item, ODA_FOCUS );
|
||||
SEND_NOTIFICATION( wnd, descr, LBN_KILLFOCUS );
|
||||
return 0;
|
||||
|
||||
retvalue =0;
|
||||
goto END;
|
||||
case WM_HSCROLL:
|
||||
return LISTBOX_HandleHScroll( wnd, descr, wParam, lParam );
|
||||
|
||||
retvalue =LISTBOX_HandleHScroll( wnd, descr, wParam, lParam );
|
||||
goto END;
|
||||
case WM_VSCROLL:
|
||||
return LISTBOX_HandleVScroll( wnd, descr, wParam, lParam );
|
||||
|
||||
retvalue =LISTBOX_HandleVScroll( wnd, descr, wParam, lParam );
|
||||
goto END;
|
||||
case WM_LBUTTONDOWN:
|
||||
return LISTBOX_HandleLButtonDown( wnd, descr, wParam,
|
||||
retvalue =LISTBOX_HandleLButtonDown( wnd, descr, wParam,
|
||||
(INT16)LOWORD(lParam),
|
||||
(INT16)HIWORD(lParam) );
|
||||
|
||||
goto END;
|
||||
case WM_LBUTTONDBLCLK:
|
||||
if (descr->style & LBS_NOTIFY)
|
||||
SEND_NOTIFICATION( wnd, descr, LBN_DBLCLK );
|
||||
return 0;
|
||||
|
||||
retvalue =0;
|
||||
goto END;
|
||||
case WM_MOUSEMOVE:
|
||||
if (GetCapture() == hwnd)
|
||||
LISTBOX_HandleMouseMove( wnd, descr, (INT16)LOWORD(lParam),
|
||||
(INT16)HIWORD(lParam) );
|
||||
return 0;
|
||||
|
||||
retvalue =0;
|
||||
goto END;
|
||||
case WM_LBUTTONUP:
|
||||
return LISTBOX_HandleLButtonUp( wnd, descr );
|
||||
|
||||
retvalue =LISTBOX_HandleLButtonUp( wnd, descr );
|
||||
goto END;
|
||||
case WM_KEYDOWN:
|
||||
return LISTBOX_HandleKeyDown( wnd, descr, wParam );
|
||||
|
||||
retvalue =LISTBOX_HandleKeyDown( wnd, descr, wParam );
|
||||
goto END;
|
||||
case WM_CHAR:
|
||||
return LISTBOX_HandleChar( wnd, descr, wParam );
|
||||
|
||||
retvalue =LISTBOX_HandleChar( wnd, descr, wParam );
|
||||
goto END;
|
||||
case WM_SYSTIMER:
|
||||
return LISTBOX_HandleSystemTimer( wnd, descr );
|
||||
|
||||
retvalue =LISTBOX_HandleSystemTimer( wnd, descr );
|
||||
goto END;
|
||||
case WM_ERASEBKGND:
|
||||
if (IS_OWNERDRAW(descr))
|
||||
{
|
||||
|
@ -2483,11 +2571,14 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
|||
wParam, (LPARAM)wnd->hwndSelf );
|
||||
if (hbrush) FillRect( (HDC)wParam, &rect, hbrush );
|
||||
}
|
||||
return 1;
|
||||
|
||||
retvalue =1;
|
||||
goto END;
|
||||
case WM_DROPFILES:
|
||||
if( !descr->lphc )
|
||||
return SendMessageA( descr->owner, msg, wParam, lParam );
|
||||
{
|
||||
retvalue =SendMessageA( descr->owner, msg, wParam, lParam );
|
||||
goto END;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DROPOBJECT:
|
||||
|
@ -2499,22 +2590,27 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
|||
LPDRAGINFO dragInfo = (LPDRAGINFO)PTR_SEG_TO_LIN( (SEGPTR)lParam );
|
||||
dragInfo->l = LISTBOX_GetItemFromPoint( wnd, descr, dragInfo->pt.x,
|
||||
dragInfo->pt.y );
|
||||
return SendMessageA( descr->owner, msg, wParam, lParam );
|
||||
retvalue =SendMessageA( descr->owner, msg, wParam, lParam );
|
||||
goto END;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_NCCREATE:
|
||||
if (TWEAK_WineLook > WIN31_LOOK)
|
||||
wnd->dwExStyle |= WS_EX_CLIENTEDGE;
|
||||
return DefWindowProcA( hwnd, msg, wParam, lParam );
|
||||
|
||||
retvalue =DefWindowProcA( hwnd, msg, wParam, lParam );
|
||||
goto END;
|
||||
default:
|
||||
if ((msg >= WM_USER) && (msg < 0xc000))
|
||||
WARN(listbox, "[%04x]: unknown msg %04x wp %08x lp %08lx\n",
|
||||
hwnd, msg, wParam, lParam );
|
||||
return DefWindowProcA( hwnd, msg, wParam, lParam );
|
||||
retvalue =DefWindowProcA( hwnd, msg, wParam, lParam );
|
||||
goto END;
|
||||
}
|
||||
return 0;
|
||||
retvalue =0;
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wnd);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -2533,8 +2629,10 @@ LRESULT COMBO_Directory( LPHEADCOMBO lphc, UINT attrib, LPSTR dir, BOOL bLong)
|
|||
|
||||
RedrawWindow( lphc->self->hwndSelf, NULL, 0,
|
||||
RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW );
|
||||
WIN_ReleaseWndPtr(wnd);
|
||||
return lRet;
|
||||
}
|
||||
WIN_ReleaseWndPtr(wnd);
|
||||
}
|
||||
return CB_ERR;
|
||||
}
|
||||
|
@ -2571,20 +2669,20 @@ LRESULT WINAPI ComboLBWndProc( HWND hwnd, UINT msg,
|
|||
|
||||
lphc = (LPHEADCOMBO)(lpcs->lpCreateParams);
|
||||
#undef lpcs
|
||||
return LISTBOX_Create( wnd, lphc );
|
||||
|
||||
lRet =LISTBOX_Create( wnd, lphc );
|
||||
goto END;
|
||||
case WM_LBUTTONDOWN:
|
||||
return LISTBOX_HandleLButtonDown( wnd, descr, wParam,
|
||||
lRet =LISTBOX_HandleLButtonDown( wnd, descr, wParam,
|
||||
(INT16)LOWORD(lParam), (INT16)HIWORD(lParam));
|
||||
|
||||
goto END;
|
||||
/* avoid activation at all costs */
|
||||
|
||||
case WM_MOUSEACTIVATE:
|
||||
return MA_NOACTIVATE;
|
||||
|
||||
lRet =MA_NOACTIVATE;
|
||||
goto END;
|
||||
case WM_NCACTIVATE:
|
||||
return FALSE;
|
||||
|
||||
lRet =FALSE;
|
||||
goto END;
|
||||
case WM_KEYDOWN:
|
||||
if( CB_GETTYPE(lphc) != CBS_SIMPLE )
|
||||
{
|
||||
|
@ -2596,30 +2694,34 @@ LRESULT WINAPI ComboLBWndProc( HWND hwnd, UINT msg,
|
|||
&& (wParam == VK_DOWN || wParam == VK_UP)) )
|
||||
{
|
||||
COMBO_FlipListbox( lphc, FALSE );
|
||||
return 0;
|
||||
lRet =0;
|
||||
goto END;
|
||||
}
|
||||
}
|
||||
return LISTBOX_HandleKeyDown( wnd, descr, wParam );
|
||||
lRet =LISTBOX_HandleKeyDown( wnd, descr, wParam );
|
||||
goto END;
|
||||
|
||||
case LB_SETCURSEL16:
|
||||
case LB_SETCURSEL:
|
||||
lRet = ListBoxWndProc( hwnd, msg, wParam, lParam );
|
||||
return (lRet == LB_ERR) ? lRet : descr->selected_item;
|
||||
|
||||
lRet =(lRet == LB_ERR) ? lRet : descr->selected_item;
|
||||
goto END;
|
||||
case WM_NCDESTROY:
|
||||
if( CB_GETTYPE(lphc) != CBS_SIMPLE )
|
||||
lphc->hWndLBox = 0;
|
||||
/* fall through */
|
||||
|
||||
default:
|
||||
return ListBoxWndProc( hwnd, msg, wParam, lParam );
|
||||
lRet =ListBoxWndProc( hwnd, msg, wParam, lParam );
|
||||
goto END;
|
||||
}
|
||||
}
|
||||
lRet = DefWindowProcA( hwnd, msg, wParam, lParam );
|
||||
|
||||
TRACE(combo,"\t default on msg [%04x]\n", (UINT16)msg );
|
||||
}
|
||||
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wnd);
|
||||
return lRet;
|
||||
}
|
||||
|
||||
|
|
226
controls/menu.c
226
controls/menu.c
|
@ -272,6 +272,37 @@ static HMENU MENU_CopySysPopup(void)
|
|||
return hMenu;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* MENU_GetTopPopupWnd()
|
||||
*
|
||||
* Return the locked pointer pTopPopupWnd.
|
||||
*/
|
||||
WND *MENU_GetTopPopupWnd()
|
||||
{
|
||||
return WIN_LockWndPtr(pTopPopupWnd);
|
||||
}
|
||||
/***********************************************************************
|
||||
* MENU_ReleaseTopPopupWnd()
|
||||
*
|
||||
* Realease the locked pointer pTopPopupWnd.
|
||||
*/
|
||||
void MENU_ReleaseTopPopupWnd()
|
||||
{
|
||||
WIN_ReleaseWndPtr(pTopPopupWnd);
|
||||
}
|
||||
/***********************************************************************
|
||||
* MENU_DestroyTopPopupWnd()
|
||||
*
|
||||
* Destroy the locked pointer pTopPopupWnd.
|
||||
*/
|
||||
void MENU_DestroyTopPopupWnd()
|
||||
{
|
||||
WND *tmpWnd = pTopPopupWnd;
|
||||
pTopPopupWnd = NULL;
|
||||
WIN_ReleaseWndPtr(tmpWnd);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* MENU_GetSysMenu
|
||||
|
@ -536,6 +567,7 @@ static MENUITEM *MENU_FindItemByCoords( POPUPMENU *menu,
|
|||
if (!(wndPtr = WIN_FindWndPtr( menu->hWnd ))) return NULL;
|
||||
pt.x -= wndPtr->rectWindow.left;
|
||||
pt.y -= wndPtr->rectWindow.top;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
item = menu->items;
|
||||
for (i = 0; i < menu->nItems; i++, item++)
|
||||
{
|
||||
|
@ -565,6 +597,7 @@ static UINT MENU_FindItemByKey( HWND hwndOwner, HMENU hmenu,
|
|||
{
|
||||
WND* w = WIN_FindWndPtr(hwndOwner);
|
||||
hmenu = GetSubMenu(w->hSysMenu, 0);
|
||||
WIN_ReleaseWndPtr(w);
|
||||
}
|
||||
|
||||
if (hmenu)
|
||||
|
@ -1212,16 +1245,24 @@ UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect, HWND hwnd,
|
|||
BOOL suppress_draw)
|
||||
{
|
||||
LPPOPUPMENU lppop;
|
||||
UINT i;
|
||||
UINT i,retvalue;
|
||||
WND *wndPtr = WIN_FindWndPtr( hwnd );
|
||||
|
||||
lppop = (LPPOPUPMENU) USER_HEAP_LIN_ADDR( (HMENU16)wndPtr->wIDmenu );
|
||||
if (lppop == NULL || lprect == NULL) return SYSMETRICS_CYMENU;
|
||||
if (lppop == NULL || lprect == NULL)
|
||||
{
|
||||
retvalue = SYSMETRICS_CYMENU;
|
||||
goto END;
|
||||
}
|
||||
TRACE(menu,"(%04x, %p, %p); !\n",
|
||||
hDC, lprect, lppop);
|
||||
if (lppop->Height == 0) MENU_MenuBarCalcSize(hDC, lprect, lppop, hwnd);
|
||||
lprect->bottom = lprect->top + lppop->Height;
|
||||
if (suppress_draw) return lppop->Height;
|
||||
if (suppress_draw)
|
||||
{
|
||||
retvalue = lppop->Height;
|
||||
goto END;
|
||||
}
|
||||
|
||||
FillRect(hDC, lprect, GetSysColorBrush(COLOR_MENU) );
|
||||
|
||||
|
@ -1236,13 +1277,20 @@ UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect, HWND hwnd,
|
|||
LineTo( hDC, lprect->right, lprect->bottom );
|
||||
}
|
||||
|
||||
if (lppop->nItems == 0) return SYSMETRICS_CYMENU;
|
||||
if (lppop->nItems == 0)
|
||||
{
|
||||
retvalue = SYSMETRICS_CYMENU;
|
||||
goto END;
|
||||
}
|
||||
for (i = 0; i < lppop->nItems; i++)
|
||||
{
|
||||
MENU_DrawMenuItem( hwnd, hDC, &lppop->items[i], lppop->Height, TRUE,
|
||||
ODA_DRAWENTIRE );
|
||||
}
|
||||
return lppop->Height;
|
||||
retvalue = lppop->Height;
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1251,34 +1299,37 @@ UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect, HWND hwnd,
|
|||
*/
|
||||
BOOL MENU_PatchResidentPopup( HQUEUE16 checkQueue, WND* checkWnd )
|
||||
{
|
||||
if( pTopPopupWnd )
|
||||
WND *pTPWnd = MENU_GetTopPopupWnd();
|
||||
|
||||
if( pTPWnd )
|
||||
{
|
||||
HTASK16 hTask = 0;
|
||||
|
||||
TRACE(menu,"patching resident popup: %04x %04x [%04x %04x]\n",
|
||||
checkQueue, checkWnd ? checkWnd->hwndSelf : 0, pTopPopupWnd->hmemTaskQ,
|
||||
pTopPopupWnd->owner ? pTopPopupWnd->owner->hwndSelf : 0);
|
||||
checkQueue, checkWnd ? checkWnd->hwndSelf : 0, pTPWnd->hmemTaskQ,
|
||||
pTPWnd->owner ? pTPWnd->owner->hwndSelf : 0);
|
||||
|
||||
switch( checkQueue )
|
||||
{
|
||||
case 0: /* checkWnd is the new popup owner */
|
||||
if( checkWnd )
|
||||
{
|
||||
pTopPopupWnd->owner = checkWnd;
|
||||
if( pTopPopupWnd->hmemTaskQ != checkWnd->hmemTaskQ )
|
||||
pTPWnd->owner = checkWnd;
|
||||
if( pTPWnd->hmemTaskQ != checkWnd->hmemTaskQ )
|
||||
hTask = QUEUE_GetQueueTask( checkWnd->hmemTaskQ );
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xFFFF: /* checkWnd is destroyed */
|
||||
if( pTopPopupWnd->owner == checkWnd )
|
||||
pTopPopupWnd->owner = NULL;
|
||||
if( pTPWnd->owner == checkWnd )
|
||||
pTPWnd->owner = NULL;
|
||||
MENU_ReleaseTopPopupWnd();
|
||||
return TRUE;
|
||||
|
||||
default: /* checkQueue is exiting */
|
||||
if( pTopPopupWnd->hmemTaskQ == checkQueue )
|
||||
if( pTPWnd->hmemTaskQ == checkQueue )
|
||||
{
|
||||
hTask = QUEUE_GetQueueTask( pTopPopupWnd->hmemTaskQ );
|
||||
hTask = QUEUE_GetQueueTask( pTPWnd->hmemTaskQ );
|
||||
hTask = TASK_GetNextTask( hTask );
|
||||
}
|
||||
break;
|
||||
|
@ -1289,13 +1340,15 @@ BOOL MENU_PatchResidentPopup( HQUEUE16 checkQueue, WND* checkWnd )
|
|||
TDB* task = (TDB*)GlobalLock16( hTask );
|
||||
if( task )
|
||||
{
|
||||
pTopPopupWnd->hInstance = task->hInstance;
|
||||
pTopPopupWnd->hmemTaskQ = task->hQueue;
|
||||
pTPWnd->hInstance = task->hInstance;
|
||||
pTPWnd->hmemTaskQ = task->hQueue;
|
||||
MENU_ReleaseTopPopupWnd();
|
||||
return TRUE;
|
||||
}
|
||||
else WARN(menu,"failed to patch resident popup.\n");
|
||||
}
|
||||
}
|
||||
MENU_ReleaseTopPopupWnd();
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1358,8 +1411,13 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id,
|
|||
WS_POPUP, x, y, width, height,
|
||||
hwndOwner, 0, wndOwner->hInstance,
|
||||
(LPVOID)hmenu ));
|
||||
if (!pTopPopupWnd) return FALSE;
|
||||
if (!pTopPopupWnd)
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndOwner);
|
||||
return FALSE;
|
||||
}
|
||||
menu->hWnd = pTopPopupWnd->hwndSelf;
|
||||
MENU_ReleaseTopPopupWnd();
|
||||
}
|
||||
else
|
||||
if( uSubPWndLevel )
|
||||
|
@ -1370,19 +1428,25 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id,
|
|||
WS_POPUP, x, y, width, height,
|
||||
menu->hWnd, 0, wndOwner->hInstance,
|
||||
(LPVOID)hmenu );
|
||||
if( !menu->hWnd ) return FALSE;
|
||||
if( !menu->hWnd )
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndOwner);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else /* top level popup menu window already exists */
|
||||
{
|
||||
menu->hWnd = pTopPopupWnd->hwndSelf;
|
||||
WND *pTPWnd = MENU_GetTopPopupWnd();
|
||||
menu->hWnd = pTPWnd->hwndSelf;
|
||||
|
||||
MENU_PatchResidentPopup( 0, wndOwner );
|
||||
SendMessage16( pTopPopupWnd->hwndSelf, MM_SETMENUHANDLE, (WPARAM16)hmenu, 0L);
|
||||
SendMessage16( pTPWnd->hwndSelf, MM_SETMENUHANDLE, (WPARAM16)hmenu, 0L);
|
||||
|
||||
/* adjust its size */
|
||||
|
||||
SetWindowPos( menu->hWnd, 0, x, y, width, height,
|
||||
SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOREDRAW);
|
||||
MENU_ReleaseTopPopupWnd();
|
||||
}
|
||||
|
||||
uSubPWndLevel++; /* menu level counter */
|
||||
|
@ -1392,6 +1456,7 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id,
|
|||
SetWindowPos( menu->hWnd, HWND_TOP, 0, 0, 0, 0,
|
||||
SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE );
|
||||
UpdateWindow( menu->hWnd );
|
||||
WIN_ReleaseWndPtr(wndOwner);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
@ -1785,7 +1850,7 @@ static void MENU_HideSubPopups( HWND hwndOwner, HMENU hmenu,
|
|||
MENU_HideSubPopups( hwndOwner, hsubmenu, FALSE );
|
||||
MENU_SelectItem( hwndOwner, hsubmenu, NO_SELECTED_ITEM, sendMenuSelect );
|
||||
|
||||
if (submenu->hWnd == pTopPopupWnd->hwndSelf )
|
||||
if (submenu->hWnd == MENU_GetTopPopupWnd()->hwndSelf )
|
||||
{
|
||||
ShowWindow( submenu->hWnd, SW_HIDE );
|
||||
uSubPWndLevel = 0;
|
||||
|
@ -1795,6 +1860,7 @@ static void MENU_HideSubPopups( HWND hwndOwner, HMENU hmenu,
|
|||
DestroyWindow( submenu->hWnd );
|
||||
submenu->hWnd = 0;
|
||||
}
|
||||
MENU_ReleaseTopPopupWnd();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1817,11 +1883,19 @@ static HMENU MENU_ShowSubPopup( HWND hwndOwner, HMENU hmenu,
|
|||
if (!(menu = (POPUPMENU *) USER_HEAP_LIN_ADDR( hmenu ))) return hmenu;
|
||||
|
||||
if (!(wndPtr = WIN_FindWndPtr( menu->hWnd )) ||
|
||||
(menu->FocusedItem == NO_SELECTED_ITEM)) return hmenu;
|
||||
(menu->FocusedItem == NO_SELECTED_ITEM))
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return hmenu;
|
||||
}
|
||||
|
||||
item = &menu->items[menu->FocusedItem];
|
||||
if (!(item->fType & MF_POPUP) ||
|
||||
(item->fState & (MF_GRAYED | MF_DISABLED))) return hmenu;
|
||||
(item->fState & (MF_GRAYED | MF_DISABLED)))
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return hmenu;
|
||||
}
|
||||
|
||||
/* message must be send before using item,
|
||||
because nearly everything may by changed by the application ! */
|
||||
|
@ -1877,6 +1951,7 @@ static HMENU MENU_ShowSubPopup( HWND hwndOwner, HMENU hmenu,
|
|||
rect.left, rect.top, rect.right, rect.bottom );
|
||||
if (selectFirst)
|
||||
MENU_MoveSelection( hwndOwner, item->hSubMenu, ITEM_NEXT );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return item->hSubMenu;
|
||||
}
|
||||
|
||||
|
@ -1908,6 +1983,7 @@ static HMENU MENU_PtMenu( HMENU hMenu, POINT16 pt )
|
|||
|
||||
ht = ( ht == HTSYSMENU ) ? (UINT)(wndPtr->hSysMenu)
|
||||
: ( ht == HTMENU ) ? (UINT)(wndPtr->wIDmenu) : 0;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
}
|
||||
return (HMENU)ht;
|
||||
|
@ -2135,7 +2211,10 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT vk )
|
|||
/* switch to the menu bar */
|
||||
|
||||
if( wndPtr->dwStyle & WS_CHILD || !wndPtr->wIDmenu )
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
hNewMenu = wndPtr->wIDmenu;
|
||||
if( vk == VK_LEFT )
|
||||
|
@ -2149,7 +2228,12 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT vk )
|
|||
/* switch to the system menu */
|
||||
hNewMenu = wndPtr->hSysMenu;
|
||||
}
|
||||
else return FALSE;
|
||||
else
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return FALSE;
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
else /* application returned a new menu to switch to */
|
||||
{
|
||||
|
@ -2171,8 +2255,10 @@ static LRESULT MENU_DoNextMenu( MTRACKER* pmt, UINT vk )
|
|||
* try to track hNewMenu as a popup? */
|
||||
|
||||
TRACE(menu," -- got confused.\n");
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return FALSE;
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
else return FALSE;
|
||||
}
|
||||
|
@ -2702,6 +2788,7 @@ LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam,
|
|||
LPARAM lParam )
|
||||
{
|
||||
WND* wndPtr = WIN_FindWndPtr(hwnd);
|
||||
LRESULT retvalue;
|
||||
|
||||
switch(message)
|
||||
{
|
||||
|
@ -2709,11 +2796,13 @@ LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam,
|
|||
{
|
||||
CREATESTRUCTA *cs = (CREATESTRUCTA*)lParam;
|
||||
SetWindowLongA( hwnd, 0, (LONG)cs->lpCreateParams );
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
}
|
||||
|
||||
case WM_MOUSEACTIVATE: /* We don't want to be activated */
|
||||
return MA_NOACTIVATE;
|
||||
retvalue = MA_NOACTIVATE;
|
||||
goto END;
|
||||
|
||||
case WM_PAINT:
|
||||
{
|
||||
|
@ -2722,27 +2811,30 @@ LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam,
|
|||
MENU_DrawPopupMenu( hwnd, ps.hdc,
|
||||
(HMENU)GetWindowLongA( hwnd, 0 ) );
|
||||
EndPaint( hwnd, &ps );
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
}
|
||||
case WM_ERASEBKGND:
|
||||
return 1;
|
||||
retvalue = 1;
|
||||
goto END;
|
||||
|
||||
case WM_DESTROY:
|
||||
|
||||
/* zero out global pointer in case resident popup window
|
||||
* was somehow destroyed. */
|
||||
|
||||
if( pTopPopupWnd )
|
||||
if(MENU_GetTopPopupWnd() )
|
||||
{
|
||||
if( hwnd == pTopPopupWnd->hwndSelf )
|
||||
{
|
||||
ERR(menu, "resident popup destroyed!\n");
|
||||
|
||||
pTopPopupWnd = NULL;
|
||||
MENU_DestroyTopPopupWnd();
|
||||
uSubPWndLevel = 0;
|
||||
}
|
||||
else
|
||||
uSubPWndLevel--;
|
||||
MENU_ReleaseTopPopupWnd();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -2764,12 +2856,17 @@ LRESULT WINAPI PopupMenuWndProc( HWND hwnd, UINT message, WPARAM wParam,
|
|||
|
||||
case MM_GETMENUHANDLE:
|
||||
|
||||
return *(HMENU*)wndPtr->wExtra;
|
||||
retvalue = *(HMENU*)wndPtr->wExtra;
|
||||
goto END;
|
||||
|
||||
default:
|
||||
return DefWindowProcA( hwnd, message, wParam, lParam );
|
||||
retvalue = DefWindowProcA( hwnd, message, wParam, lParam );
|
||||
goto END;
|
||||
}
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2785,18 +2882,24 @@ UINT MENU_GetMenuBarHeight( HWND hwnd, UINT menubarWidth,
|
|||
RECT rectBar;
|
||||
WND *wndPtr;
|
||||
LPPOPUPMENU lppop;
|
||||
UINT retvalue;
|
||||
|
||||
TRACE(menu, "HWND 0x%x, width %d, "
|
||||
"at (%d, %d).\n", hwnd, menubarWidth, orgX, orgY );
|
||||
|
||||
if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
|
||||
if (!(lppop = (LPPOPUPMENU)USER_HEAP_LIN_ADDR((HMENU16)wndPtr->wIDmenu)))
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return 0;
|
||||
}
|
||||
hdc = GetDCEx( hwnd, 0, DCX_CACHE | DCX_WINDOW );
|
||||
SetRect(&rectBar, orgX, orgY, orgX+menubarWidth, orgY+SYSMETRICS_CYMENU);
|
||||
MENU_MenuBarCalcSize( hdc, &rectBar, lppop, hwnd );
|
||||
ReleaseDC( hwnd, hdc );
|
||||
return lppop->Height;
|
||||
retvalue = lppop->Height;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -3430,18 +3533,21 @@ BOOL WINAPI DestroyMenu( HMENU hMenu )
|
|||
if (hMenu && hMenu != MENU_DefSysPopup)
|
||||
{
|
||||
LPPOPUPMENU lppop = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu);
|
||||
WND *pTPWnd = MENU_GetTopPopupWnd();
|
||||
|
||||
if( pTopPopupWnd && (hMenu == *(HMENU*)pTopPopupWnd->wExtra) )
|
||||
*(UINT*)pTopPopupWnd->wExtra = 0;
|
||||
if( pTPWnd && (hMenu == *(HMENU*)pTPWnd->wExtra) )
|
||||
*(UINT*)pTPWnd->wExtra = 0;
|
||||
|
||||
if (IS_A_MENU( lppop ))
|
||||
{
|
||||
lppop->wMagic = 0; /* Mark it as destroyed */
|
||||
|
||||
if ((lppop->wFlags & MF_POPUP) && lppop->hWnd &&
|
||||
(!pTopPopupWnd || (lppop->hWnd != pTopPopupWnd->hwndSelf)))
|
||||
(!pTPWnd || (lppop->hWnd != pTPWnd->hwndSelf)))
|
||||
DestroyWindow( lppop->hWnd );
|
||||
|
||||
MENU_ReleaseTopPopupWnd();
|
||||
|
||||
if (lppop->items) /* recursively destroy submenus */
|
||||
{
|
||||
int i;
|
||||
|
@ -3499,7 +3605,12 @@ HMENU WINAPI GetSystemMenu( HWND hWnd, BOOL bRevert )
|
|||
wndPtr->hSysMenu = MENU_GetSysMenu( hWnd, (HMENU)(-1) );
|
||||
|
||||
if( wndPtr->hSysMenu )
|
||||
return GetSubMenu16(wndPtr->hSysMenu, 0);
|
||||
{
|
||||
HMENU retvalue = GetSubMenu16(wndPtr->hSysMenu, 0);
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -3525,6 +3636,7 @@ BOOL WINAPI SetSystemMenu( HWND hwnd, HMENU hMenu )
|
|||
{
|
||||
if (wndPtr->hSysMenu) DestroyMenu( wndPtr->hSysMenu );
|
||||
wndPtr->hSysMenu = MENU_GetSysMenu( hwnd, hMenu );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
|
@ -3536,10 +3648,17 @@ BOOL WINAPI SetSystemMenu( HWND hwnd, HMENU hMenu )
|
|||
*/
|
||||
HMENU16 WINAPI GetMenu16( HWND16 hWnd )
|
||||
{
|
||||
HMENU16 retvalue;
|
||||
WND * wndPtr = WIN_FindWndPtr(hWnd);
|
||||
if (wndPtr && !(wndPtr->dwStyle & WS_CHILD))
|
||||
return (HMENU16)wndPtr->wIDmenu;
|
||||
return 0;
|
||||
{
|
||||
retvalue = (HMENU16)wndPtr->wIDmenu;
|
||||
goto END;
|
||||
}
|
||||
retvalue = 0;
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -3548,10 +3667,17 @@ HMENU16 WINAPI GetMenu16( HWND16 hWnd )
|
|||
*/
|
||||
HMENU WINAPI GetMenu( HWND hWnd )
|
||||
{
|
||||
HMENU retvalue;
|
||||
WND * wndPtr = WIN_FindWndPtr(hWnd);
|
||||
if (wndPtr && !(wndPtr->dwStyle & WS_CHILD))
|
||||
return (HMENU)wndPtr->wIDmenu;
|
||||
return 0;
|
||||
{
|
||||
retvalue = (HMENU)wndPtr->wIDmenu;
|
||||
goto END;
|
||||
}
|
||||
retvalue = 0;
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -3582,7 +3708,11 @@ BOOL WINAPI SetMenu( HWND hWnd, HMENU hMenu )
|
|||
{
|
||||
LPPOPUPMENU lpmenu;
|
||||
|
||||
if (!(lpmenu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu))) return FALSE;
|
||||
if (!(lpmenu = (LPPOPUPMENU) USER_HEAP_LIN_ADDR(hMenu)))
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return FALSE;
|
||||
}
|
||||
lpmenu->hWnd = hWnd;
|
||||
lpmenu->wFlags &= ~MF_POPUP; /* Can't be a popup */
|
||||
lpmenu->Height = 0; /* Make sure we recalculate the size */
|
||||
|
@ -3590,8 +3720,10 @@ BOOL WINAPI SetMenu( HWND hWnd, HMENU hMenu )
|
|||
if (IsWindowVisible(hWnd))
|
||||
SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
|
||||
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return TRUE;
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -3639,13 +3771,19 @@ BOOL WINAPI DrawMenuBar( HWND hWnd )
|
|||
if (wndPtr && !(wndPtr->dwStyle & WS_CHILD) && wndPtr->wIDmenu)
|
||||
{
|
||||
lppop = (LPPOPUPMENU) USER_HEAP_LIN_ADDR((HMENU16)wndPtr->wIDmenu);
|
||||
if (lppop == NULL) return FALSE;
|
||||
if (lppop == NULL)
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
lppop->Height = 0; /* Make sure we call MENU_MenuBarCalcSize */
|
||||
SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE |
|
||||
SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return TRUE;
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -146,8 +146,11 @@ static SCROLLBAR_INFO *SCROLL_GetPtrScrollInfo( WND* wndPtr, INT nBar )
|
|||
*/
|
||||
static SCROLLBAR_INFO *SCROLL_GetScrollInfo( HWND hwnd, INT nBar )
|
||||
{
|
||||
SCROLLBAR_INFO *retvalue;
|
||||
WND *wndPtr = WIN_FindWndPtr( hwnd );
|
||||
return SCROLL_GetPtrScrollInfo( wndPtr, nBar );
|
||||
retvalue = SCROLL_GetPtrScrollInfo( wndPtr, nBar );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -204,6 +207,7 @@ static BOOL SCROLL_GetScrollBarRect( HWND hwnd, INT nBar, RECT *lprect,
|
|||
break;
|
||||
|
||||
default:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -248,6 +252,7 @@ static BOOL SCROLL_GetScrollBarRect( HWND hwnd, INT nBar, RECT *lprect,
|
|||
+ pixels * (info->CurVal-info->MinVal) / (max - info->MinVal);
|
||||
}
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return vertical;
|
||||
}
|
||||
|
||||
|
@ -560,8 +565,8 @@ void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar,
|
|||
|
||||
if (!wndPtr || !infoPtr ||
|
||||
((nBar == SB_VERT) && !(wndPtr->dwStyle & WS_VSCROLL)) ||
|
||||
((nBar == SB_HORZ) && !(wndPtr->dwStyle & WS_HSCROLL))) return;
|
||||
if (!WIN_IsWindowDrawable( wndPtr, FALSE )) return;
|
||||
((nBar == SB_HORZ) && !(wndPtr->dwStyle & WS_HSCROLL))) goto END;
|
||||
if (!WIN_IsWindowDrawable( wndPtr, FALSE )) goto END;
|
||||
|
||||
vertical = SCROLL_GetScrollBarRect( hwnd, nBar, &rect,
|
||||
&arrowSize, &thumbSize, &thumbPos );
|
||||
|
@ -581,6 +586,8 @@ void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar,
|
|||
if( interior )
|
||||
SCROLL_DrawInterior( hwnd, hdc, nBar, &rect, arrowSize, thumbSize,
|
||||
thumbPos, infoPtr->flags, vertical, FALSE, FALSE );
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
|
||||
|
||||
|
@ -621,11 +628,13 @@ static void SCROLL_HandleKbdEvent( HWND hwnd, WPARAM wParam )
|
|||
case VK_UP: msg = SB_LINEUP; break;
|
||||
case VK_DOWN: msg = SB_LINEDOWN; break;
|
||||
default:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return;
|
||||
}
|
||||
SendMessageA( GetParent(hwnd),
|
||||
(wndPtr->dwStyle & SBS_VERT) ? WM_VSCROLL : WM_HSCROLL,
|
||||
msg, hwnd );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1383,6 +1392,7 @@ BOOL SCROLL_ShowScrollBar( HWND hwnd, INT nBar,
|
|||
BOOL fShowH, BOOL fShowV )
|
||||
{
|
||||
WND *wndPtr = WIN_FindWndPtr( hwnd );
|
||||
BOOL retvalue = FALSE;
|
||||
|
||||
if (!wndPtr) return FALSE;
|
||||
TRACE(scroll, "hwnd=%04x bar=%d horz=%d, vert=%d\n",
|
||||
|
@ -1392,7 +1402,8 @@ BOOL SCROLL_ShowScrollBar( HWND hwnd, INT nBar,
|
|||
{
|
||||
case SB_CTL:
|
||||
ShowWindow( hwnd, fShowH ? SW_SHOW : SW_HIDE );
|
||||
return TRUE;
|
||||
retvalue = TRUE;
|
||||
goto END;
|
||||
|
||||
case SB_BOTH:
|
||||
case SB_HORZ:
|
||||
|
@ -1423,17 +1434,22 @@ BOOL SCROLL_ShowScrollBar( HWND hwnd, INT nBar,
|
|||
break;
|
||||
|
||||
default:
|
||||
return FALSE; /* Nothing to do! */
|
||||
retvalue = FALSE; /* Nothing to do! */
|
||||
goto END;
|
||||
}
|
||||
|
||||
if( fShowH || fShowV ) /* frame has been changed, let the window redraw itself */
|
||||
{
|
||||
SetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE
|
||||
| SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
|
||||
return TRUE;
|
||||
retvalue = TRUE;
|
||||
goto END;
|
||||
}
|
||||
|
||||
return FALSE; /* no frame changes */
|
||||
retvalue = FALSE; /* no frame changes */
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -182,12 +182,14 @@ LRESULT WINAPI StaticWndProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||
|
||||
if (style == SS_ICON)
|
||||
{
|
||||
if (cs->lpszName) {
|
||||
if (cs->lpszName)
|
||||
{
|
||||
if (!HIWORD(cs->lpszName) || cs->lpszName[0])
|
||||
STATIC_SetIcon( wndPtr,
|
||||
STATIC_LoadIcon( wndPtr, cs->lpszName ));
|
||||
}
|
||||
return 1;
|
||||
lResult = 1;
|
||||
goto END;
|
||||
}
|
||||
if (style == SS_BITMAP)
|
||||
{
|
||||
|
@ -196,15 +198,18 @@ LRESULT WINAPI StaticWndProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||
STATIC_LoadBitmap( wndPtr, cs->lpszName ));
|
||||
WARN(static, "style SS_BITMAP, dwStyle is 0x%08lx\n",
|
||||
wndPtr->dwStyle);
|
||||
return 1;
|
||||
lResult = 1;
|
||||
goto END;
|
||||
}
|
||||
if (!HIWORD(cs->lpszName) && (cs->lpszName)) {
|
||||
if (!HIWORD(cs->lpszName) && (cs->lpszName))
|
||||
{
|
||||
FIXME(static,"windowName is 0x%04x, not doing DefWindowProc\n",
|
||||
LOWORD(cs->lpszName)
|
||||
);
|
||||
return 1;
|
||||
LOWORD(cs->lpszName));
|
||||
lResult = 1;
|
||||
goto END;
|
||||
}
|
||||
return DefWindowProcA( hWnd, uMsg, wParam, lParam );
|
||||
lResult = DefWindowProcA( hWnd, uMsg, wParam, lParam );
|
||||
goto END;
|
||||
}
|
||||
case WM_CREATE:
|
||||
if (style < 0L || style > SS_TYPEMASK)
|
||||
|
@ -268,8 +273,16 @@ LRESULT WINAPI StaticWndProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||
break;
|
||||
|
||||
case WM_SETFONT:
|
||||
if (style == SS_ICON) return 0;
|
||||
if (style == SS_BITMAP) return 0;
|
||||
if (style == SS_ICON)
|
||||
{
|
||||
lResult = 0;
|
||||
goto END;
|
||||
}
|
||||
if (style == SS_BITMAP)
|
||||
{
|
||||
lResult = 0;
|
||||
goto END;
|
||||
}
|
||||
infoPtr->hFont = (HFONT16)wParam;
|
||||
if (LOWORD(lParam))
|
||||
{
|
||||
|
@ -279,18 +292,22 @@ LRESULT WINAPI StaticWndProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||
break;
|
||||
|
||||
case WM_GETFONT:
|
||||
return infoPtr->hFont;
|
||||
lResult = infoPtr->hFont;
|
||||
goto END;
|
||||
|
||||
case WM_NCHITTEST:
|
||||
return HTTRANSPARENT;
|
||||
lResult = HTTRANSPARENT;
|
||||
goto END;
|
||||
|
||||
case WM_GETDLGCODE:
|
||||
return DLGC_STATIC;
|
||||
lResult = DLGC_STATIC;
|
||||
goto END;
|
||||
|
||||
case STM_GETIMAGE:
|
||||
case STM_GETICON16:
|
||||
case STM_GETICON:
|
||||
return infoPtr->hIcon;
|
||||
lResult = infoPtr->hIcon;
|
||||
goto END;
|
||||
|
||||
case STM_SETIMAGE:
|
||||
/* FIXME: handle wParam */
|
||||
|
@ -311,6 +328,8 @@ LRESULT WINAPI StaticWndProc( HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||
break;
|
||||
}
|
||||
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return lResult;
|
||||
}
|
||||
|
||||
|
|
|
@ -682,8 +682,12 @@ LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
|
|||
break;
|
||||
/*If we released the mouse and our buddy is an edit */
|
||||
/* we must select all text in it. */
|
||||
if(WIDGETS_IsControl(WIN_FindWndPtr(infoPtr->Buddy), BIC32_EDIT))
|
||||
{
|
||||
WND *tmpWnd = WIN_FindWndPtr(infoPtr->Buddy);
|
||||
if(WIDGETS_IsControl(tmpWnd, BIC32_EDIT))
|
||||
SendMessageA(infoPtr->Buddy, EM_SETSEL, 0, MAKELONG(0, -1));
|
||||
WIN_ReleaseWndPtr(tmpWnd);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_LBUTTONDOWN:
|
||||
|
|
|
@ -2671,7 +2671,11 @@ static HRESULT WINAPI IDirectDraw2_SetCooperativeLevel(
|
|||
/* This will be overwritten in the case of Full Screen mode.
|
||||
Windowed games could work with that :-) */
|
||||
if (hwnd)
|
||||
this->d.drawable = X11DRV_WND_GetXWindow(WIN_FindWndPtr(hwnd));
|
||||
{
|
||||
WND *tmpWnd = WIN_FindWndPtr(hwnd);
|
||||
this->d.drawable = X11DRV_WND_GetXWindow(tmpWnd);
|
||||
WIN_ReleaseWndPtr(tmpWnd);
|
||||
}
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
@ -2985,6 +2989,7 @@ static HRESULT WINAPI Xlib_IDirectDraw_SetDisplayMode(
|
|||
LPDIRECTDRAW this,DWORD width,DWORD height,DWORD depth
|
||||
) {
|
||||
char buf[200];
|
||||
WND *tmpWnd;
|
||||
|
||||
TRACE(ddraw, "(%p)->SetDisplayMode(%ld,%ld,%ld)\n",
|
||||
this, width, height, depth);
|
||||
|
@ -3062,11 +3067,17 @@ static HRESULT WINAPI Xlib_IDirectDraw_SetDisplayMode(
|
|||
|
||||
_common_IDirectDraw_SetDisplayMode(this);
|
||||
|
||||
tmpWnd = WIN_FindWndPtr(this->d.window);
|
||||
this->d.paintable = 1;
|
||||
this->d.drawable = ((X11DRV_WND_DATA *) WIN_FindWndPtr(this->d.window)->pDriverData)->window;
|
||||
this->d.drawable = ((X11DRV_WND_DATA *) tmpWnd->pDriverData)->window;
|
||||
/* We don't have a context for this window. Host off the desktop */
|
||||
|
||||
if( !this->d.drawable )
|
||||
{
|
||||
this->d.drawable = ((X11DRV_WND_DATA *) WIN_GetDesktop()->pDriverData)->window;
|
||||
WIN_ReleaseDesktop();
|
||||
}
|
||||
WIN_ReleaseWndPtr(tmpWnd);
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
|
@ -4068,11 +4079,15 @@ LRESULT WINAPI Xlib_DDWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
|
|||
|
||||
if( !ret )
|
||||
{
|
||||
WND *tmpWnd =WIN_FindWndPtr(ddraw->d.mainWindow);
|
||||
/* We didn't handle the message - give it to the application */
|
||||
if (ddraw && ddraw->d.mainWindow && WIN_FindWndPtr(ddraw->d.mainWindow)) {
|
||||
ret = CallWindowProcA( WIN_FindWndPtr( ddraw->d.mainWindow )->winproc,
|
||||
if (ddraw && ddraw->d.mainWindow && tmpWnd)
|
||||
{
|
||||
ret = CallWindowProcA(tmpWnd->winproc,
|
||||
ddraw->d.mainWindow, msg, wParam, lParam );
|
||||
}
|
||||
WIN_ReleaseWndPtr(tmpWnd);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -4223,10 +4238,14 @@ HRESULT WINAPI DirectDrawCreate( LPGUID lpGUID, LPDIRECTDRAW *lplpDD, LPUNKNOWN
|
|||
sizeof( LPDIRECTDRAW ); /* ddrawXlibThisOffset */
|
||||
|
||||
/* We can be a child of the desktop since we're really important */
|
||||
/*
|
||||
This code is not useful since hInstance is forced to 0 afterward
|
||||
pParentWindow = WIN_GetDesktop();
|
||||
wc.hInstance = pParentWindow ? pParentWindow->hwndSelf : 0;
|
||||
*/
|
||||
wc.hInstance = 0;
|
||||
|
||||
|
||||
wc.hIcon = 0;
|
||||
wc.hCursor = (HCURSOR)IDC_ARROWA;
|
||||
wc.hbrBackground= NULL_BRUSH;
|
||||
|
|
|
@ -273,6 +273,8 @@ static LRESULT WINAPI THUNK_CallWndProc16( WNDPROC16 proc, HWND16 hwnd,
|
|||
EBP_reg(&context) = OFFSETOF(thdb->cur_stack)
|
||||
+ (WORD)&((STACK16FRAME*)0)->bp;
|
||||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
|
||||
if (lParam)
|
||||
{
|
||||
/* Some programs (eg. the "Undocumented Windows" examples, JWP) only
|
||||
|
|
|
@ -139,8 +139,11 @@ extern void WIN_UnlockWnds();
|
|||
extern int WIN_SuspendWndsLock();
|
||||
extern void WIN_RestoreWndsLock(int ipreviousLock);
|
||||
extern WND* WIN_FindWndPtr( HWND hwnd );
|
||||
extern WND* WIN_LockWndPtr(WND *wndPtr);
|
||||
extern void WIN_ReleaseWndPtr(WND *wndPtr);
|
||||
extern void WIN_UpdateWndPtr(WND **oldPtr,WND *newPtr);
|
||||
extern WND* WIN_GetDesktop(void);
|
||||
extern void WIN_ReleaseDesktop(void);
|
||||
extern void WIN_DumpWindow( HWND hwnd );
|
||||
extern void WIN_WalkWindows( HWND hwnd, int indent );
|
||||
extern BOOL WIN_UnlinkWindow( HWND hwnd );
|
||||
|
@ -153,6 +156,7 @@ extern WND* WIN_GetTopParentPtr( WND* pWnd );
|
|||
extern BOOL WIN_IsWindowDrawable(WND*, BOOL );
|
||||
extern HINSTANCE WIN_GetWindowInstance( HWND hwnd );
|
||||
extern WND** WIN_BuildWinArray( WND *wndPtr, UINT bwa, UINT* pnum );
|
||||
extern void WIN_ReleaseWinArray(WND **wndArray);
|
||||
|
||||
extern HWND CARET_GetHwnd(void);
|
||||
extern void CARET_GetRect(LPRECT lprc); /* windows/caret.c */
|
||||
|
|
|
@ -462,7 +462,7 @@ int DDE_GetRemoteMessage()
|
|||
/* iterate through all the windows */
|
||||
for (wndPtr = WIN_FindWndPtr(GetTopWindow(GetDesktopWindow()));
|
||||
wndPtr != NULL;
|
||||
wndPtr = wndPtr->next)
|
||||
WIN_UpdateWndPtr(&wndPtr,wndPtr->next))
|
||||
{
|
||||
if (wndPtr->dwStyle & WS_POPUP || wndPtr->dwStyle & WS_CAPTION) {
|
||||
if (was_sent)
|
||||
|
|
|
@ -653,6 +653,8 @@ const char *SPY_GetWndName( HWND hwnd )
|
|||
if( *src ) for( n = 0; n < 3; n++ ) *(p++)='.';
|
||||
*(p++) = postfix;
|
||||
*(p++) = '\0';
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
|
||||
}
|
||||
else lstrcpyA( wnd_buffer, "\"NULL\"" );
|
||||
return wnd_buffer;
|
||||
|
|
|
@ -728,7 +728,11 @@ WORD WINAPI GetClassWord( HWND hwnd, INT offset )
|
|||
if (offset >= 0)
|
||||
{
|
||||
if (offset <= wndPtr->class->cbClsExtra - sizeof(WORD))
|
||||
return GET_WORD(((char *)wndPtr->class->wExtra) + offset);
|
||||
{
|
||||
WORD retvalue = GET_WORD(((char *)wndPtr->class->wExtra) + offset);
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
}
|
||||
else switch(offset)
|
||||
{
|
||||
|
@ -741,9 +745,11 @@ WORD WINAPI GetClassWord( HWND hwnd, INT offset )
|
|||
case GCW_CBWNDEXTRA:
|
||||
case GCW_CBCLSEXTRA:
|
||||
case GCW_HMODULE:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return (WORD)GetClassLongA( hwnd, offset );
|
||||
}
|
||||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
WARN(class, "Invalid offset %d\n", offset);
|
||||
return 0;
|
||||
}
|
||||
|
@ -763,7 +769,9 @@ LONG WINAPI GetClassLong16( HWND16 hwnd, INT16 offset )
|
|||
{
|
||||
case GCL_WNDPROC:
|
||||
if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
|
||||
return (LONG)WINPROC_GetProc( wndPtr->class->winproc, WIN_PROC_16 );
|
||||
ret = (LONG)WINPROC_GetProc( wndPtr->class->winproc, WIN_PROC_16 );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return ret;
|
||||
case GCL_MENUNAME:
|
||||
ret = GetClassLongA( hwnd, offset );
|
||||
return (LONG)SEGPTR_GET( (void *)ret );
|
||||
|
@ -779,6 +787,7 @@ LONG WINAPI GetClassLong16( HWND16 hwnd, INT16 offset )
|
|||
LONG WINAPI GetClassLongA( HWND hwnd, INT offset )
|
||||
{
|
||||
WND * wndPtr;
|
||||
LONG retvalue;
|
||||
|
||||
TRACE(class,"%x %x\n",hwnd, offset);
|
||||
|
||||
|
@ -786,27 +795,41 @@ LONG WINAPI GetClassLongA( HWND hwnd, INT offset )
|
|||
if (offset >= 0)
|
||||
{
|
||||
if (offset <= wndPtr->class->cbClsExtra - sizeof(LONG))
|
||||
return GET_DWORD(((char *)wndPtr->class->wExtra) + offset);
|
||||
{
|
||||
retvalue = GET_DWORD(((char *)wndPtr->class->wExtra) + offset);
|
||||
goto END;
|
||||
}
|
||||
}
|
||||
|
||||
switch(offset)
|
||||
{
|
||||
case GCL_STYLE: return (LONG)wndPtr->class->style;
|
||||
case GCL_CBWNDEXTRA: return (LONG)wndPtr->class->cbWndExtra;
|
||||
case GCL_CBCLSEXTRA: return (LONG)wndPtr->class->cbClsExtra;
|
||||
case GCL_HMODULE: return (LONG)wndPtr->class->hInstance;
|
||||
case GCL_STYLE: retvalue = (LONG)wndPtr->class->style;
|
||||
goto END;
|
||||
case GCL_CBWNDEXTRA: retvalue = (LONG)wndPtr->class->cbWndExtra;
|
||||
goto END;
|
||||
case GCL_CBCLSEXTRA: retvalue = (LONG)wndPtr->class->cbClsExtra;
|
||||
goto END;
|
||||
case GCL_HMODULE: retvalue = (LONG)wndPtr->class->hInstance;
|
||||
goto END;
|
||||
case GCL_WNDPROC:
|
||||
return (LONG)WINPROC_GetProc(wndPtr->class->winproc, WIN_PROC_32A);
|
||||
retvalue = (LONG)WINPROC_GetProc(wndPtr->class->winproc, WIN_PROC_32A);
|
||||
goto END;
|
||||
case GCL_MENUNAME:
|
||||
return (LONG)CLASS_GetMenuNameA( wndPtr->class );
|
||||
retvalue = (LONG)CLASS_GetMenuNameA( wndPtr->class );
|
||||
goto END;
|
||||
case GCW_ATOM:
|
||||
case GCL_HBRBACKGROUND:
|
||||
case GCL_HCURSOR:
|
||||
case GCL_HICON:
|
||||
case GCL_HICONSM:
|
||||
return GetClassWord( hwnd, offset );
|
||||
retvalue = GetClassWord( hwnd, offset );
|
||||
goto END;
|
||||
}
|
||||
WARN(class, "Invalid offset %d\n", offset);
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -816,6 +839,7 @@ LONG WINAPI GetClassLongA( HWND hwnd, INT offset )
|
|||
LONG WINAPI GetClassLongW( HWND hwnd, INT offset )
|
||||
{
|
||||
WND * wndPtr;
|
||||
LONG retvalue;
|
||||
|
||||
TRACE(class,"%x %x\n",hwnd, offset);
|
||||
|
||||
|
@ -823,10 +847,14 @@ LONG WINAPI GetClassLongW( HWND hwnd, INT offset )
|
|||
{
|
||||
case GCL_WNDPROC:
|
||||
if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
|
||||
return (LONG)WINPROC_GetProc( wndPtr->class->winproc, WIN_PROC_32W );
|
||||
retvalue = (LONG)WINPROC_GetProc( wndPtr->class->winproc, WIN_PROC_32W );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
case GCL_MENUNAME:
|
||||
if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return 0;
|
||||
return (LONG)CLASS_GetMenuNameW( wndPtr->class );
|
||||
retvalue = (LONG)CLASS_GetMenuNameW( wndPtr->class );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
default:
|
||||
return GetClassLongA( hwnd, offset );
|
||||
}
|
||||
|
@ -861,6 +889,7 @@ WORD WINAPI SetClassWord( HWND hwnd, INT offset, WORD newval )
|
|||
else
|
||||
{
|
||||
WARN( class, "Invalid offset %d\n", offset );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -870,6 +899,7 @@ WORD WINAPI SetClassWord( HWND hwnd, INT offset, WORD newval )
|
|||
case GCW_CBWNDEXTRA:
|
||||
case GCW_CBCLSEXTRA:
|
||||
case GCW_HMODULE:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return (WORD)SetClassLongA( hwnd, offset, (LONG)newval );
|
||||
case GCW_HBRBACKGROUND: ptr = &wndPtr->class->hbrBackground; break;
|
||||
case GCW_HCURSOR: ptr = &wndPtr->class->hCursor; break;
|
||||
|
@ -878,6 +908,7 @@ WORD WINAPI SetClassWord( HWND hwnd, INT offset, WORD newval )
|
|||
case GCW_ATOM: ptr = &wndPtr->class->atomName; break;
|
||||
default:
|
||||
WARN( class, "Invalid offset %d\n", offset);
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return 0;
|
||||
}
|
||||
retval = GET_WORD(ptr);
|
||||
|
@ -892,6 +923,7 @@ WORD WINAPI SetClassWord( HWND hwnd, INT offset, WORD newval )
|
|||
CLASS_SetClassNameA( wndPtr->class, NULL );
|
||||
FIXME(class,"GCW_ATOM changed for a class. Not updating className, so GetClassInfoEx may not return correct className!\n");
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -913,6 +945,7 @@ LONG WINAPI SetClassLong16( HWND16 hwnd, INT16 offset, LONG newval )
|
|||
retval = (LONG)WINPROC_GetProc( wndPtr->class->winproc, WIN_PROC_16 );
|
||||
WINPROC_SetProc( &wndPtr->class->winproc, (WNDPROC16)newval,
|
||||
WIN_PROC_16, WIN_PROC_CLASS );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retval;
|
||||
case GCL_MENUNAME:
|
||||
return SetClassLongA( hwnd, offset, (LONG)PTR_SEG_TO_LIN(newval) );
|
||||
|
@ -941,35 +974,41 @@ LONG WINAPI SetClassLongA( HWND hwnd, INT offset, LONG newval )
|
|||
else
|
||||
{
|
||||
WARN( class, "Invalid offset %d\n", offset );
|
||||
return 0;
|
||||
retval = 0;
|
||||
goto END;
|
||||
}
|
||||
}
|
||||
else switch(offset)
|
||||
{
|
||||
case GCL_MENUNAME:
|
||||
CLASS_SetMenuNameA( wndPtr->class, (LPCSTR)newval );
|
||||
return 0; /* Old value is now meaningless anyway */
|
||||
retval = 0; /* Old value is now meaningless anyway */
|
||||
goto END;
|
||||
case GCL_WNDPROC:
|
||||
retval = (LONG)WINPROC_GetProc( wndPtr->class->winproc,
|
||||
WIN_PROC_32A );
|
||||
WINPROC_SetProc( &wndPtr->class->winproc, (WNDPROC16)newval,
|
||||
WIN_PROC_32A, WIN_PROC_CLASS );
|
||||
return retval;
|
||||
goto END;
|
||||
case GCL_HBRBACKGROUND:
|
||||
case GCL_HCURSOR:
|
||||
case GCL_HICON:
|
||||
case GCL_HICONSM:
|
||||
return SetClassWord( hwnd, offset, (WORD)newval );
|
||||
retval = SetClassWord( hwnd, offset, (WORD)newval );
|
||||
goto END;
|
||||
case GCL_STYLE: ptr = &wndPtr->class->style; break;
|
||||
case GCL_CBWNDEXTRA: ptr = &wndPtr->class->cbWndExtra; break;
|
||||
case GCL_CBCLSEXTRA: ptr = &wndPtr->class->cbClsExtra; break;
|
||||
case GCL_HMODULE: ptr = &wndPtr->class->hInstance; break;
|
||||
default:
|
||||
WARN( class, "Invalid offset %d\n", offset );
|
||||
return 0;
|
||||
retval = 0;
|
||||
goto END;
|
||||
}
|
||||
retval = GET_DWORD(ptr);
|
||||
PUT_DWORD( ptr, newval );
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -991,10 +1030,12 @@ LONG WINAPI SetClassLongW( HWND hwnd, INT offset, LONG newval )
|
|||
retval = (LONG)WINPROC_GetProc( wndPtr->class->winproc, WIN_PROC_32W );
|
||||
WINPROC_SetProc( &wndPtr->class->winproc, (WNDPROC16)newval,
|
||||
WIN_PROC_32W, WIN_PROC_CLASS );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retval;
|
||||
case GCL_MENUNAME:
|
||||
if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
|
||||
CLASS_SetMenuNameW( wndPtr->class, (LPCWSTR)newval );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return 0; /* Old value is now meaningless anyway */
|
||||
default:
|
||||
return SetClassLongA( hwnd, offset, newval );
|
||||
|
@ -1008,8 +1049,11 @@ LONG WINAPI SetClassLongW( HWND hwnd, INT offset, LONG newval )
|
|||
INT16 WINAPI GetClassName16( HWND16 hwnd, LPSTR buffer, INT16 count )
|
||||
{
|
||||
WND *wndPtr;
|
||||
INT16 retvalue;
|
||||
if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
|
||||
return GlobalGetAtomName16( wndPtr->class->atomName, buffer, count );
|
||||
retvalue = GlobalGetAtomName16( wndPtr->class->atomName, buffer, count );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1023,6 +1067,7 @@ INT WINAPI GetClassNameA( HWND hwnd, LPSTR buffer, INT count )
|
|||
if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
|
||||
ret = GlobalGetAtomNameA( wndPtr->class->atomName, buffer, count );
|
||||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
TRACE(class,"%x %s %x\n",hwnd, buffer, count);
|
||||
return ret;
|
||||
}
|
||||
|
@ -1037,7 +1082,7 @@ INT WINAPI GetClassNameW( HWND hwnd, LPWSTR buffer, INT count )
|
|||
|
||||
if (!(wndPtr = WIN_FindWndPtr(hwnd))) return 0;
|
||||
ret = GlobalGetAtomNameW( wndPtr->class->atomName, buffer, count );
|
||||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
TRACE(class,"%x %s %x\n",hwnd, debugstr_w(buffer), count);
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -91,6 +91,8 @@ DCE *DCE_AllocDCE( HWND hWnd, DCE_TYPE type )
|
|||
|
||||
if( wnd->dwStyle & WS_CLIPCHILDREN ) dce->DCXflags |= DCX_CLIPCHILDREN;
|
||||
if( wnd->dwStyle & WS_CLIPSIBLINGS ) dce->DCXflags |= DCX_CLIPSIBLINGS;
|
||||
|
||||
WIN_ReleaseWndPtr(wnd);
|
||||
}
|
||||
SetHookFlags16(dce->hDC,DCHF_INVALIDATEVISRGN);
|
||||
}
|
||||
|
@ -248,14 +250,18 @@ BOOL DCE_InvalidateDCE(WND* pWnd, const RECT* pRectUpdate)
|
|||
|
||||
if( wndCurrent && wndCurrent != WIN_GetDesktop() )
|
||||
{
|
||||
WND* wnd = wndCurrent;
|
||||
WND* wnd = NULL;
|
||||
INT xoffset = 0, yoffset = 0;
|
||||
|
||||
if( (wndCurrent == wndScope) && !(dce->DCXflags & DCX_CLIPCHILDREN) ) continue;
|
||||
if( (wndCurrent == wndScope) && !(dce->DCXflags & DCX_CLIPCHILDREN) )
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndCurrent);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* check if DCE window is within the z-order scope */
|
||||
|
||||
for( wnd = wndCurrent; wnd; wnd = wnd->parent )
|
||||
for( wnd = WIN_LockWndPtr(wndCurrent); wnd; WIN_UpdateWndPtr(&wnd,wnd->parent))
|
||||
{
|
||||
if( wnd == wndScope )
|
||||
{
|
||||
|
@ -298,6 +304,8 @@ BOOL DCE_InvalidateDCE(WND* pWnd, const RECT* pRectUpdate)
|
|||
yoffset += wnd->rectClient.top;
|
||||
}
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndCurrent);
|
||||
WIN_ReleaseDesktop();
|
||||
}
|
||||
} /* dce list */
|
||||
}
|
||||
|
@ -338,10 +346,13 @@ static BOOL DCE_GetVisRect( WND *wndPtr, BOOL clientArea, RECT *lprect )
|
|||
|
||||
while (wndPtr->dwStyle & WS_CHILD)
|
||||
{
|
||||
wndPtr = wndPtr->parent;
|
||||
wndPtr = WIN_LockWndPtr(wndPtr->parent);
|
||||
|
||||
if ( (wndPtr->dwStyle & (WS_ICONIC | WS_VISIBLE)) != WS_VISIBLE )
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
xoffset += wndPtr->rectClient.left;
|
||||
yoffset += wndPtr->rectClient.top;
|
||||
|
@ -354,12 +365,17 @@ static BOOL DCE_GetVisRect( WND *wndPtr, BOOL clientArea, RECT *lprect )
|
|||
(lprect->right <= wndPtr->rectClient.left) ||
|
||||
(lprect->top >= wndPtr->rectClient.bottom) ||
|
||||
(lprect->bottom <= wndPtr->rectClient.top) )
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
lprect->left = MAX( lprect->left, wndPtr->rectClient.left );
|
||||
lprect->right = MIN( lprect->right, wndPtr->rectClient.right );
|
||||
lprect->top = MAX( lprect->top, wndPtr->rectClient.top );
|
||||
lprect->bottom = MIN( lprect->bottom, wndPtr->rectClient.bottom );
|
||||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
OffsetRect( lprect, -xoffset, -yoffset );
|
||||
return TRUE;
|
||||
|
@ -386,9 +402,13 @@ static BOOL DCE_AddClipRects( WND *pWndStart, WND *pWndEnd,
|
|||
if( pWndStart->pDriver->pIsSelfClipping( pWndStart ) )
|
||||
return TRUE; /* The driver itself will do the clipping */
|
||||
|
||||
for (; pWndStart != pWndEnd; pWndStart = pWndStart->next)
|
||||
for (; pWndStart != pWndEnd; pWndStart = WIN_LockWndPtr(pWndStart->next))
|
||||
{
|
||||
if( !(pWndStart->dwStyle & WS_VISIBLE) ) continue;
|
||||
if( !(pWndStart->dwStyle & WS_VISIBLE) )
|
||||
{
|
||||
WIN_ReleaseWndPtr(pWndStart);
|
||||
continue;
|
||||
}
|
||||
|
||||
rect.left = pWndStart->rectWindow.left + x;
|
||||
rect.top = pWndStart->rectWindow.top + y;
|
||||
|
@ -397,7 +417,11 @@ static BOOL DCE_AddClipRects( WND *pWndStart, WND *pWndEnd,
|
|||
|
||||
if( IntersectRect( &rect, &rect, lpRect ))
|
||||
if(!REGION_UnionRectWithRgn( hrgnClip, &rect ))
|
||||
{
|
||||
WIN_ReleaseWndPtr(pWndStart);
|
||||
break;
|
||||
}
|
||||
WIN_ReleaseWndPtr(pWndStart);
|
||||
}
|
||||
return (pWndStart == pWndEnd);
|
||||
}
|
||||
|
@ -500,7 +524,7 @@ HRGN DCE_GetVisRgn( HWND hwnd, WORD flags, HWND hwndChild, WORD cflags )
|
|||
|
||||
while (wndPtr->dwStyle & WS_CHILD)
|
||||
{
|
||||
wndPtr = wndPtr->parent;
|
||||
WIN_UpdateWndPtr(&wndPtr,wndPtr->parent);
|
||||
xoffset -= wndPtr->rectClient.left;
|
||||
yoffset -= wndPtr->rectClient.top;
|
||||
if(wndPtr->dwStyle & WS_CLIPSIBLINGS && wndPtr->parent)
|
||||
|
@ -526,6 +550,8 @@ HRGN DCE_GetVisRgn( HWND hwnd, WORD flags, HWND hwndChild, WORD cflags )
|
|||
}
|
||||
else
|
||||
hrgnVis = CreateRectRgn(0, 0, 0, 0); /* empty */
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
WIN_ReleaseWndPtr(childWnd);
|
||||
return hrgnVis;
|
||||
}
|
||||
|
||||
|
@ -565,6 +591,7 @@ INT16 DCE_ExcludeRgn( HDC hDC, WND* wnd, HRGN hRgn )
|
|||
wnd = WIN_FindWndPtr(dce->hwndCurrent);
|
||||
pt.x += wnd->rectClient.left - wnd->rectWindow.left;
|
||||
pt.y += wnd->rectClient.top - wnd->rectWindow.top;
|
||||
WIN_ReleaseWndPtr(wnd);
|
||||
}
|
||||
}
|
||||
else return ERROR;
|
||||
|
@ -719,14 +746,22 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
|
|||
}
|
||||
}
|
||||
}
|
||||
if (!dce) return 0;
|
||||
if (!dce)
|
||||
{
|
||||
hdc = 0;
|
||||
goto END;
|
||||
}
|
||||
|
||||
dce->hwndCurrent = hwnd;
|
||||
dce->hClipRgn = 0;
|
||||
dce->DCXflags = dcxFlags | (flags & DCX_WINDOWPAINT) | DCX_DCEBUSY;
|
||||
hdc = dce->hDC;
|
||||
|
||||
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC ))) return 0;
|
||||
if (!(dc = (DC *) GDI_GetObjPtr( hdc, DC_MAGIC )))
|
||||
{
|
||||
hdc = 0;
|
||||
goto END;
|
||||
}
|
||||
bUpdateVisRgn = bUpdateVisRgn || (dc->w.flags & DC_DIRTY);
|
||||
|
||||
/* recompute visible region */
|
||||
|
@ -738,7 +773,7 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
|
|||
|
||||
if (flags & DCX_PARENTCLIP)
|
||||
{
|
||||
WND *parentPtr = wndPtr->parent;
|
||||
WND *parentPtr = WIN_LockWndPtr(wndPtr->parent);
|
||||
|
||||
if( wndPtr->dwStyle & WS_VISIBLE && !(parentPtr->dwStyle & WS_MINIMIZE) )
|
||||
{
|
||||
|
@ -759,6 +794,7 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
|
|||
}
|
||||
else
|
||||
hrgnVisible = CreateRectRgn( 0, 0, 0, 0 );
|
||||
WIN_ReleaseWndPtr(parentPtr);
|
||||
}
|
||||
else
|
||||
if ((hwnd == GetDesktopWindow()) &&
|
||||
|
@ -801,6 +837,8 @@ HDC WINAPI GetDCEx( HWND hwnd, HRGN hrgnClip, DWORD flags )
|
|||
|
||||
TRACE(dc, "(%04x,%04x,0x%lx): returning %04x\n",
|
||||
hwnd, hrgnClip, flags, hdc);
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return hdc;
|
||||
}
|
||||
|
||||
|
|
|
@ -215,6 +215,7 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam,
|
|||
SendMessageA( wnd->parent->hwndSelf,
|
||||
CB_SHOWDROPDOWN, FALSE, 0 );
|
||||
}
|
||||
WIN_ReleaseWndPtr(wnd);
|
||||
}
|
||||
}
|
||||
return DefWindowProcA( hwnd, msg, wParam, lParam );
|
||||
|
@ -287,6 +288,7 @@ LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
|
|||
case WM_ENTERMENULOOP:
|
||||
case WM_LBUTTONDOWN:
|
||||
case WM_NCLBUTTONDOWN:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return DEFDLG_Proc( (HWND)hwnd, msg,
|
||||
(WPARAM)wParam, lParam, dlgInfo );
|
||||
case WM_INITDIALOG:
|
||||
|
@ -296,9 +298,11 @@ LRESULT WINAPI DefDlgProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
|
|||
break;
|
||||
|
||||
default:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return DefWindowProc16( hwnd, msg, wParam, lParam );
|
||||
}
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return DEFDLG_Epilog(dlgInfo, msg, result);
|
||||
}
|
||||
|
||||
|
@ -344,6 +348,7 @@ LRESULT WINAPI DefDlgProcA( HWND hwnd, UINT msg,
|
|||
case WM_ENTERMENULOOP:
|
||||
case WM_LBUTTONDOWN:
|
||||
case WM_NCLBUTTONDOWN:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return DEFDLG_Proc( (HWND)hwnd, msg,
|
||||
(WPARAM)wParam, lParam, dlgInfo );
|
||||
case WM_INITDIALOG:
|
||||
|
@ -353,9 +358,11 @@ LRESULT WINAPI DefDlgProcA( HWND hwnd, UINT msg,
|
|||
break;
|
||||
|
||||
default:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return DefWindowProcA( hwnd, msg, wParam, lParam );
|
||||
}
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return DEFDLG_Epilog(dlgInfo, msg, result);
|
||||
}
|
||||
|
||||
|
@ -401,6 +408,7 @@ LRESULT WINAPI DefDlgProcW( HWND hwnd, UINT msg, WPARAM wParam,
|
|||
case WM_ENTERMENULOOP:
|
||||
case WM_LBUTTONDOWN:
|
||||
case WM_NCLBUTTONDOWN:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return DEFDLG_Proc( (HWND)hwnd, msg,
|
||||
(WPARAM)wParam, lParam, dlgInfo );
|
||||
case WM_INITDIALOG:
|
||||
|
@ -410,8 +418,10 @@ LRESULT WINAPI DefDlgProcW( HWND hwnd, UINT msg, WPARAM wParam,
|
|||
break;
|
||||
|
||||
default:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return DefWindowProcW( hwnd, msg, wParam, lParam );
|
||||
}
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return DEFDLG_Epilog(dlgInfo, msg, result);
|
||||
}
|
||||
|
|
|
@ -306,6 +306,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
|
|||
wndPtr = WIN_FindWndPtr( hWnd );
|
||||
if( wndPtr && !(wndPtr->class->style & CS_NOCLOSE) )
|
||||
PostMessage16( hWnd, WM_SYSCOMMAND, SC_CLOSE, 0 );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
}
|
||||
else if( wParam == VK_F10 )
|
||||
|
@ -358,6 +359,7 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
|
|||
case WM_CANCELMODE:
|
||||
if (wndPtr->parent == WIN_GetDesktop()) EndMenu();
|
||||
if (GetCapture() == wndPtr->hwndSelf) ReleaseCapture();
|
||||
WIN_ReleaseDesktop();
|
||||
break;
|
||||
|
||||
case WM_VKEYTOITEM:
|
||||
|
@ -458,6 +460,7 @@ LRESULT WINAPI DefWindowProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam,
|
|||
break;
|
||||
}
|
||||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
SPY_ExitMessage( SPY_RESULT_DEFWND16, hwnd, msg, result );
|
||||
return result;
|
||||
}
|
||||
|
@ -520,6 +523,7 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam,
|
|||
break;
|
||||
}
|
||||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
SPY_ExitMessage( SPY_RESULT_DEFWND, hwnd, msg, result );
|
||||
return result;
|
||||
}
|
||||
|
@ -553,6 +557,7 @@ LRESULT WINAPI DefWindowProcW(
|
|||
LPSTR str = HEAP_strdupWtoA(GetProcessHeap(), 0, cs->lpszName);
|
||||
DEFWND_SetText( wndPtr, str );
|
||||
HeapFree( GetProcessHeap(), 0, str );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
result = 1;
|
||||
}
|
||||
|
|
156
windows/dialog.c
156
windows/dialog.c
|
@ -707,9 +707,10 @@ HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCSTR dlgTemplate,
|
|||
ShowWindow( hwnd, SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */
|
||||
UpdateWindow( hwnd );
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return hwnd;
|
||||
}
|
||||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
if( IsWindow(hwnd) ) DestroyWindow( hwnd );
|
||||
return 0;
|
||||
}
|
||||
|
@ -874,6 +875,7 @@ INT DIALOG_DoDialogBox( HWND hwnd, HWND owner )
|
|||
EnableWindow( owner, TRUE );
|
||||
}
|
||||
retval = dlgInfo->idResult;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
DestroyWindow( hwnd );
|
||||
return retval;
|
||||
}
|
||||
|
@ -1005,6 +1007,7 @@ BOOL WINAPI EndDialog( HWND hwnd, INT retval )
|
|||
dlgInfo->idResult = retval;
|
||||
dlgInfo->flags |= DF_END;
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -1086,6 +1089,7 @@ static BOOL DIALOG_IsAccelerator( HWND hwnd, HWND hwndDlg, WPARAM vKey )
|
|||
{
|
||||
hwndNext = 0;
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
if (!hwndNext)
|
||||
{
|
||||
hwndNext = GetWindow( hwndControl, GW_HWNDNEXT );
|
||||
|
@ -1294,8 +1298,13 @@ BOOL WINAPI IsDialogMessageW( HWND hwndDlg, LPMSG msg )
|
|||
INT16 WINAPI GetDlgCtrlID16( HWND16 hwnd )
|
||||
{
|
||||
WND *wndPtr = WIN_FindWndPtr(hwnd);
|
||||
if (wndPtr) return wndPtr->wIDmenu;
|
||||
else return 0;
|
||||
INT16 retvalue;
|
||||
|
||||
if (!wndPtr) return 0;
|
||||
|
||||
retvalue = wndPtr->wIDmenu;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1304,9 +1313,12 @@ INT16 WINAPI GetDlgCtrlID16( HWND16 hwnd )
|
|||
*/
|
||||
INT WINAPI GetDlgCtrlID( HWND hwnd )
|
||||
{
|
||||
INT retvalue;
|
||||
WND *wndPtr = WIN_FindWndPtr(hwnd);
|
||||
if (wndPtr) return wndPtr->wIDmenu;
|
||||
else return 0;
|
||||
if (!wndPtr) return 0;
|
||||
retvalue = wndPtr->wIDmenu;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1318,8 +1330,13 @@ HWND16 WINAPI GetDlgItem16( HWND16 hwndDlg, INT16 id )
|
|||
WND *pWnd;
|
||||
|
||||
if (!(pWnd = WIN_FindWndPtr( hwndDlg ))) return 0;
|
||||
for (pWnd = pWnd->child; pWnd; pWnd = pWnd->next)
|
||||
if (pWnd->wIDmenu == (UINT16)id) return pWnd->hwndSelf;
|
||||
for (WIN_UpdateWndPtr(&pWnd,pWnd->child); pWnd; WIN_UpdateWndPtr(&pWnd,pWnd->next))
|
||||
if (pWnd->wIDmenu == (UINT16)id)
|
||||
{
|
||||
HWND16 retvalue = pWnd->hwndSelf;
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
return retvalue;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1332,8 +1349,13 @@ HWND WINAPI GetDlgItem( HWND hwndDlg, INT id )
|
|||
WND *pWnd;
|
||||
|
||||
if (!(pWnd = WIN_FindWndPtr( hwndDlg ))) return 0;
|
||||
for (pWnd = pWnd->child; pWnd; pWnd = pWnd->next)
|
||||
if (pWnd->wIDmenu == (UINT16)id) return pWnd->hwndSelf;
|
||||
for (WIN_UpdateWndPtr(&pWnd,pWnd->child); pWnd;WIN_UpdateWndPtr(&pWnd,pWnd->next))
|
||||
if (pWnd->wIDmenu == (UINT16)id)
|
||||
{
|
||||
HWND retvalue = pWnd->hwndSelf;
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
return retvalue;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1570,8 +1592,12 @@ BOOL WINAPI CheckRadioButton( HWND hwndDlg, UINT firstID,
|
|||
WND *pWnd = WIN_FindWndPtr( hwndDlg );
|
||||
if (!pWnd) return FALSE;
|
||||
|
||||
for (pWnd = pWnd->child; pWnd; pWnd = pWnd->next)
|
||||
if ((pWnd->wIDmenu == firstID) || (pWnd->wIDmenu == lastID)) break;
|
||||
for (WIN_UpdateWndPtr(&pWnd,pWnd->child); pWnd;WIN_UpdateWndPtr(&pWnd,pWnd->next))
|
||||
if ((pWnd->wIDmenu == firstID) || (pWnd->wIDmenu == lastID))
|
||||
{
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
break;
|
||||
}
|
||||
if (!pWnd) return FALSE;
|
||||
|
||||
if (pWnd->wIDmenu == lastID)
|
||||
|
@ -1580,8 +1606,12 @@ BOOL WINAPI CheckRadioButton( HWND hwndDlg, UINT firstID,
|
|||
{
|
||||
SendMessageA( pWnd->hwndSelf, BM_SETCHECK,
|
||||
(pWnd->wIDmenu == checkID), 0 );
|
||||
if (pWnd->wIDmenu == lastID) break;
|
||||
pWnd = pWnd->next;
|
||||
if (pWnd->wIDmenu == lastID)
|
||||
{
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
break;
|
||||
}
|
||||
WIN_UpdateWndPtr(&pWnd,pWnd->next);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -1609,6 +1639,7 @@ void WINAPI MapDialogRect16( HWND16 hwnd, LPRECT16 rect )
|
|||
rect->right = (rect->right * dlgInfo->xBaseUnit) / 4;
|
||||
rect->top = (rect->top * dlgInfo->yBaseUnit) / 8;
|
||||
rect->bottom = (rect->bottom * dlgInfo->yBaseUnit) / 8;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1625,6 +1656,7 @@ BOOL WINAPI MapDialogRect( HWND hwnd, LPRECT rect )
|
|||
rect->right = (rect->right * dlgInfo->xBaseUnit) / 4;
|
||||
rect->top = (rect->top * dlgInfo->yBaseUnit) / 8;
|
||||
rect->bottom = (rect->bottom * dlgInfo->yBaseUnit) / 8;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -1645,33 +1677,51 @@ HWND16 WINAPI GetNextDlgGroupItem16( HWND16 hwndDlg, HWND16 hwndCtrl,
|
|||
HWND WINAPI GetNextDlgGroupItem( HWND hwndDlg, HWND hwndCtrl,
|
||||
BOOL fPrevious )
|
||||
{
|
||||
WND *pWnd, *pWndLast, *pWndCtrl, *pWndDlg;
|
||||
WND *pWnd = NULL,
|
||||
*pWndLast = NULL,
|
||||
*pWndCtrl = NULL,
|
||||
*pWndDlg = NULL;
|
||||
HWND retvalue;
|
||||
|
||||
if (!(pWndDlg = WIN_FindWndPtr( hwndDlg ))) return 0;
|
||||
if (hwndCtrl)
|
||||
{
|
||||
if (!(pWndCtrl = WIN_FindWndPtr( hwndCtrl ))) return 0;
|
||||
if (!(pWndCtrl = WIN_FindWndPtr( hwndCtrl )))
|
||||
{
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
}
|
||||
/* Make sure hwndCtrl is a top-level child */
|
||||
while ((pWndCtrl->dwStyle & WS_CHILD) && (pWndCtrl->parent != pWndDlg))
|
||||
pWndCtrl = pWndCtrl->parent;
|
||||
if (pWndCtrl->parent != pWndDlg) return 0;
|
||||
WIN_UpdateWndPtr(&pWndCtrl,pWndCtrl->parent);
|
||||
if (pWndCtrl->parent != pWndDlg)
|
||||
{
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No ctrl specified -> start from the beginning */
|
||||
if (!(pWndCtrl = pWndDlg->child)) return 0;
|
||||
if (fPrevious) while (pWndCtrl->next) pWndCtrl = pWndCtrl->next;
|
||||
if (!(pWndCtrl = WIN_LockWndPtr(pWndDlg->child)))
|
||||
{
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
}
|
||||
if (fPrevious)
|
||||
while (pWndCtrl->next) WIN_UpdateWndPtr(&pWndCtrl,pWndCtrl->next);
|
||||
}
|
||||
|
||||
pWndLast = pWndCtrl;
|
||||
pWnd = pWndCtrl->next;
|
||||
pWndLast = WIN_LockWndPtr(pWndCtrl);
|
||||
pWnd = WIN_LockWndPtr(pWndCtrl->next);
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (!pWnd || (pWnd->dwStyle & WS_GROUP))
|
||||
{
|
||||
/* Wrap-around to the beginning of the group */
|
||||
WND *pWndStart = pWndDlg->child;
|
||||
for (pWnd = pWndStart; pWnd; pWnd = pWnd->next)
|
||||
WND *pWndStart = WIN_LockWndPtr(pWndDlg->child);
|
||||
for (WIN_UpdateWndPtr(&pWnd,pWndStart); pWnd;WIN_UpdateWndPtr(&pWnd,pWnd->next))
|
||||
{
|
||||
if (pWnd->dwStyle & WS_GROUP) pWndStart = pWnd;
|
||||
if (pWnd == pWndCtrl) break;
|
||||
|
@ -1681,12 +1731,20 @@ HWND WINAPI GetNextDlgGroupItem( HWND hwndDlg, HWND hwndCtrl,
|
|||
if (pWnd == pWndCtrl) break;
|
||||
if ((pWnd->dwStyle & WS_VISIBLE) && !(pWnd->dwStyle & WS_DISABLED))
|
||||
{
|
||||
pWndLast = pWnd;
|
||||
WIN_UpdateWndPtr(&pWndLast,pWnd);
|
||||
if (!fPrevious) break;
|
||||
}
|
||||
pWnd = pWnd->next;
|
||||
WIN_UpdateWndPtr(&pWnd,pWnd->next);
|
||||
}
|
||||
return pWndLast->hwndSelf;
|
||||
retvalue = pWndLast->hwndSelf;
|
||||
|
||||
WIN_ReleaseWndPtr(pWndLast);
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
END:
|
||||
WIN_ReleaseWndPtr(pWndCtrl);
|
||||
WIN_ReleaseWndPtr(pWndDlg);
|
||||
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1706,39 +1764,61 @@ HWND16 WINAPI GetNextDlgTabItem16( HWND16 hwndDlg, HWND16 hwndCtrl,
|
|||
HWND WINAPI GetNextDlgTabItem( HWND hwndDlg, HWND hwndCtrl,
|
||||
BOOL fPrevious )
|
||||
{
|
||||
WND *pWnd, *pWndLast, *pWndCtrl, *pWndDlg;
|
||||
WND *pWnd = NULL,
|
||||
*pWndLast = NULL,
|
||||
*pWndCtrl = NULL,
|
||||
*pWndDlg = NULL;
|
||||
HWND retvalue;
|
||||
|
||||
if (!(pWndDlg = WIN_FindWndPtr( hwndDlg ))) return 0;
|
||||
if (hwndCtrl)
|
||||
{
|
||||
if (!(pWndCtrl = WIN_FindWndPtr( hwndCtrl ))) return 0;
|
||||
if (!(pWndCtrl = WIN_FindWndPtr( hwndCtrl )))
|
||||
{
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
}
|
||||
/* Make sure hwndCtrl is a top-level child */
|
||||
while ((pWndCtrl->dwStyle & WS_CHILD) && (pWndCtrl->parent != pWndDlg))
|
||||
pWndCtrl = pWndCtrl->parent;
|
||||
if (pWndCtrl->parent != pWndDlg) return 0;
|
||||
WIN_UpdateWndPtr(&pWndCtrl,pWndCtrl->parent);
|
||||
if (pWndCtrl->parent != pWndDlg)
|
||||
{
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No ctrl specified -> start from the beginning */
|
||||
if (!(pWndCtrl = pWndDlg->child)) return 0;
|
||||
if (!fPrevious) while (pWndCtrl->next) pWndCtrl = pWndCtrl->next;
|
||||
if (!(pWndCtrl = WIN_LockWndPtr(pWndDlg->child))) return 0;
|
||||
if (!fPrevious)
|
||||
while (pWndCtrl->next) WIN_UpdateWndPtr(&pWndCtrl,pWndCtrl->next);
|
||||
}
|
||||
|
||||
pWndLast = pWndCtrl;
|
||||
pWnd = pWndCtrl->next;
|
||||
pWndLast = WIN_LockWndPtr(pWndCtrl);
|
||||
pWnd = WIN_LockWndPtr(pWndCtrl->next);
|
||||
while (1)
|
||||
{
|
||||
if (!pWnd) pWnd = pWndDlg->child;
|
||||
if (!pWnd) pWnd = WIN_LockWndPtr(pWndDlg->child);
|
||||
if (pWnd == pWndCtrl) break;
|
||||
if ((pWnd->dwStyle & WS_TABSTOP) && (pWnd->dwStyle & WS_VISIBLE) &&
|
||||
!(pWnd->dwStyle & WS_DISABLED))
|
||||
{
|
||||
pWndLast = pWnd;
|
||||
WIN_UpdateWndPtr(&pWndLast,pWnd);
|
||||
if (!fPrevious) break;
|
||||
}
|
||||
pWnd = pWnd->next;
|
||||
WIN_UpdateWndPtr(&pWnd,pWnd->next);
|
||||
}
|
||||
return pWndLast->hwndSelf;
|
||||
retvalue = pWndLast->hwndSelf;
|
||||
|
||||
WIN_ReleaseWndPtr(pWndLast);
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
END:
|
||||
WIN_ReleaseWndPtr(pWndCtrl);
|
||||
WIN_ReleaseWndPtr(pWndDlg);
|
||||
|
||||
return retvalue;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -892,6 +892,7 @@ static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE2A iface)
|
|||
|
||||
/* This stores the current mouse handler.
|
||||
FIXME : need to be fixed for native USER use */
|
||||
WND *tempWnd = 0;
|
||||
This->prev_handler = mouse_event;
|
||||
|
||||
/* Store (in a global variable) the current lock */
|
||||
|
|
|
@ -34,13 +34,17 @@ void FOCUS_SwitchFocus( MESSAGEQUEUE *pMsgQ, HWND hFocusFrom, HWND hFocusTo )
|
|||
#endif
|
||||
|
||||
if( !pFocusTo || hFocusTo != PERQDATA_GetFocusWnd( pMsgQ->pQData ) )
|
||||
{
|
||||
WIN_ReleaseWndPtr(pFocusTo);
|
||||
return;
|
||||
}
|
||||
|
||||
/* According to API docs, the WM_SETFOCUS message is sent AFTER the window
|
||||
has received the keyboard focus. */
|
||||
|
||||
pFocusTo->pDriver->pSetFocus(pFocusTo);
|
||||
|
||||
WIN_ReleaseWndPtr(pFocusTo);
|
||||
#if 0
|
||||
SendMessageA( hFocusTo, WM_SETFOCUS, hFocusFrom, 0 );
|
||||
#else
|
||||
|
@ -154,6 +158,7 @@ CLEANUP:
|
|||
if ( pCurMsgQ )
|
||||
QUEUE_Unlock( pCurMsgQ );
|
||||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return bRet ? hWndFocus : 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -335,6 +335,7 @@ HWND EVENT_Capture(HWND hwnd, INT16 ht)
|
|||
WND* wndPtr = WIN_FindWndPtr( capturePrev );
|
||||
if( wndPtr && (wndPtr->flags & WIN_ISWIN32) )
|
||||
SendMessageA( capturePrev, WM_CAPTURECHANGED, 0L, hwnd);
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -345,6 +346,7 @@ CLEANUP:
|
|||
if ( pCurMsgQ )
|
||||
QUEUE_Unlock( pCurMsgQ );
|
||||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return capturePrev;
|
||||
}
|
||||
|
||||
|
@ -598,6 +600,8 @@ static BOOL KBD_translate_accelerator(HWND hWnd,LPMSG msg,
|
|||
iStat = (hMenu) ? GetMenuState(hMenu,
|
||||
cmd, MF_BYCOMMAND) : -1 ;
|
||||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
|
||||
if (iSysStat!=-1)
|
||||
{
|
||||
if (iSysStat & (MF_DISABLED|MF_GRAYED))
|
||||
|
|
275
windows/mdi.c
275
windows/mdi.c
|
@ -76,7 +76,11 @@ static BOOL MDI_MenuModifyItem(WND* clientWnd, HWND hWndChild )
|
|||
wndPtr->wIDmenu - clientInfo->idFirstChild + 1);
|
||||
BOOL bRet = 0;
|
||||
|
||||
if( !clientInfo->hWindowMenu ) return 0;
|
||||
if( !clientInfo->hWindowMenu )
|
||||
{
|
||||
bRet = FALSE;
|
||||
goto END;
|
||||
}
|
||||
|
||||
if (wndPtr->text) lstrcpynA(buffer + n, wndPtr->text, sizeof(buffer) - n );
|
||||
|
||||
|
@ -84,6 +88,8 @@ static BOOL MDI_MenuModifyItem(WND* clientWnd, HWND hWndChild )
|
|||
bRet = ModifyMenuA(clientInfo->hWindowMenu , wndPtr->wIDmenu,
|
||||
MF_BYCOMMAND | MF_STRING, wndPtr->wIDmenu, buffer );
|
||||
CheckMenuItem(clientInfo->hWindowMenu ,wndPtr->wIDmenu , n & MF_CHECKED);
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return bRet;
|
||||
}
|
||||
|
||||
|
@ -96,9 +102,14 @@ static BOOL MDI_MenuDeleteItem(WND* clientWnd, HWND hWndChild )
|
|||
MDICLIENTINFO *clientInfo = (MDICLIENTINFO*)clientWnd->wExtra;
|
||||
WND *wndPtr = WIN_FindWndPtr(hWndChild);
|
||||
UINT index = 0,id,n;
|
||||
BOOL retvalue;
|
||||
|
||||
if( !clientInfo->nActiveChildren ||
|
||||
!clientInfo->hWindowMenu ) return 0;
|
||||
!clientInfo->hWindowMenu )
|
||||
{
|
||||
retvalue = FALSE;
|
||||
goto END;
|
||||
}
|
||||
|
||||
id = wndPtr->wIDmenu;
|
||||
DeleteMenu(clientInfo->hWindowMenu,id,MF_BYCOMMAND);
|
||||
|
@ -127,7 +138,10 @@ static BOOL MDI_MenuDeleteItem(WND* clientWnd, HWND hWndChild )
|
|||
ModifyMenuA(clientInfo->hWindowMenu ,index ,MF_BYCOMMAND | MF_STRING,
|
||||
index - 1 , buffer );
|
||||
}
|
||||
return 1;
|
||||
retvalue = TRUE;
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
@ -146,9 +160,9 @@ static HWND MDI_GetWindow(WND *clientWnd, HWND hWnd, BOOL bNext,
|
|||
|
||||
if( !(wndPtr = WIN_FindWndPtr(hWnd)) ) return 0;
|
||||
|
||||
for ( pWnd = wndPtr->next; ; pWnd = pWnd->next )
|
||||
for ( pWnd = WIN_LockWndPtr(wndPtr->next); ; WIN_UpdateWndPtr(&pWnd,pWnd->next))
|
||||
{
|
||||
if (!pWnd ) pWnd = wndPtr->parent->child;
|
||||
if (!pWnd ) WIN_UpdateWndPtr(&pWnd,wndPtr->parent->child);
|
||||
|
||||
if ( pWnd == wndPtr ) break; /* went full circle */
|
||||
|
||||
|
@ -158,6 +172,8 @@ static HWND MDI_GetWindow(WND *clientWnd, HWND hWnd, BOOL bNext,
|
|||
if ( bNext ) break;
|
||||
}
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
return pWndLast ? pWndLast->hwndSelf : 0;
|
||||
}
|
||||
|
||||
|
@ -243,8 +259,10 @@ static LRESULT MDISetMenu( HWND hwnd, HMENU hmenuFrame,
|
|||
SetMenu(hwndFrame, hmenuFrame);
|
||||
if( ci->hwndChildMaximized )
|
||||
MDI_AugmentFrameMenu(ci, w->parent, ci->hwndChildMaximized );
|
||||
WIN_ReleaseWndPtr(w);
|
||||
return oldFrameMenu;
|
||||
}
|
||||
WIN_ReleaseWndPtr(w);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -385,6 +403,7 @@ static HWND MDICreateChild( WND *w, MDICLIENTINFO *ci, HWND parent,
|
|||
SetWindowPos( hwnd, 0, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE );
|
||||
|
||||
}
|
||||
WIN_ReleaseWndPtr(wnd);
|
||||
TRACE(mdi, "created child - %04x\n",hwnd);
|
||||
}
|
||||
else
|
||||
|
@ -420,8 +439,11 @@ static void MDI_ChildGetMinMaxInfo( WND* clientWnd, HWND hwnd,
|
|||
lpMinMax->ptMaxPosition.x = rect.left;
|
||||
lpMinMax->ptMaxPosition.y = rect.top;
|
||||
|
||||
WIN_ReleaseWndPtr(childWnd);
|
||||
|
||||
TRACE(mdi,"max rect (%i,%i - %i, %i)\n",
|
||||
rect.left,rect.top,rect.right,rect.bottom);
|
||||
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
@ -444,7 +466,7 @@ static void MDI_SwitchActiveChild( HWND clientHwnd, HWND childHwnd,
|
|||
|
||||
TRACE(mdi, "from %04x, to %04x\n",childHwnd,hwndTo);
|
||||
|
||||
if ( !hwndTo ) return; /* no window to switch to */
|
||||
if ( !hwndTo ) goto END; /* no window to switch to */
|
||||
|
||||
hwndPrev = ci->hwndActiveChild;
|
||||
|
||||
|
@ -467,6 +489,8 @@ static void MDI_SwitchActiveChild( HWND clientHwnd, HWND childHwnd,
|
|||
if( bOptimize )
|
||||
ShowWindow( clientHwnd, SW_SHOW );
|
||||
}
|
||||
END:
|
||||
WIN_ReleaseWndPtr(w);
|
||||
}
|
||||
|
||||
|
||||
|
@ -499,6 +523,7 @@ static LRESULT MDIDestroyChild( WND *w_parent, MDICLIENTINFO *ci,
|
|||
}
|
||||
MDI_MenuDeleteItem(w_parent, child);
|
||||
}
|
||||
WIN_ReleaseWndPtr(childPtr);
|
||||
|
||||
ci->nActiveChildren--;
|
||||
|
||||
|
@ -527,11 +552,22 @@ static LONG MDI_ChildActivate( WND *clientPtr, HWND hWndChild )
|
|||
WND *wndPtr = WIN_FindWndPtr( hWndChild );
|
||||
WND *wndPrev = WIN_FindWndPtr( prevActiveWnd );
|
||||
BOOL isActiveFrameWnd = 0;
|
||||
LONG retvalue;
|
||||
|
||||
if( hWndChild == prevActiveWnd ) return 0L;
|
||||
if( hWndChild == prevActiveWnd )
|
||||
{
|
||||
retvalue = 0L;
|
||||
goto END;
|
||||
}
|
||||
|
||||
if( wndPtr )
|
||||
if( wndPtr->dwStyle & WS_DISABLED ) return 0L;
|
||||
{
|
||||
if( wndPtr->dwStyle & WS_DISABLED )
|
||||
{
|
||||
retvalue = 0L;
|
||||
goto END;
|
||||
}
|
||||
}
|
||||
|
||||
TRACE(mdi,"%04x\n", hWndChild);
|
||||
|
||||
|
@ -570,7 +606,8 @@ static LONG MDI_ChildActivate( WND *clientPtr, HWND hWndChild )
|
|||
{
|
||||
if( isActiveFrameWnd )
|
||||
SetFocus( clientInfo->self );
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
}
|
||||
|
||||
/* check menu item */
|
||||
|
@ -592,7 +629,10 @@ static LONG MDI_ChildActivate( WND *clientPtr, HWND hWndChild )
|
|||
}
|
||||
SendMessageA( hWndChild, WM_MDIACTIVATE, (WPARAM)prevActiveWnd,
|
||||
(LPARAM)hWndChild );
|
||||
return 1;
|
||||
retvalue = 1;
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
WIN_ReleaseWndPtr(wndPrev);
|
||||
}
|
||||
|
||||
/* -------------------- MDI client window functions ------------------- */
|
||||
|
@ -766,7 +806,12 @@ static BOOL MDI_AugmentFrameMenu( MDICLIENTINFO* ci, WND *frame,
|
|||
|
||||
TRACE(mdi,"frame %p,child %04x\n",frame,hChild);
|
||||
|
||||
if( !frame->wIDmenu || !child->hSysMenu ) return 0;
|
||||
if( !frame->wIDmenu || !child->hSysMenu )
|
||||
{
|
||||
WIN_ReleaseWndPtr(child);
|
||||
return 0;
|
||||
}
|
||||
WIN_ReleaseWndPtr(child);
|
||||
|
||||
/* create a copy of sysmenu popup and insert it into frame menu bar */
|
||||
|
||||
|
@ -856,6 +901,7 @@ static void MDI_UpdateFrameText( WND *frameWnd, HWND hClient,
|
|||
|
||||
if (!clientWnd)
|
||||
return;
|
||||
WIN_ReleaseWndPtr(clientWnd);
|
||||
|
||||
if (!ci)
|
||||
return;
|
||||
|
@ -897,6 +943,7 @@ static void MDI_UpdateFrameText( WND *frameWnd, HWND hClient,
|
|||
strcat( lpBuffer, "]" );
|
||||
}
|
||||
}
|
||||
WIN_ReleaseWndPtr(childWnd);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -929,8 +976,9 @@ LRESULT WINAPI MDIClientWndProc( HWND hwnd, UINT message, WPARAM wParam,
|
|||
MDICLIENTINFO *ci;
|
||||
RECT rect;
|
||||
WND *w = WIN_FindWndPtr(hwnd);
|
||||
WND *frameWnd = w->parent;
|
||||
WND *frameWnd = WIN_LockWndPtr(w->parent);
|
||||
INT nItems;
|
||||
LRESULT retvalue;
|
||||
|
||||
ci = (MDICLIENTINFO *) w->wExtra;
|
||||
|
||||
|
@ -982,7 +1030,8 @@ LRESULT WINAPI MDIClientWndProc( HWND hwnd, UINT message, WPARAM wParam,
|
|||
TRACE(mdi,"Client created - hwnd = %04x, idFirst = %u\n",
|
||||
hwnd, ci->idFirstChild );
|
||||
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_DESTROY:
|
||||
if( ci->hwndChildMaximized ) MDI_RestoreFrameMenu(w, frameWnd->hwndSelf);
|
||||
|
@ -993,38 +1042,46 @@ LRESULT WINAPI MDIClientWndProc( HWND hwnd, UINT message, WPARAM wParam,
|
|||
while( ci->nActiveChildren-- )
|
||||
DeleteMenu(ci->hWindowMenu,MF_BYPOSITION,ci->idFirstChild--);
|
||||
}
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_MDIACTIVATE:
|
||||
if( ci->hwndActiveChild != (HWND)wParam )
|
||||
SetWindowPos((HWND)wParam, 0,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE);
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_MDICASCADE:
|
||||
return MDICascade(w, ci);
|
||||
retvalue = MDICascade(w, ci);
|
||||
goto END;
|
||||
|
||||
case WM_MDICREATE:
|
||||
if (lParam) return MDICreateChild( w, ci, hwnd,
|
||||
if (lParam) retvalue = MDICreateChild( w, ci, hwnd,
|
||||
(MDICREATESTRUCTA*)lParam );
|
||||
return 0;
|
||||
else retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_MDIDESTROY:
|
||||
return MDIDestroyChild( w, ci, hwnd, (HWND)wParam, TRUE );
|
||||
retvalue = MDIDestroyChild( w, ci, hwnd, (HWND)wParam, TRUE );
|
||||
goto END;
|
||||
|
||||
case WM_MDIGETACTIVE:
|
||||
if (lParam) *(BOOL *)lParam = (ci->hwndChildMaximized > 0);
|
||||
return ci->hwndActiveChild;
|
||||
retvalue = ci->hwndActiveChild;
|
||||
goto END;
|
||||
|
||||
case WM_MDIICONARRANGE:
|
||||
ci->mdiFlags |= MDIF_NEEDUPDATE;
|
||||
ArrangeIconicWindows(hwnd);
|
||||
ci->sbRecalc = SB_BOTH+1;
|
||||
SendMessageA(hwnd, WM_MDICALCCHILDSCROLL, 0, 0L);
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_MDIMAXIMIZE:
|
||||
ShowWindow( (HWND)wParam, SW_MAXIMIZE );
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_MDINEXT: /* lParam != 0 means previous window */
|
||||
MDI_SwitchActiveChild(hwnd, (HWND)wParam, (lParam)? FALSE : TRUE );
|
||||
|
@ -1032,27 +1089,31 @@ LRESULT WINAPI MDIClientWndProc( HWND hwnd, UINT message, WPARAM wParam,
|
|||
|
||||
case WM_MDIRESTORE:
|
||||
SendMessageA( (HWND)wParam, WM_SYSCOMMAND, SC_RESTORE, 0);
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_MDISETMENU:
|
||||
return MDISetMenu( hwnd, (HMENU)wParam, (HMENU)lParam );
|
||||
|
||||
retvalue = MDISetMenu( hwnd, (HMENU)wParam, (HMENU)lParam );
|
||||
goto END;
|
||||
case WM_MDIREFRESHMENU:
|
||||
return MDIRefreshMenu( hwnd, (HMENU)wParam, (HMENU)lParam );
|
||||
retvalue = MDIRefreshMenu( hwnd, (HMENU)wParam, (HMENU)lParam );
|
||||
goto END;
|
||||
|
||||
case WM_MDITILE:
|
||||
ci->mdiFlags |= MDIF_NEEDUPDATE;
|
||||
ShowScrollBar(hwnd,SB_BOTH,FALSE);
|
||||
MDITile(w, ci, wParam);
|
||||
ci->mdiFlags &= ~MDIF_NEEDUPDATE;
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_VSCROLL:
|
||||
case WM_HSCROLL:
|
||||
ci->mdiFlags |= MDIF_NEEDUPDATE;
|
||||
ScrollChildren(hwnd, message, wParam, lParam);
|
||||
ci->mdiFlags &= ~MDIF_NEEDUPDATE;
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_SETFOCUS:
|
||||
if( ci->hwndActiveChild )
|
||||
|
@ -1061,7 +1122,8 @@ LRESULT WINAPI MDIClientWndProc( HWND hwnd, UINT message, WPARAM wParam,
|
|||
if( !(w->dwStyle & WS_MINIMIZE) )
|
||||
SetFocus( ci->hwndActiveChild );
|
||||
}
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_NCACTIVATE:
|
||||
if( ci->hwndActiveChild )
|
||||
|
@ -1079,7 +1141,8 @@ LRESULT WINAPI MDIClientWndProc( HWND hwnd, UINT message, WPARAM wParam,
|
|||
if( child && child != hwnd && child != ci->hwndActiveChild )
|
||||
SetWindowPos(child, 0,0,0,0,0, SWP_NOSIZE | SWP_NOMOVE );
|
||||
}
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_SIZE:
|
||||
if( IsWindow(ci->hwndChildMaximized) )
|
||||
|
@ -1090,6 +1153,7 @@ LRESULT WINAPI MDIClientWndProc( HWND hwnd, UINT message, WPARAM wParam,
|
|||
AdjustWindowRectEx(&rect, child->dwStyle, 0, child->dwExStyle);
|
||||
MoveWindow(ci->hwndChildMaximized, rect.left, rect.top,
|
||||
rect.right - rect.left, rect.bottom - rect.top, 1);
|
||||
WIN_ReleaseWndPtr(child);
|
||||
}
|
||||
else
|
||||
MDI_PostUpdate(hwnd, ci, SB_BOTH+1);
|
||||
|
@ -1103,10 +1167,15 @@ LRESULT WINAPI MDIClientWndProc( HWND hwnd, UINT message, WPARAM wParam,
|
|||
ci->sbRecalc = 0;
|
||||
ci->mdiFlags &= ~MDIF_NEEDUPDATE;
|
||||
}
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
}
|
||||
|
||||
return DefWindowProcA( hwnd, message, wParam, lParam );
|
||||
retvalue = DefWindowProcA( hwnd, message, wParam, lParam );
|
||||
END:
|
||||
WIN_ReleaseWndPtr(w);
|
||||
WIN_ReleaseWndPtr(frameWnd);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1136,6 +1205,7 @@ LRESULT WINAPI DefFrameProc16( HWND16 hwnd, HWND16 hwndMDIClient,
|
|||
ci = (MDICLIENTINFO*)wndPtr->wExtra;
|
||||
|
||||
/* check for possible syscommands for maximized MDI child */
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
|
||||
if( ci && (
|
||||
wParam < ci->idFirstChild ||
|
||||
|
@ -1159,8 +1229,10 @@ LRESULT WINAPI DefFrameProc16( HWND16 hwnd, HWND16 hwndMDIClient,
|
|||
}
|
||||
else
|
||||
{
|
||||
childHwnd = MDI_GetChildByID( WIN_FindWndPtr(hwndMDIClient),
|
||||
wParam );
|
||||
wndPtr = WIN_FindWndPtr(hwndMDIClient);
|
||||
childHwnd = MDI_GetChildByID(wndPtr,wParam );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
|
||||
if( childHwnd )
|
||||
SendMessage16(hwndMDIClient, WM_MDIACTIVATE,
|
||||
(WPARAM16)childHwnd , 0L);
|
||||
|
@ -1172,9 +1244,11 @@ LRESULT WINAPI DefFrameProc16( HWND16 hwnd, HWND16 hwndMDIClient,
|
|||
break;
|
||||
|
||||
case WM_SETTEXT:
|
||||
MDI_UpdateFrameText(WIN_FindWndPtr(hwnd), hwndMDIClient,
|
||||
wndPtr = WIN_FindWndPtr(hwnd);
|
||||
MDI_UpdateFrameText(wndPtr, hwndMDIClient,
|
||||
MDI_REPAINTFRAME,
|
||||
(LPCSTR)PTR_SEG_TO_LIN(lParam));
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return 0;
|
||||
|
||||
case WM_SETFOCUS:
|
||||
|
@ -1202,11 +1276,16 @@ LRESULT WINAPI DefFrameProc16( HWND16 hwnd, HWND16 hwndMDIClient,
|
|||
(wParam == VK_RIGHT &&
|
||||
GetSubMenu16(wndPtr->parent->hSysMenu, 0) == LOWORD(lParam)) )
|
||||
{
|
||||
LRESULT retvalue;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
wndPtr = WIN_FindWndPtr(ci->hwndActiveChild);
|
||||
return MAKELONG( GetSubMenu16(wndPtr->hSysMenu, 0),
|
||||
retvalue = MAKELONG( GetSubMenu16(wndPtr->hSysMenu, 0),
|
||||
ci->hwndActiveChild);
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1302,7 +1381,8 @@ LRESULT WINAPI DefMDIChildProc16( HWND16 hwnd, UINT16 message,
|
|||
WPARAM16 wParam, LPARAM lParam )
|
||||
{
|
||||
MDICLIENTINFO *ci;
|
||||
WND *clientWnd;
|
||||
WND *clientWnd,*tmpWnd = 0;
|
||||
LRESULT retvalue;
|
||||
|
||||
clientWnd = WIN_FindWndPtr(GetParent16(hwnd));
|
||||
ci = (MDICLIENTINFO *) clientWnd->wExtra;
|
||||
|
@ -1315,11 +1395,13 @@ LRESULT WINAPI DefMDIChildProc16( HWND16 hwnd, UINT16 message,
|
|||
if( ci->hwndChildMaximized == hwnd )
|
||||
MDI_UpdateFrameText( clientWnd->parent, ci->self,
|
||||
MDI_REPAINTFRAME, NULL );
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_CLOSE:
|
||||
SendMessage16(ci->self,WM_MDIDESTROY,(WPARAM16)hwnd,0L);
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_SETFOCUS:
|
||||
if( ci->hwndActiveChild != hwnd )
|
||||
|
@ -1328,7 +1410,8 @@ LRESULT WINAPI DefMDIChildProc16( HWND16 hwnd, UINT16 message,
|
|||
|
||||
case WM_CHILDACTIVATE:
|
||||
MDI_ChildActivate(clientWnd, hwnd);
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_NCPAINT:
|
||||
TRACE(mdi,"WM_NCPAINT for %04x, active %04x\n",
|
||||
|
@ -1339,30 +1422,44 @@ LRESULT WINAPI DefMDIChildProc16( HWND16 hwnd, UINT16 message,
|
|||
switch( wParam )
|
||||
{
|
||||
case SC_MOVE:
|
||||
if( ci->hwndChildMaximized == hwnd) return 0;
|
||||
if( ci->hwndChildMaximized == hwnd)
|
||||
{
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
}
|
||||
break;
|
||||
case SC_RESTORE:
|
||||
case SC_MINIMIZE:
|
||||
WIN_FindWndPtr(hwnd)->dwStyle |= WS_SYSMENU;
|
||||
tmpWnd = WIN_FindWndPtr(hwnd);
|
||||
tmpWnd->dwStyle |= WS_SYSMENU;
|
||||
WIN_ReleaseWndPtr(tmpWnd);
|
||||
break;
|
||||
case SC_MAXIMIZE:
|
||||
if( ci->hwndChildMaximized == hwnd)
|
||||
return SendMessage16( clientWnd->parent->hwndSelf,
|
||||
{
|
||||
retvalue = SendMessage16( clientWnd->parent->hwndSelf,
|
||||
message, wParam, lParam);
|
||||
WIN_FindWndPtr(hwnd)->dwStyle &= ~WS_SYSMENU;
|
||||
goto END;
|
||||
}
|
||||
tmpWnd = WIN_FindWndPtr(hwnd);
|
||||
tmpWnd->dwStyle &= ~WS_SYSMENU;
|
||||
WIN_ReleaseWndPtr(tmpWnd);
|
||||
break;
|
||||
case SC_NEXTWINDOW:
|
||||
SendMessage16( ci->self, WM_MDINEXT, 0, 0);
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
case SC_PREVWINDOW:
|
||||
SendMessage16( ci->self, WM_MDINEXT, 0, 1);
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_GETMINMAXINFO:
|
||||
MDI_ChildGetMinMaxInfo(clientWnd, hwnd, (MINMAXINFO16*) PTR_SEG_TO_LIN(lParam));
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_SETVISIBLE:
|
||||
if( ci->hwndChildMaximized) ci->mdiFlags &= ~MDIF_NEEDUPDATE;
|
||||
|
@ -1424,16 +1521,23 @@ LRESULT WINAPI DefMDIChildProc16( HWND16 hwnd, UINT16 message,
|
|||
/* MDI children don't have menu bars */
|
||||
PostMessage16( clientWnd->parent->hwndSelf, WM_SYSCOMMAND,
|
||||
(WPARAM16)SC_KEYMENU, (LPARAM)wParam);
|
||||
return 0x00010000L;
|
||||
retvalue = 0x00010000L;
|
||||
goto END;
|
||||
|
||||
case WM_NEXTMENU:
|
||||
|
||||
if( wParam == VK_LEFT ) /* switch to frame system menu */
|
||||
return MAKELONG( GetSubMenu16(clientWnd->parent->hSysMenu, 0),
|
||||
{
|
||||
retvalue = MAKELONG( GetSubMenu16(clientWnd->parent->hSysMenu, 0),
|
||||
clientWnd->parent->hwndSelf );
|
||||
goto END;
|
||||
}
|
||||
if( wParam == VK_RIGHT ) /* to frame menu bar */
|
||||
return MAKELONG( clientWnd->parent->wIDmenu,
|
||||
{
|
||||
retvalue = MAKELONG( clientWnd->parent->wIDmenu,
|
||||
clientWnd->parent->hwndSelf );
|
||||
goto END;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
@ -1442,11 +1546,14 @@ LRESULT WINAPI DefMDIChildProc16( HWND16 hwnd, UINT16 message,
|
|||
{
|
||||
SendMessage16(hwnd,WM_SYSCOMMAND,
|
||||
(WPARAM16)SC_KEYMENU, (LPARAM)(DWORD)VK_SPACE);
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
}
|
||||
}
|
||||
|
||||
return DefWindowProc16(hwnd, message, wParam, lParam);
|
||||
retvalue = DefWindowProc16(hwnd, message, wParam, lParam);
|
||||
END:
|
||||
WIN_ReleaseWndPtr(clientWnd);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1457,10 +1564,13 @@ LRESULT WINAPI DefMDIChildProcA( HWND hwnd, UINT message,
|
|||
WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
MDICLIENTINFO *ci;
|
||||
WND *clientWnd;
|
||||
WND *clientWnd,*tmpWnd;
|
||||
LRESULT retvalue;
|
||||
|
||||
clientWnd = WIN_FindWndPtr(WIN_FindWndPtr(hwnd)->parent->hwndSelf);
|
||||
tmpWnd = WIN_FindWndPtr(hwnd);
|
||||
clientWnd = WIN_FindWndPtr(tmpWnd->parent->hwndSelf);
|
||||
ci = (MDICLIENTINFO *) clientWnd->wExtra;
|
||||
WIN_ReleaseWndPtr(tmpWnd);
|
||||
|
||||
switch (message)
|
||||
{
|
||||
|
@ -1470,7 +1580,8 @@ LRESULT WINAPI DefMDIChildProcA( HWND hwnd, UINT message,
|
|||
if( ci->hwndChildMaximized == hwnd )
|
||||
MDI_UpdateFrameText( clientWnd->parent, ci->self,
|
||||
MDI_REPAINTFRAME, NULL );
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_GETMINMAXINFO:
|
||||
{
|
||||
|
@ -1479,14 +1590,16 @@ LRESULT WINAPI DefMDIChildProcA( HWND hwnd, UINT message,
|
|||
MDI_ChildGetMinMaxInfo( clientWnd, hwnd, &mmi );
|
||||
STRUCT32_MINMAXINFO16to32( &mmi, (MINMAXINFO *)lParam );
|
||||
}
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_MENUCHAR:
|
||||
|
||||
/* MDI children don't have menu bars */
|
||||
PostMessage16( clientWnd->parent->hwndSelf, WM_SYSCOMMAND,
|
||||
(WPARAM16)SC_KEYMENU, (LPARAM)LOWORD(wParam) );
|
||||
return 0x00010000L;
|
||||
retvalue = 0x00010000L;
|
||||
goto END;
|
||||
|
||||
case WM_CLOSE:
|
||||
case WM_SETFOCUS:
|
||||
|
@ -1496,17 +1609,22 @@ LRESULT WINAPI DefMDIChildProcA( HWND hwnd, UINT message,
|
|||
case WM_SETVISIBLE:
|
||||
case WM_SIZE:
|
||||
case WM_NEXTMENU:
|
||||
return DefMDIChildProc16( hwnd, message, (WPARAM16)wParam, lParam );
|
||||
retvalue = DefMDIChildProc16( hwnd, message, (WPARAM16)wParam, lParam );
|
||||
goto END;
|
||||
|
||||
case WM_SYSCHAR:
|
||||
if (wParam == '-')
|
||||
{
|
||||
SendMessageA(hwnd,WM_SYSCOMMAND,
|
||||
(WPARAM)SC_KEYMENU, (LPARAM)(DWORD)VK_SPACE);
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
}
|
||||
}
|
||||
return DefWindowProcA(hwnd, message, wParam, lParam);
|
||||
retvalue = DefWindowProcA(hwnd, message, wParam, lParam);
|
||||
END:
|
||||
WIN_ReleaseWndPtr(clientWnd);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1518,6 +1636,7 @@ LRESULT WINAPI DefMDIChildProcW( HWND hwnd, UINT message,
|
|||
{
|
||||
MDICLIENTINFO *ci;
|
||||
WND *clientWnd;
|
||||
LRESULT retvalue;
|
||||
|
||||
clientWnd = WIN_FindWndPtr(GetParent16(hwnd));
|
||||
ci = (MDICLIENTINFO *) clientWnd->wExtra;
|
||||
|
@ -1530,7 +1649,8 @@ LRESULT WINAPI DefMDIChildProcW( HWND hwnd, UINT message,
|
|||
if( ci->hwndChildMaximized == hwnd )
|
||||
MDI_UpdateFrameText( clientWnd->parent, ci->self,
|
||||
MDI_REPAINTFRAME, NULL );
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
|
||||
case WM_GETMINMAXINFO:
|
||||
case WM_MENUCHAR:
|
||||
|
@ -1542,17 +1662,23 @@ LRESULT WINAPI DefMDIChildProcW( HWND hwnd, UINT message,
|
|||
case WM_SETVISIBLE:
|
||||
case WM_SIZE:
|
||||
case WM_NEXTMENU:
|
||||
return DefMDIChildProcA( hwnd, message, (WPARAM16)wParam, lParam );
|
||||
retvalue = DefMDIChildProcA( hwnd, message, (WPARAM16)wParam, lParam );
|
||||
goto END;
|
||||
|
||||
case WM_SYSCHAR:
|
||||
if (wParam == '-')
|
||||
{
|
||||
SendMessageW(hwnd,WM_SYSCOMMAND,
|
||||
(WPARAM)SC_KEYMENU, (LPARAM)(DWORD)VK_SPACE);
|
||||
return 0;
|
||||
retvalue = 0;
|
||||
goto END;
|
||||
}
|
||||
}
|
||||
return DefWindowProcW(hwnd, message, wParam, lParam);
|
||||
retvalue = DefWindowProcW(hwnd, message, wParam, lParam);
|
||||
END:
|
||||
WIN_ReleaseWndPtr(clientWnd);
|
||||
return retvalue;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1601,6 +1727,7 @@ HWND MDI_CreateMDIWindowA(
|
|||
MDICLIENTINFO* pCi;
|
||||
MDICREATESTRUCTA cs;
|
||||
WND *pWnd=WIN_FindWndPtr(hWndParent);
|
||||
HWND retvalue;
|
||||
|
||||
TRACE(mdi, "(%s,%s,%ld,%d,%d,%d,%d,%x,%d,%ld)\n",
|
||||
debugstr_a(lpClassName),debugstr_a(lpWindowName),dwStyle,X,Y,
|
||||
|
@ -1622,7 +1749,9 @@ HWND MDI_CreateMDIWindowA(
|
|||
|
||||
pCi=(MDICLIENTINFO *)pWnd->wExtra;
|
||||
|
||||
return MDICreateChild(pWnd,pCi,hWndParent,&cs);
|
||||
retvalue = MDICreateChild(pWnd,pCi,hWndParent,&cs);
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
/***************************************
|
||||
|
@ -1701,11 +1830,13 @@ BOOL16 WINAPI TranslateMDISysAccel16( HWND16 hwndClient, LPMSG16 msg )
|
|||
WND* wnd;
|
||||
|
||||
ci = (MDICLIENTINFO*) clientWnd->wExtra;
|
||||
WIN_ReleaseWndPtr(clientWnd);
|
||||
wnd = WIN_FindWndPtr(ci->hwndActiveChild);
|
||||
if( wnd && !(wnd->dwStyle & WS_DISABLED) )
|
||||
{
|
||||
WPARAM16 wParam = 0;
|
||||
|
||||
WIN_ReleaseWndPtr(wnd);
|
||||
/* translate if the Ctrl key is down and Alt not. */
|
||||
|
||||
if( (GetKeyState(VK_CONTROL) & 0x8000) &&
|
||||
|
@ -1731,7 +1862,9 @@ BOOL16 WINAPI TranslateMDISysAccel16( HWND16 hwndClient, LPMSG16 msg )
|
|||
return 1;
|
||||
}
|
||||
}
|
||||
WIN_ReleaseWndPtr(wnd);
|
||||
}
|
||||
WIN_ReleaseWndPtr(clientWnd);
|
||||
return 0; /* failure */
|
||||
}
|
||||
|
||||
|
@ -1750,15 +1883,17 @@ void WINAPI CalcChildScroll16( HWND16 hwnd, WORD scroll )
|
|||
GetClientRect( hwnd, &clientRect );
|
||||
SetRectEmpty( &childRect );
|
||||
|
||||
for ( pWnd = pWnd->child; pWnd; pWnd = pWnd->next )
|
||||
for ( WIN_UpdateWndPtr(&pWnd,pWnd->child); pWnd; WIN_UpdateWndPtr(&pWnd,pWnd->next))
|
||||
{
|
||||
if( pWnd->dwStyle & WS_MAXIMIZE )
|
||||
{
|
||||
ShowScrollBar(hwnd, SB_BOTH, FALSE);
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
return;
|
||||
}
|
||||
UnionRect( &childRect, &pWnd->rectWindow, &childRect );
|
||||
}
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
UnionRect( &childRect, &clientRect, &childRect );
|
||||
|
||||
hmin = childRect.left; hmax = childRect.right - clientRect.right;
|
||||
|
@ -1780,6 +1915,7 @@ void WINAPI CalcChildScroll16( HWND16 hwnd, WORD scroll )
|
|||
SCROLL_SetNCSbState( Wnd, vmin, vmax, vpos,
|
||||
hmin, hmax, hpos);
|
||||
}
|
||||
WIN_ReleaseWndPtr(Wnd);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1818,8 +1954,13 @@ void WINAPI ScrollChildren(HWND hWnd, UINT uMsg, WPARAM wParam,
|
|||
length = (wndPtr->rectClient.bottom - wndPtr->rectClient.top)/2;
|
||||
shift = SYSMETRICS_CXVSCROLL;
|
||||
}
|
||||
else return;
|
||||
else
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return;
|
||||
}
|
||||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
switch( wParam )
|
||||
{
|
||||
case SB_LINEUP:
|
||||
|
|
|
@ -349,6 +349,7 @@ DrawCaptionTempA (HWND hwnd, HDC hdc, const RECT *rect, HFONT hFont,
|
|||
|
||||
DrawIconEx (hdc, pt.x, pt.y, hAppIcon, sysMetrics[SM_CXSMICON],
|
||||
sysMetrics[SM_CYSMICON], 0, 0, DI_NORMAL);
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
|
||||
rc.left += (rc.bottom - rc.top);
|
||||
|
@ -554,7 +555,7 @@ static void NC_GetInsideRect( HWND hwnd, RECT *rect )
|
|||
rect->right = wndPtr->rectWindow.right - wndPtr->rectWindow.left;
|
||||
rect->bottom = wndPtr->rectWindow.bottom - wndPtr->rectWindow.top;
|
||||
|
||||
if ((wndPtr->dwStyle & WS_ICONIC) || (wndPtr->flags & WIN_MANAGED)) return;
|
||||
if ((wndPtr->dwStyle & WS_ICONIC) || (wndPtr->flags & WIN_MANAGED)) goto END;
|
||||
|
||||
/* Remove frame from rectangle */
|
||||
if (HAS_DLGFRAME( wndPtr->dwStyle, wndPtr->dwExStyle ))
|
||||
|
@ -570,7 +571,8 @@ static void NC_GetInsideRect( HWND hwnd, RECT *rect )
|
|||
if (wndPtr->dwStyle & WS_BORDER)
|
||||
InflateRect( rect, -SYSMETRICS_CXBORDER, -SYSMETRICS_CYBORDER );
|
||||
}
|
||||
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -592,7 +594,7 @@ NC_GetInsideRect95 (HWND hwnd, RECT *rect)
|
|||
rect->right = wndPtr->rectWindow.right - wndPtr->rectWindow.left;
|
||||
rect->bottom = wndPtr->rectWindow.bottom - wndPtr->rectWindow.top;
|
||||
|
||||
if ((wndPtr->dwStyle & WS_ICONIC) || (wndPtr->flags & WIN_MANAGED)) return;
|
||||
if ((wndPtr->dwStyle & WS_ICONIC) || (wndPtr->flags & WIN_MANAGED)) goto END;
|
||||
|
||||
/* Remove frame from rectangle */
|
||||
if (HAS_FIXEDFRAME (wndPtr->dwStyle, wndPtr->dwExStyle ))
|
||||
|
@ -614,7 +616,8 @@ NC_GetInsideRect95 (HWND hwnd, RECT *rect)
|
|||
if (wndPtr->dwExStyle & WS_EX_STATICEDGE)
|
||||
InflateRect (rect, -SYSMETRICS_CXBORDER, -SYSMETRICS_CYBORDER);
|
||||
}
|
||||
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -907,15 +910,18 @@ NC_DoNCHitTest95 (WND *wndPtr, POINT16 pt )
|
|||
LONG
|
||||
NC_HandleNCHitTest (HWND hwnd , POINT16 pt)
|
||||
{
|
||||
LONG retvalue;
|
||||
WND *wndPtr = WIN_FindWndPtr (hwnd);
|
||||
|
||||
if (!wndPtr)
|
||||
return HTERROR;
|
||||
|
||||
if (TWEAK_WineLook == WIN31_LOOK)
|
||||
return NC_DoNCHitTest (wndPtr, pt);
|
||||
retvalue = NC_DoNCHitTest (wndPtr, pt);
|
||||
else
|
||||
return NC_DoNCHitTest95 (wndPtr, pt);
|
||||
retvalue = NC_DoNCHitTest95 (wndPtr, pt);
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -940,6 +946,7 @@ void NC_DrawSysButton( HWND hwnd, HDC hdc, BOOL down )
|
|||
SelectObject( hdcMem, hbitmap );
|
||||
DeleteDC( hdcMem );
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
|
||||
|
||||
|
@ -964,6 +971,8 @@ static void NC_DrawMaxButton( HWND hwnd, HDC16 hdc, BOOL down )
|
|||
SRCCOPY );
|
||||
DeleteDC( hdcMem );
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -987,6 +996,7 @@ static void NC_DrawMinButton( HWND hwnd, HDC16 hdc, BOOL down )
|
|||
SRCCOPY );
|
||||
DeleteDC( hdcMem );
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1030,8 +1040,10 @@ NC_DrawSysButton95 (HWND hwnd, HDC hdc, BOOL down)
|
|||
sysMetrics[SM_CYSMICON],
|
||||
0, 0, DI_NORMAL);
|
||||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return (hIcon != 0);
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1075,6 +1087,7 @@ void NC_DrawCloseButton95 (HWND hwnd, HDC hdc, BOOL down)
|
|||
SelectObject (hdcMem, hOldBmp);
|
||||
DeleteDC (hdcMem);
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -1125,6 +1138,7 @@ static void NC_DrawMaxButton95(HWND hwnd,HDC16 hdc,BOOL down )
|
|||
SelectObject (hdcMem, hOldBmp);
|
||||
DeleteDC( hdcMem );
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -1178,6 +1192,7 @@ static void NC_DrawMinButton95(HWND hwnd,HDC16 hdc,BOOL down )
|
|||
SelectObject (hdcMem, hOldBmp);
|
||||
DeleteDC( hdcMem );
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -1357,12 +1372,19 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd,
|
|||
WND * wndPtr = WIN_FindWndPtr( hwnd );
|
||||
char buffer[256];
|
||||
|
||||
if (wndPtr->flags & WIN_MANAGED) return;
|
||||
if (wndPtr->flags & WIN_MANAGED)
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hbitmapClose)
|
||||
{
|
||||
if (!(hbitmapClose = LoadBitmap16( 0, MAKEINTRESOURCE16(OBM_CLOSE) )))
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return;
|
||||
}
|
||||
hbitmapCloseD = LoadBitmap16( 0, MAKEINTRESOURCE16(OBM_CLOSED) );
|
||||
hbitmapMinimize = LoadBitmap16( 0, MAKEINTRESOURCE16(OBM_REDUCE) );
|
||||
hbitmapMinimizeD = LoadBitmap16( 0, MAKEINTRESOURCE16(OBM_REDUCED) );
|
||||
|
@ -1382,7 +1404,7 @@ static void NC_DrawCaption( HDC hdc, RECT *rect, HWND hwnd,
|
|||
r.right--;
|
||||
SelectObject( hdc, hbrushOld );
|
||||
}
|
||||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
MoveTo16( hdc, r.left, r.bottom );
|
||||
LineTo( hdc, r.right, r.bottom );
|
||||
|
||||
|
@ -1455,7 +1477,12 @@ static void NC_DrawCaption95(
|
|||
char buffer[256];
|
||||
HPEN hPrevPen;
|
||||
|
||||
if (wndPtr->flags & WIN_MANAGED) return;
|
||||
if (wndPtr->flags & WIN_MANAGED)
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return;
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
|
||||
hPrevPen = SelectObject( hdc, GetSysColorPen(COLOR_3DFACE) );
|
||||
MoveToEx( hdc, r.left, r.bottom - 1, NULL );
|
||||
|
@ -1755,6 +1782,7 @@ LONG NC_HandleNCPaint( HWND hwnd , HRGN clip)
|
|||
else
|
||||
NC_DoNCPaint95( wndPtr, clip, FALSE );
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1810,13 +1838,17 @@ LONG NC_HandleSetCursor( HWND hwnd, WPARAM16 wParam, LPARAM lParam )
|
|||
case HTCLIENT:
|
||||
{
|
||||
WND *wndPtr;
|
||||
BOOL retvalue;
|
||||
|
||||
if (!(wndPtr = WIN_FindWndPtr( hwnd ))) break;
|
||||
if (wndPtr->class->hCursor)
|
||||
{
|
||||
SetCursor16( wndPtr->class->hCursor );
|
||||
return TRUE;
|
||||
retvalue = TRUE;
|
||||
}
|
||||
else return FALSE;
|
||||
else retvalue = FALSE;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
case HTLEFT:
|
||||
|
@ -1981,18 +2013,18 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam )
|
|||
capturePoint = pt = *(POINT16*)&dwPoint;
|
||||
|
||||
if (IsZoomed(hwnd) || !IsWindowVisible(hwnd) ||
|
||||
(wndPtr->flags & WIN_MANAGED)) return;
|
||||
(wndPtr->flags & WIN_MANAGED)) goto END;
|
||||
|
||||
if ((wParam & 0xfff0) == SC_MOVE)
|
||||
{
|
||||
if (!(wndPtr->dwStyle & WS_CAPTION)) return;
|
||||
if (!(wndPtr->dwStyle & WS_CAPTION)) goto END;
|
||||
if (!hittest)
|
||||
hittest = NC_StartSizeMove( wndPtr, wParam, &capturePoint );
|
||||
if (!hittest) return;
|
||||
if (!hittest) goto END;
|
||||
}
|
||||
else /* SC_SIZE */
|
||||
{
|
||||
if (!thickframe) return;
|
||||
if (!thickframe) goto END;
|
||||
if ( hittest && hittest != HTSYSMENU ) hittest += 2;
|
||||
else
|
||||
{
|
||||
|
@ -2001,7 +2033,7 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam )
|
|||
if (!hittest)
|
||||
{
|
||||
ReleaseCapture();
|
||||
return;
|
||||
goto END;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2193,6 +2225,9 @@ static void NC_DoSizeMove( HWND hwnd, WORD wParam )
|
|||
}
|
||||
else WINPOS_ShowIconTitle( wndPtr, TRUE );
|
||||
}
|
||||
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2295,16 +2330,16 @@ static void NC_TrackScrollBar( HWND hwnd, WPARAM wParam, POINT pt )
|
|||
|
||||
if ((wParam & 0xfff0) == SC_HSCROLL)
|
||||
{
|
||||
if ((wParam & 0x0f) != HTHSCROLL) return;
|
||||
if ((wParam & 0x0f) != HTHSCROLL) goto END;
|
||||
scrollbar = SB_HORZ;
|
||||
}
|
||||
else /* SC_VSCROLL */
|
||||
{
|
||||
if ((wParam & 0x0f) != HTVSCROLL) return;
|
||||
if ((wParam & 0x0f) != HTVSCROLL) goto END;
|
||||
scrollbar = SB_VERT;
|
||||
}
|
||||
|
||||
if (!(msg = SEGPTR_NEW(MSG16))) return;
|
||||
if (!(msg = SEGPTR_NEW(MSG16))) goto END;
|
||||
pt.x -= wndPtr->rectWindow.left;
|
||||
pt.y -= wndPtr->rectWindow.top;
|
||||
SetCapture( hwnd );
|
||||
|
@ -2336,6 +2371,8 @@ static void NC_TrackScrollBar( HWND hwnd, WPARAM wParam, POINT pt )
|
|||
}
|
||||
} while (msg->message != WM_LBUTTONUP);
|
||||
SEGPTR_FREE(msg);
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -2532,5 +2569,6 @@ LONG NC_HandleSysCommand( HWND hwnd, WPARAM16 wParam, POINT16 pt )
|
|||
FIXME (nonclient, "unimplemented!\n");
|
||||
break;
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -35,8 +35,10 @@ void WIN_UpdateNCArea(WND* wnd, BOOL bUpdate)
|
|||
if(wnd == WIN_GetDesktop())
|
||||
{
|
||||
wnd->flags &= ~WIN_NEEDS_NCPAINT;
|
||||
WIN_ReleaseDesktop();
|
||||
return;
|
||||
}
|
||||
WIN_ReleaseDesktop();
|
||||
|
||||
if( wnd->hrgnUpdate > 1 )
|
||||
{
|
||||
|
@ -136,6 +138,7 @@ HDC16 WINAPI BeginPaint16( HWND16 hwnd, LPPAINTSTRUCT16 lps )
|
|||
if (!lps->hdc)
|
||||
{
|
||||
WARN(win, "GetDCEx() failed in BeginPaint(), hwnd=%04x\n", hwnd);
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -153,6 +156,7 @@ TRACE(win,"box = (%i,%i - %i,%i)\n", lps->rcPaint.left, lps->rcPaint.top,
|
|||
}
|
||||
else lps->fErase = TRUE;
|
||||
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return lps->hdc;
|
||||
}
|
||||
|
||||
|
@ -248,16 +252,22 @@ void WINAPI PaintRect16( HWND16 hwndParent, HWND16 hwnd, HDC16 hdc,
|
|||
HBRUSH16 WINAPI GetControlBrush16( HWND16 hwnd, HDC16 hdc, UINT16 ctlType )
|
||||
{
|
||||
WND* wndPtr = WIN_FindWndPtr( hwnd );
|
||||
HBRUSH16 retvalue;
|
||||
|
||||
if((ctlType <= CTLCOLOR_MAX) && wndPtr )
|
||||
{
|
||||
WND* parent;
|
||||
if( wndPtr->dwStyle & WS_POPUP ) parent = wndPtr->owner;
|
||||
else parent = wndPtr->parent;
|
||||
if( wndPtr->dwStyle & WS_POPUP ) parent = WIN_LockWndPtr(wndPtr->owner);
|
||||
else parent = WIN_LockWndPtr(wndPtr->parent);
|
||||
if( !parent ) parent = wndPtr;
|
||||
return (HBRUSH16)PAINT_GetControlBrush( parent->hwndSelf, hwnd, hdc, ctlType );
|
||||
retvalue = (HBRUSH16)PAINT_GetControlBrush( parent->hwndSelf, hwnd, hdc, ctlType );
|
||||
WIN_ReleaseWndPtr(parent);
|
||||
goto END;
|
||||
}
|
||||
return (HBRUSH16)0;
|
||||
retvalue = (HBRUSH16)0;
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -290,7 +300,10 @@ BOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate,
|
|||
if (!hwnd) hwnd = GetDesktopWindow();
|
||||
if (!(wndPtr = WIN_FindWndPtr( hwnd ))) return FALSE;
|
||||
if (!WIN_IsWindowDrawable( wndPtr, !(flags & RDW_FRAME) ) )
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return TRUE; /* No redraw needed */
|
||||
}
|
||||
|
||||
bIcon = (wndPtr->dwStyle & WS_MINIMIZE && wndPtr->class->hIcon);
|
||||
if (rectUpdate)
|
||||
|
@ -440,13 +453,18 @@ BOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate,
|
|||
{
|
||||
if ( hrgnUpdate || rectUpdate )
|
||||
{
|
||||
if (!(hrgn = CreateRectRgn( 0, 0, 0, 0 ))) return TRUE;
|
||||
if (!(hrgn = CreateRectRgn( 0, 0, 0, 0 )))
|
||||
{
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return TRUE;
|
||||
}
|
||||
if( !hrgnUpdate )
|
||||
{
|
||||
control |= (RDW_C_DELETEHRGN | RDW_C_USEHRGN);
|
||||
if( !(hrgnUpdate = CreateRectRgnIndirect( rectUpdate )) )
|
||||
{
|
||||
DeleteObject( hrgn );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -454,7 +472,7 @@ BOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate,
|
|||
{
|
||||
for (ppWnd = list; *ppWnd; ppWnd++)
|
||||
{
|
||||
wndPtr = *ppWnd;
|
||||
WIN_UpdateWndPtr(&wndPtr,*ppWnd);
|
||||
if (!IsWindow(wndPtr->hwndSelf)) continue;
|
||||
if (wndPtr->dwStyle & WS_VISIBLE)
|
||||
{
|
||||
|
@ -470,7 +488,7 @@ BOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate,
|
|||
}
|
||||
}
|
||||
}
|
||||
HeapFree( SystemHeap, 0, list );
|
||||
WIN_ReleaseWinArray(list);
|
||||
}
|
||||
DeleteObject( hrgn );
|
||||
if (control & RDW_C_DELETEHRGN) DeleteObject( hrgnUpdate );
|
||||
|
@ -481,15 +499,16 @@ BOOL PAINT_RedrawWindow( HWND hwnd, const RECT *rectUpdate,
|
|||
{
|
||||
for (ppWnd = list; *ppWnd; ppWnd++)
|
||||
{
|
||||
wndPtr = *ppWnd;
|
||||
WIN_UpdateWndPtr(&wndPtr,*ppWnd);
|
||||
if (IsWindow( wndPtr->hwndSelf ))
|
||||
PAINT_RedrawWindow( wndPtr->hwndSelf, NULL, 0, flags, 0 );
|
||||
}
|
||||
HeapFree( SystemHeap, 0, list );
|
||||
WIN_ReleaseWinArray(list);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -632,6 +651,7 @@ BOOL16 WINAPI GetUpdateRect16( HWND16 hwnd, LPRECT16 rect, BOOL16 erase )
|
|||
*/
|
||||
BOOL WINAPI GetUpdateRect( HWND hwnd, LPRECT rect, BOOL erase )
|
||||
{
|
||||
BOOL retvalue;
|
||||
WND * wndPtr = WIN_FindWndPtr( hwnd );
|
||||
if (!wndPtr) return FALSE;
|
||||
|
||||
|
@ -640,7 +660,11 @@ BOOL WINAPI GetUpdateRect( HWND hwnd, LPRECT rect, BOOL erase )
|
|||
if (wndPtr->hrgnUpdate > 1)
|
||||
{
|
||||
HRGN hrgn = CreateRectRgn( 0, 0, 0, 0 );
|
||||
if (GetUpdateRgn( hwnd, hrgn, erase ) == ERROR) return FALSE;
|
||||
if (GetUpdateRgn( hwnd, hrgn, erase ) == ERROR)
|
||||
{
|
||||
retvalue = FALSE;
|
||||
goto END;
|
||||
}
|
||||
GetRgnBox( hrgn, rect );
|
||||
DeleteObject( hrgn );
|
||||
if (wndPtr->class->style & CS_OWNDC)
|
||||
|
@ -653,7 +677,10 @@ BOOL WINAPI GetUpdateRect( HWND hwnd, LPRECT rect, BOOL erase )
|
|||
}
|
||||
else SetRectEmpty( rect );
|
||||
}
|
||||
return (wndPtr->hrgnUpdate > 1);
|
||||
retvalue = (wndPtr->hrgnUpdate > 1);
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
|
||||
|
@ -678,10 +705,13 @@ INT WINAPI GetUpdateRgn( HWND hwnd, HRGN hrgn, BOOL erase )
|
|||
if (wndPtr->hrgnUpdate <= 1)
|
||||
{
|
||||
SetRectRgn( hrgn, 0, 0, 0, 0 );
|
||||
return NULLREGION;
|
||||
retval = NULLREGION;
|
||||
goto END;
|
||||
}
|
||||
retval = CombineRgn( hrgn, wndPtr->hrgnUpdate, 0, RGN_COPY );
|
||||
if (erase) RedrawWindow( hwnd, NULL, 0, RDW_ERASENOW | RDW_NOCHILDREN );
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
@ -719,8 +749,10 @@ INT WINAPI ExcludeUpdateRgn( HDC hdc, HWND hwnd )
|
|||
|
||||
ret = DCE_ExcludeRgn( hdc, wndPtr, hrgn );
|
||||
DeleteObject( hrgn );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return ret;
|
||||
}
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return GetClipBox( hdc, &rect );
|
||||
}
|
||||
|
||||
|
|
|
@ -35,9 +35,9 @@ static PROPERTY *PROP_FindProp( HWND hwnd, LPCSTR str )
|
|||
{
|
||||
if (HIWORD(prop->string))
|
||||
{
|
||||
if (!lstrcmpiA( prop->string, str )) return prop;
|
||||
if (!lstrcmpiA( prop->string, str )) goto END;
|
||||
}
|
||||
else if (LOWORD(prop->string) == atom) return prop;
|
||||
else if (LOWORD(prop->string) == atom) goto END;
|
||||
}
|
||||
}
|
||||
else /* atom */
|
||||
|
@ -47,12 +47,15 @@ static PROPERTY *PROP_FindProp( HWND hwnd, LPCSTR str )
|
|||
{
|
||||
if (HIWORD(prop->string))
|
||||
{
|
||||
if (GlobalFindAtomA( prop->string ) == atom) return prop;
|
||||
if (GlobalFindAtomA( prop->string ) == atom) goto END;
|
||||
}
|
||||
else if (LOWORD(prop->string) == atom) return prop;
|
||||
else if (LOWORD(prop->string) == atom) goto END;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
prop = NULL;
|
||||
END:
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
return prop;
|
||||
}
|
||||
|
||||
|
||||
|
@ -126,14 +129,21 @@ BOOL WINAPI SetPropA( HWND hwnd, LPCSTR str, HANDLE handle )
|
|||
/* We need to create it */
|
||||
WND *pWnd = WIN_FindWndPtr( hwnd );
|
||||
if (!pWnd) return FALSE;
|
||||
if (!(prop = HeapAlloc( SystemHeap, 0, sizeof(*prop) ))) return FALSE;
|
||||
if (!(prop = HeapAlloc( SystemHeap, 0, sizeof(*prop) )))
|
||||
{
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
return FALSE;
|
||||
}
|
||||
if (!(prop->string = SEGPTR_STRDUP(str)))
|
||||
{
|
||||
HeapFree( SystemHeap, 0, prop );
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
prop->next = pWnd->pProp;
|
||||
pWnd->pProp = prop;
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
}
|
||||
prop->handle = handle;
|
||||
return TRUE;
|
||||
|
@ -207,6 +217,7 @@ HANDLE WINAPI RemovePropA( HWND hwnd, LPCSTR str )
|
|||
else if (LOWORD((*pprop)->string) == atom) break;
|
||||
}
|
||||
}
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
if (!*pprop) return 0;
|
||||
prop = *pprop;
|
||||
handle = prop->handle;
|
||||
|
@ -275,6 +286,7 @@ INT16 WINAPI EnumProps16( HWND16 hwnd, PROPENUMPROC16 func )
|
|||
ret = func( hwnd, SEGPTR_GET(prop->string), prop->handle );
|
||||
if (!ret) break;
|
||||
}
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -320,6 +332,7 @@ INT WINAPI EnumPropsExA(HWND hwnd, PROPENUMPROCEXA func, LPARAM lParam)
|
|||
ret = func( hwnd, prop->string, prop->handle, lParam );
|
||||
if (!ret) break;
|
||||
}
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -355,5 +368,6 @@ INT WINAPI EnumPropsExW(HWND hwnd, PROPENUMPROCEXW func, LPARAM lParam)
|
|||
prop->handle, lParam );
|
||||
if (!ret) break;
|
||||
}
|
||||
WIN_ReleaseWndPtr(pWnd);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -924,6 +924,7 @@ void QUEUE_ReceiveMessage( MESSAGEQUEUE *queue )
|
|||
smsg->lParam );
|
||||
|
||||
queue->GetMessageExtraInfoVal = extraInfo; /* Restore extra info */
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
TRACE(sendmsg,"result = %08x\n", (unsigned)result );
|
||||
}
|
||||
else WARN(sendmsg, "\trcm: bad hWnd\n");
|
||||
|
@ -1090,13 +1091,17 @@ static void QUEUE_WakeSomeone( UINT message )
|
|||
if( (wndPtr = WIN_FindWndPtr( hwnd )) )
|
||||
{
|
||||
hQueue = wndPtr->hmemTaskQ;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
}
|
||||
|
||||
if( (hwnd = GetSysModalWindow16()) )
|
||||
{
|
||||
if( (wndPtr = WIN_FindWndPtr( hwnd )) )
|
||||
{
|
||||
hQueue = wndPtr->hmemTaskQ;
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
}
|
||||
}
|
||||
|
||||
if (hQueue)
|
||||
|
@ -1309,10 +1314,13 @@ void WINAPI PostQuitMessage( INT exitCode )
|
|||
*/
|
||||
HTASK16 WINAPI GetWindowTask16( HWND16 hwnd )
|
||||
{
|
||||
HTASK16 retvalue;
|
||||
WND *wndPtr = WIN_FindWndPtr( hwnd );
|
||||
|
||||
if (!wndPtr) return 0;
|
||||
return QUEUE_GetQueueTask( wndPtr->hmemTaskQ );
|
||||
retvalue = QUEUE_GetQueueTask( wndPtr->hmemTaskQ );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
return retvalue;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -1321,12 +1329,14 @@ HTASK16 WINAPI GetWindowTask16( HWND16 hwnd )
|
|||
DWORD WINAPI GetWindowThreadProcessId( HWND hwnd, LPDWORD process )
|
||||
{
|
||||
HTASK16 htask;
|
||||
DWORD retvalue;
|
||||
TDB *tdb;
|
||||
|
||||
WND *wndPtr = WIN_FindWndPtr( hwnd );
|
||||
|
||||
if (!wndPtr) return 0;
|
||||
htask=QUEUE_GetQueueTask( wndPtr->hmemTaskQ );
|
||||
WIN_ReleaseWndPtr(wndPtr);
|
||||
tdb = (TDB*)GlobalLock16(htask);
|
||||
if (!tdb || !tdb->thdb) return 0;
|
||||
if (process) *process = (DWORD)tdb->thdb->process->server_pid;
|
||||
|
|
|
@ -236,7 +236,11 @@ INT WINAPI ScrollWindowEx( HWND hwnd, INT dx, INT dy,
|
|||
RECT rc, cliprc;
|
||||
WND* wnd = WIN_FindWndPtr( hwnd );
|
||||
|
||||
if( !wnd || !WIN_IsWindowDrawable( wnd, TRUE )) return ERROR;
|
||||
if( !wnd || !WIN_IsWindowDrawable( wnd, TRUE ))
|
||||
{
|
||||
retVal = ERROR;
|
||||
goto END;
|
||||
}
|
||||
|
||||
GetClientRect(hwnd, &rc);
|
||||
if (rect) IntersectRect(&rc, &rc, rect);
|
||||
|
@ -307,7 +311,7 @@ rc.left, rc.top, rc.right, rc.bottom, (UINT16)flags );
|
|||
{
|
||||
RECT r;
|
||||
WND* w;
|
||||
for( w = wnd->child; w; w = w->next )
|
||||
for( w =WIN_LockWndPtr(wnd->child); w; WIN_UpdateWndPtr(&w, w->next))
|
||||
{
|
||||
CONV_RECT16TO32( &w->rectWindow, &r );
|
||||
if( IntersectRect(&r, &r, &rc) )
|
||||
|
@ -332,5 +336,7 @@ rc.left, rc.top, rc.right, rc.bottom, (UINT16)flags );
|
|||
DeleteObject( hrgnClip );
|
||||
DeleteObject( hrgnTemp );
|
||||
}
|
||||
END:
|
||||
WIN_ReleaseWndPtr(wnd);
|
||||
return retVal;
|
||||
}
|
||||
|
|
737
windows/win.c
737
windows/win.c
File diff suppressed because it is too large
Load Diff
427
windows/winpos.c
427
windows/winpos.c
File diff suppressed because it is too large
Load Diff
|
@ -391,9 +391,13 @@ WINDOWPROCTYPE WINPROC_GetProcType( HWINDOWPROC proc )
|
|||
* Return TRUE if the lparam is a string
|
||||
*/
|
||||
BOOL WINPROC_TestCBForStr ( HWND hwnd )
|
||||
{ WND * wnd = WIN_FindWndPtr(hwnd);
|
||||
return ( !(LOWORD(wnd->dwStyle) & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) ||
|
||||
{
|
||||
BOOL retvalue;
|
||||
WND * wnd = WIN_FindWndPtr(hwnd);
|
||||
retvalue = ( !(LOWORD(wnd->dwStyle) & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) ||
|
||||
(LOWORD(wnd->dwStyle) & CBS_HASSTRINGS) );
|
||||
WIN_ReleaseWndPtr(wnd);
|
||||
return retvalue;
|
||||
}
|
||||
/**********************************************************************
|
||||
* WINPROC_TestLBForStr
|
||||
|
@ -401,9 +405,14 @@ BOOL WINPROC_TestCBForStr ( HWND hwnd )
|
|||
* Return TRUE if the lparam is a string
|
||||
*/
|
||||
BOOL WINPROC_TestLBForStr ( HWND hwnd )
|
||||
{ WND * wnd = WIN_FindWndPtr(hwnd);
|
||||
return ( !(LOWORD(wnd->dwStyle) & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE)) ||
|
||||
{
|
||||
BOOL retvalue;
|
||||
WND * wnd = WIN_FindWndPtr(hwnd);
|
||||
retvalue = ( !(LOWORD(wnd->dwStyle) & (LBS_OWNERDRAWFIXED | LBS_OWNERDRAWVARIABLE)) ||
|
||||
(LOWORD(wnd->dwStyle) & LBS_HASSTRINGS) );
|
||||
WIN_ReleaseWndPtr(wnd);
|
||||
return retvalue;
|
||||
|
||||
}
|
||||
/**********************************************************************
|
||||
* WINPROC_MapMsg32ATo32W
|
||||
|
@ -1681,7 +1690,9 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
|
|||
*plparam = MAKELPARAM( HIWORD(wParam32), (HMENU16)*plparam );
|
||||
return 0;
|
||||
case WM_MDIACTIVATE:
|
||||
if( WIDGETS_IsControl(WIN_FindWndPtr(hwnd), BIC32_MDICLIENT) )
|
||||
{
|
||||
WND *tempWnd = WIN_FindWndPtr(hwnd);
|
||||
if( WIDGETS_IsControl(tempWnd, BIC32_MDICLIENT) )
|
||||
{
|
||||
*pwparam16 = (HWND)wParam32;
|
||||
*plparam = 0;
|
||||
|
@ -1691,6 +1702,8 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32,
|
|||
*pwparam16 = ((HWND)*plparam == hwnd);
|
||||
*plparam = MAKELPARAM( (HWND16)LOWORD(*plparam),
|
||||
(HWND16)LOWORD(wParam32) );
|
||||
}
|
||||
WIN_ReleaseWndPtr(tempWnd);
|
||||
}
|
||||
return 0;
|
||||
case WM_NCCALCSIZE:
|
||||
|
|
|
@ -208,9 +208,8 @@ void X11DRV_CLIPBOARD_SetClipboardData(UINT wFormat)
|
|||
if( !selectionAcquired &&
|
||||
(wFormat == CF_TEXT || wFormat == CF_OEMTEXT) )
|
||||
{
|
||||
owner = X11DRV_WND_FindXWindow(
|
||||
WIN_FindWndPtr( hWndClipWindow ? hWndClipWindow : AnyPopup() )
|
||||
);
|
||||
WND *tmpWnd = WIN_FindWndPtr( hWndClipWindow ? hWndClipWindow : AnyPopup() );
|
||||
owner = X11DRV_WND_FindXWindow(tmpWnd );
|
||||
|
||||
TSXSetSelectionOwner(display,XA_PRIMARY, owner, CurrentTime);
|
||||
if( TSXGetSelectionOwner(display,XA_PRIMARY) == owner )
|
||||
|
@ -221,6 +220,7 @@ void X11DRV_CLIPBOARD_SetClipboardData(UINT wFormat)
|
|||
TRACE(clipboard,"Grabbed X selection, owner=(%08x)\n",
|
||||
(unsigned) owner);
|
||||
}
|
||||
WIN_ReleaseWndPtr(tmpWnd);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -230,6 +230,7 @@ void X11DRV_CLIPBOARD_SetClipboardData(UINT wFormat)
|
|||
BOOL X11DRV_CLIPBOARD_RequestSelection()
|
||||
{
|
||||
HWND hWnd = (hWndClipWindow) ? hWndClipWindow : GetActiveWindow();
|
||||
WND *tmpWnd = WIN_FindWndPtr(hWnd);
|
||||
|
||||
if( selectionAcquired )
|
||||
return TRUE;
|
||||
|
@ -244,9 +245,11 @@ BOOL X11DRV_CLIPBOARD_RequestSelection()
|
|||
|
||||
TSXConvertSelection(display, XA_PRIMARY, XA_STRING,
|
||||
TSXInternAtom(display, "PRIMARY_TEXT", False),
|
||||
X11DRV_WND_FindXWindow( WIN_FindWndPtr( hWnd ) ),
|
||||
X11DRV_WND_FindXWindow(tmpWnd ),
|
||||
CurrentTime);
|
||||
|
||||
WIN_ReleaseWndPtr(tmpWnd);
|
||||
|
||||
/* wait until SelectionNotify is processed
|
||||
*
|
||||
* FIXME: Use TSXCheckTypedWindowEvent() instead ( same in the
|
||||
|
|
|
@ -1205,6 +1205,8 @@ static void EVENT_DropFromOffiX( WND *pWnd, XClientMessageEvent *event )
|
|||
if( p_data ) TSXFree(p_data);
|
||||
|
||||
} /* WS_EX_ACCEPTFILES */
|
||||
|
||||
WIN_ReleaseWndPtr(pDropWnd);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
@ -1349,6 +1351,7 @@ static void EVENT_DropURLs( WND *pWnd, XClientMessageEvent *event )
|
|||
(WPARAM16)hDrop.h16, 0L );
|
||||
}
|
||||
}
|
||||
WIN_ReleaseWndPtr(pDropWnd);
|
||||
}
|
||||
if( p_data ) TSXFree(p_data);
|
||||
}
|
||||
|
@ -1413,9 +1416,11 @@ void EVENT_EnterNotify( WND *pWnd, XCrossingEvent *event )
|
|||
void EVENT_MapNotify( HWND hWnd, XMapEvent *event )
|
||||
{
|
||||
HWND hwndFocus = GetFocus();
|
||||
WND *tmpWnd = WIN_FindWndPtr(hwndFocus);
|
||||
|
||||
if (hwndFocus && IsChild( hWnd, hwndFocus ))
|
||||
X11DRV_WND_SetFocus( WIN_FindWndPtr( hwndFocus ) );
|
||||
X11DRV_WND_SetFocus(tmpWnd );
|
||||
WIN_ReleaseWndPtr(tmpWnd);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -154,12 +154,15 @@ static BOOL X11DRV_MOUSE_DoSetCursor( CURSORICONINFO *ptr )
|
|||
HWND hwnd = GetWindow( GetDesktopWindow(), GW_CHILD );
|
||||
while(hwnd)
|
||||
{
|
||||
Window win = X11DRV_WND_FindXWindow( WIN_FindWndPtr( hwnd ) );
|
||||
WND *tmpWnd = WIN_FindWndPtr(hwnd);
|
||||
Window win = X11DRV_WND_FindXWindow(tmpWnd );
|
||||
if (win && win!=DefaultRootWindow(display))
|
||||
XDefineCursor( display, win, cursor );
|
||||
hwnd = GetWindow( hwnd, GW_HWNDNEXT );
|
||||
WIN_ReleaseWndPtr(tmpWnd);
|
||||
}
|
||||
}
|
||||
WIN_ReleaseDesktop();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -234,8 +234,10 @@ BOOL X11DRV_WND_CreateWindow(WND *wndPtr, CLASS *classPtr, CREATESTRUCTA *cs, BO
|
|||
|
||||
if (cs->hwndParent) /* Get window owner */
|
||||
{
|
||||
Window win = X11DRV_WND_FindXWindow( WIN_FindWndPtr( cs->hwndParent ) );
|
||||
WND *tmpWnd = WIN_FindWndPtr(cs->hwndParent);
|
||||
Window win = X11DRV_WND_FindXWindow( tmpWnd );
|
||||
if (win) TSXSetTransientForHint( display, X11DRV_WND_GetXWindow(wndPtr), win );
|
||||
WIN_ReleaseWndPtr(tmpWnd);
|
||||
}
|
||||
X11DRV_WND_RegisterWindow( wndPtr );
|
||||
}
|
||||
|
@ -264,7 +266,9 @@ BOOL X11DRV_WND_DestroyWindow(WND *wndPtr)
|
|||
*/
|
||||
WND *X11DRV_WND_SetParent(WND *wndPtr, WND *pWndParent)
|
||||
{
|
||||
if( wndPtr && pWndParent && (wndPtr != WIN_GetDesktop()) )
|
||||
WND *pDesktop = WIN_GetDesktop();
|
||||
|
||||
if( wndPtr && pWndParent && (wndPtr != pDesktop) )
|
||||
{
|
||||
WND* pWndPrev = wndPtr->parent;
|
||||
|
||||
|
@ -284,7 +288,7 @@ WND *X11DRV_WND_SetParent(WND *wndPtr, WND *pWndParent)
|
|||
/* Create an X counterpart for reparented top-level windows
|
||||
* when not in the desktop mode. */
|
||||
|
||||
if( pWndParent == WIN_GetDesktop () )
|
||||
if( pWndParent == pDesktop )
|
||||
{
|
||||
wndPtr->dwStyle &= ~WS_CHILD;
|
||||
wndPtr->wIDmenu = 0;
|
||||
|
@ -325,8 +329,10 @@ WND *X11DRV_WND_SetParent(WND *wndPtr, WND *pWndParent)
|
|||
}
|
||||
WIN_LinkWindow(wndPtr->hwndSelf, HWND_TOP);
|
||||
}
|
||||
WIN_ReleaseDesktop();
|
||||
return pWndPrev;
|
||||
} /* failure */
|
||||
WIN_ReleaseDesktop();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -339,7 +345,7 @@ WND *X11DRV_WND_SetParent(WND *wndPtr, WND *pWndParent)
|
|||
void X11DRV_WND_ForceWindowRaise(WND *wndPtr)
|
||||
{
|
||||
XWindowChanges winChanges;
|
||||
WND *wndPrev;
|
||||
WND *wndPrev,*pDesktop = WIN_GetDesktop();
|
||||
|
||||
if( !wndPtr || !X11DRV_WND_GetXWindow(wndPtr) || (wndPtr->flags & WIN_MANAGED) )
|
||||
return;
|
||||
|
@ -354,11 +360,12 @@ void X11DRV_WND_ForceWindowRaise(WND *wndPtr)
|
|||
if (X11DRV_WND_GetXWindow(wndPtr))
|
||||
TSXReconfigureWMWindow( display, X11DRV_WND_GetXWindow(wndPtr), 0,
|
||||
CWStackMode, &winChanges );
|
||||
wndPrev = WIN_GetDesktop()->child;
|
||||
wndPrev = pDesktop->child;
|
||||
if (wndPrev == wndPtr) break;
|
||||
while (wndPrev && (wndPrev->next != wndPtr)) wndPrev = wndPrev->next;
|
||||
wndPtr = wndPrev;
|
||||
}
|
||||
WIN_ReleaseDesktop();
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -460,6 +467,8 @@ void X11DRV_WND_SetWindowPos(WND *wndPtr, const WINDOWPOS *winpos, BOOL bSMC_SET
|
|||
|
||||
TSXRestackWindows(display, stack, 2);
|
||||
changeMask &= ~CWStackMode;
|
||||
|
||||
WIN_ReleaseWndPtr(insertPtr);
|
||||
}
|
||||
}
|
||||
if (changeMask)
|
||||
|
@ -472,6 +481,7 @@ void X11DRV_WND_SetWindowPos(WND *wndPtr, const WINDOWPOS *winpos, BOOL bSMC_SET
|
|||
{
|
||||
if(X11DRV_WND_GetXWindow(wndPtr)) TSXMapWindow( display, X11DRV_WND_GetXWindow(wndPtr) );
|
||||
}
|
||||
WIN_ReleaseWndPtr(winposPtr);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
|
|
Loading…
Reference in New Issue