Removed the gotos from the WndProcs, always use a small wrapper that
locks the window, calls the real wndproc, unlocks the window.
This commit is contained in:
parent
f78e41a3dc
commit
9aded5135c
|
@ -73,15 +73,16 @@ static WORD checkBoxWidth = 0, checkBoxHeight = 0;
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* ButtonWndProc
|
* ButtonWndProc_locked
|
||||||
|
*
|
||||||
|
* Called with window lock held.
|
||||||
*/
|
*/
|
||||||
LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
static inline LRESULT WINAPI ButtonWndProc_locked(WND* wndPtr, UINT uMsg,
|
||||||
WPARAM wParam, LPARAM lParam )
|
WPARAM wParam, LPARAM lParam )
|
||||||
{
|
{
|
||||||
RECT rect;
|
RECT rect;
|
||||||
LRESULT retvalue;
|
HWND hWnd = wndPtr->hwndSelf;
|
||||||
POINT pt;
|
POINT pt;
|
||||||
WND *wndPtr = WIN_FindWndPtr(hWnd);
|
|
||||||
BUTTONINFO *infoPtr = (BUTTONINFO *)wndPtr->wExtra;
|
BUTTONINFO *infoPtr = (BUTTONINFO *)wndPtr->wExtra;
|
||||||
LONG style = wndPtr->dwStyle & 0x0f;
|
LONG style = wndPtr->dwStyle & 0x0f;
|
||||||
HANDLE oldHbitmap;
|
HANDLE oldHbitmap;
|
||||||
|
@ -92,7 +93,6 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
||||||
switch (uMsg)
|
switch (uMsg)
|
||||||
{
|
{
|
||||||
case WM_GETDLGCODE:
|
case WM_GETDLGCODE:
|
||||||
WIN_ReleaseWndPtr(wndPtr);
|
|
||||||
switch(style)
|
switch(style)
|
||||||
{
|
{
|
||||||
case BS_PUSHBUTTON: return DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON;
|
case BS_PUSHBUTTON: return DLGC_BUTTON | DLGC_UNDEFPUSHBUTTON;
|
||||||
|
@ -123,11 +123,9 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
||||||
infoPtr->state = BUTTON_UNCHECKED;
|
infoPtr->state = BUTTON_UNCHECKED;
|
||||||
infoPtr->hFont = 0;
|
infoPtr->hFont = 0;
|
||||||
infoPtr->hImage = NULL;
|
infoPtr->hImage = NULL;
|
||||||
WIN_ReleaseWndPtr(wndPtr);
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WM_ERASEBKGND:
|
case WM_ERASEBKGND:
|
||||||
WIN_ReleaseWndPtr(wndPtr);
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
|
@ -184,7 +182,6 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_NCHITTEST:
|
case WM_NCHITTEST:
|
||||||
WIN_ReleaseWndPtr(wndPtr);
|
|
||||||
if(style == BS_GROUPBOX) return HTTRANSPARENT;
|
if(style == BS_GROUPBOX) return HTTRANSPARENT;
|
||||||
return DefWindowProcA( hWnd, uMsg, wParam, lParam );
|
return DefWindowProcA( hWnd, uMsg, wParam, lParam );
|
||||||
|
|
||||||
|
@ -192,7 +189,6 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
||||||
DEFWND_SetText( wndPtr, (LPCSTR)lParam );
|
DEFWND_SetText( wndPtr, (LPCSTR)lParam );
|
||||||
if( wndPtr->dwStyle & WS_VISIBLE )
|
if( wndPtr->dwStyle & WS_VISIBLE )
|
||||||
PAINT_BUTTON( wndPtr, style, ODA_DRAWENTIRE );
|
PAINT_BUTTON( wndPtr, style, ODA_DRAWENTIRE );
|
||||||
WIN_ReleaseWndPtr(wndPtr);
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WM_SETFONT:
|
case WM_SETFONT:
|
||||||
|
@ -202,16 +198,12 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_GETFONT:
|
case WM_GETFONT:
|
||||||
retvalue = infoPtr->hFont;
|
return infoPtr->hFont;
|
||||||
WIN_ReleaseWndPtr(wndPtr);
|
|
||||||
return retvalue;
|
|
||||||
|
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
infoPtr->state |= BUTTON_HASFOCUS;
|
infoPtr->state |= BUTTON_HASFOCUS;
|
||||||
if (style == BS_AUTORADIOBUTTON)
|
if (style == BS_AUTORADIOBUTTON)
|
||||||
{
|
|
||||||
SendMessageA( hWnd, BM_SETCHECK, 1, 0 );
|
SendMessageA( hWnd, BM_SETCHECK, 1, 0 );
|
||||||
}
|
|
||||||
PAINT_BUTTON( wndPtr, style, ODA_FOCUS );
|
PAINT_BUTTON( wndPtr, style, ODA_FOCUS );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -238,19 +230,14 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
||||||
oldHbitmap = infoPtr->hImage;
|
oldHbitmap = infoPtr->hImage;
|
||||||
if(wndPtr->dwStyle & BS_BITMAP)
|
if(wndPtr->dwStyle & BS_BITMAP)
|
||||||
infoPtr->hImage = (HANDLE) lParam;
|
infoPtr->hImage = (HANDLE) lParam;
|
||||||
WIN_ReleaseWndPtr(wndPtr);
|
|
||||||
return oldHbitmap;
|
return oldHbitmap;
|
||||||
|
|
||||||
case BM_GETIMAGE:
|
case BM_GETIMAGE:
|
||||||
retvalue = infoPtr->hImage;
|
return infoPtr->hImage;
|
||||||
WIN_ReleaseWndPtr(wndPtr);
|
|
||||||
return retvalue;
|
|
||||||
|
|
||||||
case BM_GETCHECK16:
|
case BM_GETCHECK16:
|
||||||
case BM_GETCHECK:
|
case BM_GETCHECK:
|
||||||
retvalue = infoPtr->state & 3;
|
return infoPtr->state & 3;
|
||||||
WIN_ReleaseWndPtr(wndPtr);
|
|
||||||
return retvalue;
|
|
||||||
|
|
||||||
case BM_SETCHECK16:
|
case BM_SETCHECK16:
|
||||||
case BM_SETCHECK:
|
case BM_SETCHECK:
|
||||||
|
@ -273,9 +260,7 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
||||||
|
|
||||||
case BM_GETSTATE16:
|
case BM_GETSTATE16:
|
||||||
case BM_GETSTATE:
|
case BM_GETSTATE:
|
||||||
retvalue = infoPtr->state;
|
return infoPtr->state;
|
||||||
WIN_ReleaseWndPtr(wndPtr);
|
|
||||||
return retvalue;
|
|
||||||
|
|
||||||
case BM_SETSTATE16:
|
case BM_SETSTATE16:
|
||||||
case BM_SETSTATE:
|
case BM_SETSTATE:
|
||||||
|
@ -293,13 +278,28 @@ LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
WIN_ReleaseWndPtr(wndPtr);
|
|
||||||
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
return DefWindowProcA(hWnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
WIN_ReleaseWndPtr(wndPtr);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* ButtonWndProc
|
||||||
|
* The button window procedure. This is just a wrapper which locks
|
||||||
|
* the passed HWND and calls the real window procedure (with a WND*
|
||||||
|
* pointer pointing to the locked windowstructure).
|
||||||
|
*/
|
||||||
|
LRESULT WINAPI ButtonWndProc( HWND hWnd, UINT uMsg,
|
||||||
|
WPARAM wParam, LPARAM lParam )
|
||||||
|
{
|
||||||
|
LRESULT res;
|
||||||
|
WND *wndPtr = WIN_FindWndPtr(hWnd);
|
||||||
|
|
||||||
|
res = ButtonWndProc_locked(wndPtr,uMsg,wParam,lParam);
|
||||||
|
|
||||||
|
WIN_ReleaseWndPtr(wndPtr);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* Push Button Functions
|
* Push Button Functions
|
||||||
|
|
228
controls/combo.c
228
controls/combo.c
|
@ -1679,19 +1679,16 @@ static void COMBO_MouseMove( LPHEADCOMBO lphc, WPARAM wParam, LPARAM lParam )
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* ComboWndProc
|
* ComboWndProc_locked
|
||||||
*
|
*
|
||||||
* http://www.microsoft.com/msdn/sdk/platforms/doc/sdk/win32/ctrl/src/combobox_15.htm
|
* http://www.microsoft.com/msdn/sdk/platforms/doc/sdk/win32/ctrl/src/combobox_15.htm
|
||||||
*/
|
*/
|
||||||
LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
static inline LRESULT WINAPI ComboWndProc_locked( WND* pWnd, UINT message,
|
||||||
WPARAM wParam, LPARAM lParam )
|
WPARAM wParam, LPARAM lParam )
|
||||||
{
|
{
|
||||||
LRESULT retvalue;
|
if( pWnd ) {
|
||||||
WND* pWnd = WIN_FindWndPtr(hwnd);
|
|
||||||
|
|
||||||
if( pWnd )
|
|
||||||
{
|
|
||||||
LPHEADCOMBO lphc = CB_GETPTR(pWnd);
|
LPHEADCOMBO lphc = CB_GETPTR(pWnd);
|
||||||
|
HWND hwnd = pWnd->hwndSelf;
|
||||||
|
|
||||||
TRACE(combo, "[%04x]: msg %s wp %08x lp %08lx\n",
|
TRACE(combo, "[%04x]: msg %s wp %08x lp %08lx\n",
|
||||||
pWnd->hwndSelf, SPY_GetMsgName(message), wParam, lParam );
|
pWnd->hwndSelf, SPY_GetMsgName(message), wParam, lParam );
|
||||||
|
@ -1703,15 +1700,13 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
||||||
/* System messages */
|
/* System messages */
|
||||||
|
|
||||||
case WM_NCCREATE:
|
case WM_NCCREATE:
|
||||||
retvalue = COMBO_NCCreate(pWnd, lParam);
|
return COMBO_NCCreate(pWnd, lParam);
|
||||||
goto END;
|
|
||||||
case WM_NCDESTROY:
|
case WM_NCDESTROY:
|
||||||
COMBO_NCDestroy(lphc);
|
COMBO_NCDestroy(lphc);
|
||||||
break;
|
break;/* -> DefWindowProc */
|
||||||
|
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
retvalue = COMBO_Create(lphc, pWnd, lParam);
|
return COMBO_Create(lphc, pWnd, lParam);
|
||||||
goto END;
|
|
||||||
|
|
||||||
case WM_PRINTCLIENT:
|
case WM_PRINTCLIENT:
|
||||||
if (lParam & PRF_ERASEBKGND)
|
if (lParam & PRF_ERASEBKGND)
|
||||||
|
@ -1720,50 +1715,39 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
||||||
/* Fallthrough */
|
/* Fallthrough */
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
/* wParam may contain a valid HDC! */
|
/* wParam may contain a valid HDC! */
|
||||||
retvalue = COMBO_Paint(lphc, wParam);
|
return COMBO_Paint(lphc, wParam);
|
||||||
goto END;
|
|
||||||
case WM_ERASEBKGND:
|
case WM_ERASEBKGND:
|
||||||
retvalue = COMBO_EraseBackground(hwnd, lphc, wParam);
|
return COMBO_EraseBackground(hwnd, lphc, wParam);
|
||||||
goto END;
|
|
||||||
case WM_GETDLGCODE:
|
case WM_GETDLGCODE:
|
||||||
retvalue = (LRESULT)(DLGC_WANTARROWS | DLGC_WANTCHARS);
|
return (LRESULT)(DLGC_WANTARROWS | DLGC_WANTCHARS);
|
||||||
goto END;
|
|
||||||
case WM_WINDOWPOSCHANGING:
|
case WM_WINDOWPOSCHANGING:
|
||||||
retvalue = COMBO_WindowPosChanging(hwnd, lphc, (LPWINDOWPOS)lParam);
|
return COMBO_WindowPosChanging(hwnd, lphc, (LPWINDOWPOS)lParam);
|
||||||
goto END;
|
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
if( lphc->hWndLBox &&
|
if( lphc->hWndLBox &&
|
||||||
!(lphc->wState & CBF_NORESIZE) ) COMBO_Size( lphc );
|
!(lphc->wState & CBF_NORESIZE) ) COMBO_Size( lphc );
|
||||||
retvalue = TRUE;
|
return TRUE;
|
||||||
goto END;
|
|
||||||
case WM_SETFONT:
|
case WM_SETFONT:
|
||||||
COMBO_Font( lphc, (HFONT16)wParam, (BOOL)lParam );
|
COMBO_Font( lphc, (HFONT16)wParam, (BOOL)lParam );
|
||||||
retvalue = TRUE;
|
return TRUE;
|
||||||
goto END;
|
|
||||||
case WM_GETFONT:
|
case WM_GETFONT:
|
||||||
retvalue = (LRESULT)lphc->hFont;
|
return (LRESULT)lphc->hFont;
|
||||||
goto END;
|
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
if( lphc->wState & CBF_EDIT )
|
if( lphc->wState & CBF_EDIT )
|
||||||
SetFocus( lphc->hWndEdit );
|
SetFocus( lphc->hWndEdit );
|
||||||
else
|
else
|
||||||
COMBO_SetFocus( lphc );
|
COMBO_SetFocus( lphc );
|
||||||
retvalue = TRUE;
|
return TRUE;
|
||||||
goto END;
|
|
||||||
case WM_KILLFOCUS:
|
case WM_KILLFOCUS:
|
||||||
#define hwndFocus ((HWND16)wParam)
|
#define hwndFocus ((HWND16)wParam)
|
||||||
if( !hwndFocus ||
|
if( !hwndFocus ||
|
||||||
(hwndFocus != lphc->hWndEdit && hwndFocus != lphc->hWndLBox ))
|
(hwndFocus != lphc->hWndEdit && hwndFocus != lphc->hWndLBox ))
|
||||||
COMBO_KillFocus( lphc );
|
COMBO_KillFocus( lphc );
|
||||||
#undef hwndFocus
|
#undef hwndFocus
|
||||||
retvalue = TRUE;
|
return TRUE;
|
||||||
goto END;
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
retvalue = COMBO_Command( lphc, wParam, (HWND)lParam );
|
return COMBO_Command( lphc, wParam, (HWND)lParam );
|
||||||
goto END;
|
|
||||||
case WM_GETTEXT:
|
case WM_GETTEXT:
|
||||||
retvalue = COMBO_GetText( lphc, (UINT)wParam, (LPSTR)lParam );
|
return COMBO_GetText( lphc, (UINT)wParam, (LPSTR)lParam );
|
||||||
goto END;
|
|
||||||
case WM_SETTEXT:
|
case WM_SETTEXT:
|
||||||
case WM_GETTEXTLENGTH:
|
case WM_GETTEXTLENGTH:
|
||||||
case WM_CLEAR:
|
case WM_CLEAR:
|
||||||
|
@ -1771,24 +1755,18 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
||||||
case WM_PASTE:
|
case WM_PASTE:
|
||||||
case WM_COPY:
|
case WM_COPY:
|
||||||
if( lphc->wState & CBF_EDIT )
|
if( lphc->wState & CBF_EDIT )
|
||||||
{
|
return SendMessageA( lphc->hWndEdit, message, wParam, lParam );
|
||||||
retvalue = SendMessageA( lphc->hWndEdit, message, wParam, lParam );
|
return CB_ERR;
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
retvalue = CB_ERR;
|
|
||||||
goto END;
|
|
||||||
case WM_DRAWITEM:
|
case WM_DRAWITEM:
|
||||||
case WM_DELETEITEM:
|
case WM_DELETEITEM:
|
||||||
case WM_COMPAREITEM:
|
case WM_COMPAREITEM:
|
||||||
case WM_MEASUREITEM:
|
case WM_MEASUREITEM:
|
||||||
retvalue = COMBO_ItemOp( lphc, message, wParam, lParam );
|
return COMBO_ItemOp( lphc, message, wParam, lParam );
|
||||||
goto END;
|
|
||||||
case WM_ENABLE:
|
case WM_ENABLE:
|
||||||
if( lphc->wState & CBF_EDIT )
|
if( lphc->wState & CBF_EDIT )
|
||||||
EnableWindow( lphc->hWndEdit, (BOOL)wParam );
|
EnableWindow( lphc->hWndEdit, (BOOL)wParam );
|
||||||
EnableWindow( lphc->hWndLBox, (BOOL)wParam );
|
EnableWindow( lphc->hWndLBox, (BOOL)wParam );
|
||||||
retvalue = TRUE;
|
return TRUE;
|
||||||
goto END;
|
|
||||||
case WM_SETREDRAW:
|
case WM_SETREDRAW:
|
||||||
if( wParam )
|
if( wParam )
|
||||||
lphc->wState &= ~CBF_NOREDRAW;
|
lphc->wState &= ~CBF_NOREDRAW;
|
||||||
|
@ -1798,123 +1776,95 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
||||||
if( lphc->wState & CBF_EDIT )
|
if( lphc->wState & CBF_EDIT )
|
||||||
SendMessageA( lphc->hWndEdit, message, wParam, lParam );
|
SendMessageA( lphc->hWndEdit, message, wParam, lParam );
|
||||||
SendMessageA( lphc->hWndLBox, message, wParam, lParam );
|
SendMessageA( lphc->hWndLBox, message, wParam, lParam );
|
||||||
retvalue = 0;
|
return 0;
|
||||||
goto END;
|
|
||||||
case WM_SYSKEYDOWN:
|
case WM_SYSKEYDOWN:
|
||||||
if( KEYDATA_ALT & HIWORD(lParam) )
|
if( KEYDATA_ALT & HIWORD(lParam) )
|
||||||
if( wParam == VK_UP || wParam == VK_DOWN )
|
if( wParam == VK_UP || wParam == VK_DOWN )
|
||||||
COMBO_FlipListbox( lphc, TRUE );
|
COMBO_FlipListbox( lphc, TRUE );
|
||||||
break;
|
break;/* -> DefWindowProc */
|
||||||
|
|
||||||
case WM_CHAR:
|
case WM_CHAR:
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
if( lphc->wState & CBF_EDIT )
|
if( lphc->wState & CBF_EDIT )
|
||||||
retvalue = SendMessageA( lphc->hWndEdit, message, wParam, lParam );
|
return SendMessageA( lphc->hWndEdit, message, wParam, lParam );
|
||||||
else
|
else
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, message, wParam, lParam );
|
return SendMessageA( lphc->hWndLBox, message, wParam, lParam );
|
||||||
goto END;
|
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
if( !(lphc->wState & CBF_FOCUSED) ) SetFocus( lphc->self->hwndSelf );
|
if( !(lphc->wState & CBF_FOCUSED) ) SetFocus( lphc->self->hwndSelf );
|
||||||
if( lphc->wState & CBF_FOCUSED ) COMBO_LButtonDown( lphc, lParam );
|
if( lphc->wState & CBF_FOCUSED ) COMBO_LButtonDown( lphc, lParam );
|
||||||
retvalue = TRUE;
|
return TRUE;
|
||||||
goto END;
|
|
||||||
case WM_LBUTTONUP:
|
case WM_LBUTTONUP:
|
||||||
COMBO_LButtonUp( lphc, lParam );
|
COMBO_LButtonUp( lphc, lParam );
|
||||||
retvalue = TRUE;
|
return TRUE;
|
||||||
goto END;
|
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
if( lphc->wState & CBF_CAPTURE )
|
if( lphc->wState & CBF_CAPTURE )
|
||||||
COMBO_MouseMove( lphc, wParam, lParam );
|
COMBO_MouseMove( lphc, wParam, lParam );
|
||||||
retvalue = TRUE;
|
return TRUE;
|
||||||
goto END;
|
|
||||||
/* Combo messages */
|
/* Combo messages */
|
||||||
|
|
||||||
case CB_ADDSTRING16:
|
case CB_ADDSTRING16:
|
||||||
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||||
case CB_ADDSTRING:
|
case CB_ADDSTRING:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_ADDSTRING, 0, lParam);
|
return SendMessageA( lphc->hWndLBox, LB_ADDSTRING, 0, lParam);
|
||||||
goto END;
|
|
||||||
case CB_INSERTSTRING16:
|
case CB_INSERTSTRING16:
|
||||||
wParam = (INT)(INT16)wParam;
|
wParam = (INT)(INT16)wParam;
|
||||||
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||||
case CB_INSERTSTRING:
|
case CB_INSERTSTRING:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam);
|
return SendMessageA( lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam);
|
||||||
goto END;
|
|
||||||
case CB_DELETESTRING16:
|
case CB_DELETESTRING16:
|
||||||
case CB_DELETESTRING:
|
case CB_DELETESTRING:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_DELETESTRING, wParam, 0);
|
return SendMessageA( lphc->hWndLBox, LB_DELETESTRING, wParam, 0);
|
||||||
goto END;
|
|
||||||
case CB_SELECTSTRING16:
|
case CB_SELECTSTRING16:
|
||||||
wParam = (INT)(INT16)wParam;
|
wParam = (INT)(INT16)wParam;
|
||||||
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||||
case CB_SELECTSTRING:
|
case CB_SELECTSTRING:
|
||||||
retvalue = COMBO_SelectString( lphc, (INT)wParam, (LPSTR)lParam );
|
return COMBO_SelectString( lphc, (INT)wParam, (LPSTR)lParam );
|
||||||
goto END;
|
|
||||||
case CB_FINDSTRING16:
|
case CB_FINDSTRING16:
|
||||||
wParam = (INT)(INT16)wParam;
|
wParam = (INT)(INT16)wParam;
|
||||||
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||||
case CB_FINDSTRING:
|
case CB_FINDSTRING:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_FINDSTRING, wParam, lParam);
|
return SendMessageA( lphc->hWndLBox, LB_FINDSTRING, wParam, lParam);
|
||||||
goto END;
|
|
||||||
case CB_FINDSTRINGEXACT16:
|
case CB_FINDSTRINGEXACT16:
|
||||||
wParam = (INT)(INT16)wParam;
|
wParam = (INT)(INT16)wParam;
|
||||||
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||||
case CB_FINDSTRINGEXACT:
|
case CB_FINDSTRINGEXACT:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_FINDSTRINGEXACT,
|
return SendMessageA( lphc->hWndLBox, LB_FINDSTRINGEXACT,
|
||||||
wParam, lParam );
|
wParam, lParam );
|
||||||
goto END;
|
|
||||||
case CB_SETITEMHEIGHT16:
|
case CB_SETITEMHEIGHT16:
|
||||||
wParam = (INT)(INT16)wParam; /* signed integer */
|
wParam = (INT)(INT16)wParam; /* signed integer */
|
||||||
case CB_SETITEMHEIGHT:
|
case CB_SETITEMHEIGHT:
|
||||||
retvalue = COMBO_SetItemHeight( lphc, (INT)wParam, (INT)lParam);
|
return COMBO_SetItemHeight( lphc, (INT)wParam, (INT)lParam);
|
||||||
goto END;
|
|
||||||
case CB_GETITEMHEIGHT16:
|
case CB_GETITEMHEIGHT16:
|
||||||
wParam = (INT)(INT16)wParam;
|
wParam = (INT)(INT16)wParam;
|
||||||
case CB_GETITEMHEIGHT:
|
case CB_GETITEMHEIGHT:
|
||||||
if( (INT)wParam >= 0 ) /* listbox item */
|
if( (INT)wParam >= 0 ) /* listbox item */
|
||||||
{
|
return SendMessageA( lphc->hWndLBox, LB_GETITEMHEIGHT, wParam, 0);
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETITEMHEIGHT, wParam, 0);
|
return CBGetTextAreaHeight(hwnd, lphc);
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
retvalue = CBGetTextAreaHeight(hwnd, lphc);
|
|
||||||
goto END;
|
|
||||||
case CB_RESETCONTENT16:
|
case CB_RESETCONTENT16:
|
||||||
case CB_RESETCONTENT:
|
case CB_RESETCONTENT:
|
||||||
SendMessageA( lphc->hWndLBox, LB_RESETCONTENT, 0, 0 );
|
SendMessageA( lphc->hWndLBox, LB_RESETCONTENT, 0, 0 );
|
||||||
InvalidateRect(CB_HWND(lphc), NULL, TRUE);
|
InvalidateRect(CB_HWND(lphc), NULL, TRUE);
|
||||||
retvalue = TRUE;
|
return TRUE;
|
||||||
goto END;
|
|
||||||
case CB_INITSTORAGE:
|
case CB_INITSTORAGE:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_INITSTORAGE, wParam, lParam);
|
return SendMessageA( lphc->hWndLBox, LB_INITSTORAGE, wParam, lParam);
|
||||||
goto END;
|
|
||||||
case CB_GETHORIZONTALEXTENT:
|
case CB_GETHORIZONTALEXTENT:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETHORIZONTALEXTENT, 0, 0);
|
return SendMessageA( lphc->hWndLBox, LB_GETHORIZONTALEXTENT, 0, 0);
|
||||||
goto END;
|
|
||||||
case CB_SETHORIZONTALEXTENT:
|
case CB_SETHORIZONTALEXTENT:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_SETHORIZONTALEXTENT, wParam, 0);
|
return SendMessageA( lphc->hWndLBox, LB_SETHORIZONTALEXTENT, wParam, 0);
|
||||||
goto END;
|
|
||||||
case CB_GETTOPINDEX:
|
case CB_GETTOPINDEX:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETTOPINDEX, 0, 0);
|
return SendMessageA( lphc->hWndLBox, LB_GETTOPINDEX, 0, 0);
|
||||||
goto END;
|
|
||||||
case CB_GETLOCALE:
|
case CB_GETLOCALE:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETLOCALE, 0, 0);
|
return SendMessageA( lphc->hWndLBox, LB_GETLOCALE, 0, 0);
|
||||||
goto END;
|
|
||||||
case CB_SETLOCALE:
|
case CB_SETLOCALE:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_SETLOCALE, wParam, 0);
|
return SendMessageA( lphc->hWndLBox, LB_SETLOCALE, wParam, 0);
|
||||||
goto END;
|
|
||||||
case CB_GETDROPPEDWIDTH:
|
case CB_GETDROPPEDWIDTH:
|
||||||
if( lphc->droppedWidth )
|
if( lphc->droppedWidth )
|
||||||
{
|
return lphc->droppedWidth;
|
||||||
retvalue = lphc->droppedWidth;
|
return lphc->droppedRect.right - lphc->droppedRect.left;
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
retvalue = lphc->droppedRect.right - lphc->droppedRect.left;
|
|
||||||
goto END;
|
|
||||||
case CB_SETDROPPEDWIDTH:
|
case CB_SETDROPPEDWIDTH:
|
||||||
if( (CB_GETTYPE(lphc) != CBS_SIMPLE) &&
|
if( (CB_GETTYPE(lphc) != CBS_SIMPLE) &&
|
||||||
(INT)wParam < 32768 ) lphc->droppedWidth = (INT)wParam;
|
(INT)wParam < 32768 ) lphc->droppedWidth = (INT)wParam;
|
||||||
retvalue = CB_ERR;
|
return CB_ERR;
|
||||||
goto END;
|
|
||||||
case CB_GETDROPPEDCONTROLRECT16:
|
case CB_GETDROPPEDCONTROLRECT16:
|
||||||
lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||||
if( lParam )
|
if( lParam )
|
||||||
|
@ -1923,23 +1873,19 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
||||||
CBGetDroppedControlRect( lphc, &r );
|
CBGetDroppedControlRect( lphc, &r );
|
||||||
CONV_RECT32TO16( &r, (LPRECT16)lParam );
|
CONV_RECT32TO16( &r, (LPRECT16)lParam );
|
||||||
}
|
}
|
||||||
retvalue = CB_OKAY;
|
return CB_OKAY;
|
||||||
goto END;
|
|
||||||
case CB_GETDROPPEDCONTROLRECT:
|
case CB_GETDROPPEDCONTROLRECT:
|
||||||
if( lParam ) CBGetDroppedControlRect(lphc, (LPRECT)lParam );
|
if( lParam ) CBGetDroppedControlRect(lphc, (LPRECT)lParam );
|
||||||
retvalue = CB_OKAY;
|
return CB_OKAY;
|
||||||
goto END;
|
|
||||||
case CB_GETDROPPEDSTATE16:
|
case CB_GETDROPPEDSTATE16:
|
||||||
case CB_GETDROPPEDSTATE:
|
case CB_GETDROPPEDSTATE:
|
||||||
retvalue = (lphc->wState & CBF_DROPPED) ? TRUE : FALSE;
|
return (lphc->wState & CBF_DROPPED) ? TRUE : FALSE;
|
||||||
goto END;
|
|
||||||
case CB_DIR16:
|
case CB_DIR16:
|
||||||
lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case CB_DIR:
|
case CB_DIR:
|
||||||
retvalue = COMBO_Directory( lphc, (UINT)wParam,
|
return COMBO_Directory( lphc, (UINT)wParam,
|
||||||
(LPSTR)lParam, (message == CB_DIR));
|
(LPSTR)lParam, (message == CB_DIR));
|
||||||
goto END;
|
|
||||||
case CB_SHOWDROPDOWN16:
|
case CB_SHOWDROPDOWN16:
|
||||||
case CB_SHOWDROPDOWN:
|
case CB_SHOWDROPDOWN:
|
||||||
if( CB_GETTYPE(lphc) != CBS_SIMPLE )
|
if( CB_GETTYPE(lphc) != CBS_SIMPLE )
|
||||||
|
@ -1953,16 +1899,13 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
||||||
if( lphc->wState & CBF_DROPPED )
|
if( lphc->wState & CBF_DROPPED )
|
||||||
CBRollUp( lphc, FALSE, TRUE );
|
CBRollUp( lphc, FALSE, TRUE );
|
||||||
}
|
}
|
||||||
retvalue = TRUE;
|
return TRUE;
|
||||||
goto END;
|
|
||||||
case CB_GETCOUNT16:
|
case CB_GETCOUNT16:
|
||||||
case CB_GETCOUNT:
|
case CB_GETCOUNT:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETCOUNT, 0, 0);
|
return SendMessageA( lphc->hWndLBox, LB_GETCOUNT, 0, 0);
|
||||||
goto END;
|
|
||||||
case CB_GETCURSEL16:
|
case CB_GETCURSEL16:
|
||||||
case CB_GETCURSEL:
|
case CB_GETCURSEL:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETCURSEL, 0, 0);
|
return SendMessageA( lphc->hWndLBox, LB_GETCURSEL, 0, 0);
|
||||||
goto END;
|
|
||||||
case CB_SETCURSEL16:
|
case CB_SETCURSEL16:
|
||||||
wParam = (INT)(INT16)wParam;
|
wParam = (INT)(INT16)wParam;
|
||||||
case CB_SETCURSEL:
|
case CB_SETCURSEL:
|
||||||
|
@ -1973,29 +1916,24 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
||||||
InvalidateRect(CB_HWND(lphc), &lphc->textRect, TRUE);
|
InvalidateRect(CB_HWND(lphc), &lphc->textRect, TRUE);
|
||||||
lphc->wState &= ~CBF_SELCHANGE;
|
lphc->wState &= ~CBF_SELCHANGE;
|
||||||
}
|
}
|
||||||
retvalue = lParam;
|
return lParam;
|
||||||
goto END;
|
|
||||||
case CB_GETLBTEXT16:
|
case CB_GETLBTEXT16:
|
||||||
wParam = (INT)(INT16)wParam;
|
wParam = (INT)(INT16)wParam;
|
||||||
lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||||
case CB_GETLBTEXT:
|
case CB_GETLBTEXT:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETTEXT, wParam, lParam);
|
return SendMessageA( lphc->hWndLBox, LB_GETTEXT, wParam, lParam);
|
||||||
goto END;
|
|
||||||
case CB_GETLBTEXTLEN16:
|
case CB_GETLBTEXTLEN16:
|
||||||
wParam = (INT)(INT16)wParam;
|
wParam = (INT)(INT16)wParam;
|
||||||
case CB_GETLBTEXTLEN:
|
case CB_GETLBTEXTLEN:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETTEXTLEN, wParam, 0);
|
return SendMessageA( lphc->hWndLBox, LB_GETTEXTLEN, wParam, 0);
|
||||||
goto END;
|
|
||||||
case CB_GETITEMDATA16:
|
case CB_GETITEMDATA16:
|
||||||
wParam = (INT)(INT16)wParam;
|
wParam = (INT)(INT16)wParam;
|
||||||
case CB_GETITEMDATA:
|
case CB_GETITEMDATA:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_GETITEMDATA, wParam, 0);
|
return SendMessageA( lphc->hWndLBox, LB_GETITEMDATA, wParam, 0);
|
||||||
goto END;
|
|
||||||
case CB_SETITEMDATA16:
|
case CB_SETITEMDATA16:
|
||||||
wParam = (INT)(INT16)wParam;
|
wParam = (INT)(INT16)wParam;
|
||||||
case CB_SETITEMDATA:
|
case CB_SETITEMDATA:
|
||||||
retvalue = SendMessageA( lphc->hWndLBox, LB_SETITEMDATA, wParam, lParam);
|
return SendMessageA( lphc->hWndLBox, LB_SETITEMDATA, wParam, lParam);
|
||||||
goto END;
|
|
||||||
case CB_GETEDITSEL16:
|
case CB_GETEDITSEL16:
|
||||||
wParam = lParam = 0; /* just in case */
|
wParam = lParam = 0; /* just in case */
|
||||||
case CB_GETEDITSEL:
|
case CB_GETEDITSEL:
|
||||||
|
@ -2003,47 +1941,49 @@ LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
||||||
{
|
{
|
||||||
INT a, b;
|
INT a, b;
|
||||||
|
|
||||||
retvalue = SendMessageA( lphc->hWndEdit, EM_GETSEL,
|
return SendMessageA( lphc->hWndEdit, EM_GETSEL,
|
||||||
(wParam) ? wParam : (WPARAM)&a,
|
(wParam) ? wParam : (WPARAM)&a,
|
||||||
(lParam) ? lParam : (LPARAM)&b );
|
(lParam) ? lParam : (LPARAM)&b );
|
||||||
goto END;
|
|
||||||
}
|
}
|
||||||
retvalue = CB_ERR;
|
return CB_ERR;
|
||||||
goto END;
|
|
||||||
case CB_SETEDITSEL16:
|
case CB_SETEDITSEL16:
|
||||||
case CB_SETEDITSEL:
|
case CB_SETEDITSEL:
|
||||||
if( lphc->wState & CBF_EDIT )
|
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) );
|
(INT)(INT16)LOWORD(lParam), (INT)(INT16)HIWORD(lParam) );
|
||||||
goto END;
|
return CB_ERR;
|
||||||
}
|
|
||||||
retvalue = CB_ERR;
|
|
||||||
goto END;
|
|
||||||
case CB_SETEXTENDEDUI16:
|
case CB_SETEXTENDEDUI16:
|
||||||
case CB_SETEXTENDEDUI:
|
case CB_SETEXTENDEDUI:
|
||||||
if( CB_GETTYPE(lphc) == CBS_SIMPLE )
|
if( CB_GETTYPE(lphc) == CBS_SIMPLE )
|
||||||
{
|
return CB_ERR;
|
||||||
retvalue = CB_ERR;
|
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
if( wParam )
|
if( wParam )
|
||||||
lphc->wState |= CBF_EUI;
|
lphc->wState |= CBF_EUI;
|
||||||
else lphc->wState &= ~CBF_EUI;
|
else lphc->wState &= ~CBF_EUI;
|
||||||
retvalue = CB_OKAY;
|
return CB_OKAY;
|
||||||
goto END;
|
|
||||||
case CB_GETEXTENDEDUI16:
|
case CB_GETEXTENDEDUI16:
|
||||||
case CB_GETEXTENDEDUI:
|
case CB_GETEXTENDEDUI:
|
||||||
retvalue = (lphc->wState & CBF_EUI) ? TRUE : FALSE;
|
return (lphc->wState & CBF_EUI) ? TRUE : FALSE;
|
||||||
goto END;
|
|
||||||
case (WM_USER + 0x1B):
|
case (WM_USER + 0x1B):
|
||||||
WARN(combo, "[%04x]: undocumented msg!\n", hwnd );
|
WARN(combo, "[%04x]: undocumented msg!\n", hwnd );
|
||||||
}
|
}
|
||||||
retvalue = DefWindowProcA(hwnd, message, wParam, lParam);
|
return DefWindowProcA(hwnd, message, wParam, lParam);
|
||||||
goto END;
|
|
||||||
}
|
}
|
||||||
retvalue = CB_ERR;
|
return CB_ERR;
|
||||||
END:
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* ComboWndProc
|
||||||
|
*
|
||||||
|
* This is just a wrapper for the real ComboWndProc which locks/unlocks
|
||||||
|
* window structs.
|
||||||
|
*/
|
||||||
|
LRESULT WINAPI ComboWndProc( HWND hwnd, UINT message,
|
||||||
|
WPARAM wParam, LPARAM lParam )
|
||||||
|
{
|
||||||
|
WND* pWnd = WIN_FindWndPtr(hwnd);
|
||||||
|
LRESULT retvalue = ComboWndProc_locked(pWnd,message,wParam,lParam);
|
||||||
|
|
||||||
|
|
||||||
WIN_ReleaseWndPtr(pWnd);
|
WIN_ReleaseWndPtr(pWnd);
|
||||||
return retvalue;
|
return retvalue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,16 +194,15 @@ static LRESULT DESKTOP_DoEraseBkgnd( HWND hwnd, HDC hdc,
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* DesktopWndProc
|
* DesktopWndProc_locked
|
||||||
*
|
*
|
||||||
* Window procedure for the desktop window.
|
* Window procedure for the desktop window.
|
||||||
*/
|
*/
|
||||||
LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message,
|
static inline LRESULT WINAPI DesktopWndProc_locked( WND *wndPtr, UINT message,
|
||||||
WPARAM wParam, LPARAM lParam )
|
WPARAM wParam, LPARAM lParam )
|
||||||
{
|
{
|
||||||
LRESULT retvalue;
|
|
||||||
WND *wndPtr = WIN_FindWndPtr( hwnd );
|
|
||||||
DESKTOP *desktopPtr = (DESKTOP *)wndPtr->wExtra;
|
DESKTOP *desktopPtr = (DESKTOP *)wndPtr->wExtra;
|
||||||
|
HWND hwnd = wndPtr->hwndSelf;
|
||||||
|
|
||||||
/* Most messages are ignored (we DON'T call DefWindowProc) */
|
/* Most messages are ignored (we DON'T call DefWindowProc) */
|
||||||
|
|
||||||
|
@ -216,33 +215,37 @@ LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message,
|
||||||
desktopPtr->hbitmapWallPaper = 0;
|
desktopPtr->hbitmapWallPaper = 0;
|
||||||
SetDeskPattern();
|
SetDeskPattern();
|
||||||
SetDeskWallPaper( (LPSTR)-1 );
|
SetDeskWallPaper( (LPSTR)-1 );
|
||||||
retvalue = 1;
|
return 1;
|
||||||
goto END;
|
|
||||||
|
|
||||||
case WM_ERASEBKGND:
|
case WM_ERASEBKGND:
|
||||||
if(!DESKTOP_IsSingleWindow())
|
if(!DESKTOP_IsSingleWindow())
|
||||||
{
|
return 1;
|
||||||
retvalue = 1;
|
return DESKTOP_DoEraseBkgnd( hwnd, (HDC)wParam, desktopPtr );
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
retvalue = DESKTOP_DoEraseBkgnd( hwnd, (HDC)wParam, desktopPtr );
|
|
||||||
goto END;
|
|
||||||
|
|
||||||
case WM_SYSCOMMAND:
|
case WM_SYSCOMMAND:
|
||||||
if ((wParam & 0xfff0) != SC_CLOSE)
|
if ((wParam & 0xfff0) != SC_CLOSE)
|
||||||
{
|
return 0;
|
||||||
retvalue = 0;
|
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
ExitWindows16( 0, 0 );
|
ExitWindows16( 0, 0 );
|
||||||
|
|
||||||
case WM_SETCURSOR:
|
case WM_SETCURSOR:
|
||||||
retvalue = (LRESULT)SetCursor16( LoadCursor16( 0, IDC_ARROW16 ) );
|
return (LRESULT)SetCursor16( LoadCursor16( 0, IDC_ARROW16 ) );
|
||||||
goto END;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
retvalue = 0;
|
return 0;
|
||||||
END:
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* DesktopWndProc
|
||||||
|
*
|
||||||
|
* This is just a wrapper for the DesktopWndProc which does windows
|
||||||
|
* locking and unlocking.
|
||||||
|
*/
|
||||||
|
LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message,
|
||||||
|
WPARAM wParam, LPARAM lParam )
|
||||||
|
{
|
||||||
|
WND *wndPtr = WIN_FindWndPtr( hwnd );
|
||||||
|
LRESULT retvalue = DesktopWndProc_locked(wndPtr,message,wParam,lParam);
|
||||||
|
|
||||||
WIN_ReleaseWndPtr(wndPtr);
|
WIN_ReleaseWndPtr(wndPtr);
|
||||||
return retvalue;
|
return retvalue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2130,13 +2130,12 @@ static BOOL LISTBOX_Destroy( WND *wnd, LB_DESCR *descr )
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* ListBoxWndProc
|
* ListBoxWndProc
|
||||||
*/
|
*/
|
||||||
LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
static inline LRESULT WINAPI ListBoxWndProc_locked( WND* wnd, UINT msg,
|
||||||
WPARAM wParam, LPARAM lParam )
|
WPARAM wParam, LPARAM lParam )
|
||||||
{
|
{
|
||||||
LRESULT ret;
|
LRESULT ret;
|
||||||
LB_DESCR *descr;
|
LB_DESCR *descr;
|
||||||
WND *wnd = WIN_FindWndPtr( hwnd );
|
HWND hwnd = wnd->hwndSelf;
|
||||||
LRESULT retvalue;
|
|
||||||
|
|
||||||
if (!wnd) return 0;
|
if (!wnd) return 0;
|
||||||
if (!(descr = *(LB_DESCR **)wnd->wExtra))
|
if (!(descr = *(LB_DESCR **)wnd->wExtra))
|
||||||
|
@ -2144,18 +2143,13 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
||||||
if (msg == WM_CREATE)
|
if (msg == WM_CREATE)
|
||||||
{
|
{
|
||||||
if (!LISTBOX_Create( wnd, NULL ))
|
if (!LISTBOX_Create( wnd, NULL ))
|
||||||
{
|
return -1;
|
||||||
retvalue = -1;
|
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
TRACE(listbox, "creating wnd=%04x descr=%p\n",
|
TRACE(listbox, "creating wnd=%04x descr=%p\n",
|
||||||
hwnd, *(LB_DESCR **)wnd->wExtra );
|
hwnd, *(LB_DESCR **)wnd->wExtra );
|
||||||
retvalue = 0;
|
return 0;
|
||||||
goto END;
|
|
||||||
}
|
}
|
||||||
/* Ignore all other messages before we get a WM_CREATE */
|
/* Ignore all other messages before we get a WM_CREATE */
|
||||||
retvalue = DefWindowProcA( hwnd, msg, wParam, lParam );
|
return DefWindowProcA( hwnd, msg, wParam, lParam );
|
||||||
goto END;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE(listbox, "[%04x]: msg %s wp %08x lp %08lx\n",
|
TRACE(listbox, "[%04x]: msg %s wp %08x lp %08lx\n",
|
||||||
|
@ -2165,112 +2159,88 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
||||||
case LB_RESETCONTENT16:
|
case LB_RESETCONTENT16:
|
||||||
case LB_RESETCONTENT:
|
case LB_RESETCONTENT:
|
||||||
LISTBOX_ResetContent( wnd, descr );
|
LISTBOX_ResetContent( wnd, descr );
|
||||||
retvalue = 0;
|
return 0;
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_ADDSTRING16:
|
case LB_ADDSTRING16:
|
||||||
if (HAS_STRINGS(descr)) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
if (HAS_STRINGS(descr)) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case LB_ADDSTRING:
|
case LB_ADDSTRING:
|
||||||
wParam = LISTBOX_FindStringPos( wnd, descr, (LPCSTR)lParam, FALSE );
|
wParam = LISTBOX_FindStringPos( wnd, descr, (LPCSTR)lParam, FALSE );
|
||||||
retvalue = LISTBOX_InsertString( wnd, descr, wParam, (LPCSTR)lParam );
|
return LISTBOX_InsertString( wnd, descr, wParam, (LPCSTR)lParam );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_INSERTSTRING16:
|
case LB_INSERTSTRING16:
|
||||||
if (HAS_STRINGS(descr)) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
if (HAS_STRINGS(descr)) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||||
wParam = (INT)(INT16)wParam;
|
wParam = (INT)(INT16)wParam;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case LB_INSERTSTRING:
|
case LB_INSERTSTRING:
|
||||||
retvalue = LISTBOX_InsertString( wnd, descr, wParam, (LPCSTR)lParam );
|
return LISTBOX_InsertString( wnd, descr, wParam, (LPCSTR)lParam );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_ADDFILE16:
|
case LB_ADDFILE16:
|
||||||
if (HAS_STRINGS(descr)) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
if (HAS_STRINGS(descr)) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case LB_ADDFILE:
|
case LB_ADDFILE:
|
||||||
wParam = LISTBOX_FindFileStrPos( wnd, descr, (LPCSTR)lParam );
|
wParam = LISTBOX_FindFileStrPos( wnd, descr, (LPCSTR)lParam );
|
||||||
retvalue = LISTBOX_InsertString( wnd, descr, wParam, (LPCSTR)lParam );
|
return LISTBOX_InsertString( wnd, descr, wParam, (LPCSTR)lParam );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_DELETESTRING16:
|
case LB_DELETESTRING16:
|
||||||
case LB_DELETESTRING:
|
case LB_DELETESTRING:
|
||||||
retvalue = LISTBOX_RemoveItem( wnd, descr, wParam );
|
return LISTBOX_RemoveItem( wnd, descr, wParam );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_GETITEMDATA16:
|
case LB_GETITEMDATA16:
|
||||||
case LB_GETITEMDATA:
|
case LB_GETITEMDATA:
|
||||||
if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
|
if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
|
||||||
{
|
return LB_ERR;
|
||||||
retvalue = LB_ERR;
|
return descr->items[wParam].data;
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
retvalue = descr->items[wParam].data;
|
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_SETITEMDATA16:
|
case LB_SETITEMDATA16:
|
||||||
case LB_SETITEMDATA:
|
case LB_SETITEMDATA:
|
||||||
if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
|
if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
|
||||||
{
|
return LB_ERR;
|
||||||
retvalue = LB_ERR;
|
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
descr->items[wParam].data = (DWORD)lParam;
|
descr->items[wParam].data = (DWORD)lParam;
|
||||||
retvalue = LB_OKAY;
|
return LB_OKAY;
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_GETCOUNT16:
|
case LB_GETCOUNT16:
|
||||||
case LB_GETCOUNT:
|
case LB_GETCOUNT:
|
||||||
retvalue = descr->nb_items;
|
return descr->nb_items;
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_GETTEXT16:
|
case LB_GETTEXT16:
|
||||||
lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case LB_GETTEXT:
|
case LB_GETTEXT:
|
||||||
retvalue = LISTBOX_GetText( wnd, descr, wParam, (LPSTR)lParam );
|
return LISTBOX_GetText( wnd, descr, wParam, (LPSTR)lParam );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_GETTEXTLEN16:
|
case LB_GETTEXTLEN16:
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case LB_GETTEXTLEN:
|
case LB_GETTEXTLEN:
|
||||||
if (wParam >= descr->nb_items)
|
if (wParam >= descr->nb_items)
|
||||||
{
|
return LB_ERR;
|
||||||
retvalue = LB_ERR;
|
return (HAS_STRINGS(descr) ? strlen(descr->items[wParam].str)
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
retvalue = (HAS_STRINGS(descr) ? strlen(descr->items[wParam].str)
|
|
||||||
: sizeof(DWORD));
|
: sizeof(DWORD));
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_GETCURSEL16:
|
case LB_GETCURSEL16:
|
||||||
case LB_GETCURSEL:
|
case LB_GETCURSEL:
|
||||||
if (descr->nb_items==0)
|
if (descr->nb_items==0)
|
||||||
retvalue = LB_ERR;
|
return LB_ERR;
|
||||||
else
|
/* else */
|
||||||
{
|
if (descr->selected_item!=-1)
|
||||||
retvalue = descr->selected_item;
|
return descr->selected_item;
|
||||||
if (retvalue == -1) retvalue = descr->focus_item;
|
/* else */
|
||||||
}
|
return descr->focus_item;
|
||||||
/* otherwise, if the user tries to move the selection with the */
|
/* otherwise, if the user tries to move the selection with the */
|
||||||
/* arrow keys, we will give the application something to choke on */
|
/* arrow keys, we will give the application something to choke on */
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_GETTOPINDEX16:
|
case LB_GETTOPINDEX16:
|
||||||
case LB_GETTOPINDEX:
|
case LB_GETTOPINDEX:
|
||||||
retvalue = descr->top_item;
|
return descr->top_item;
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_GETITEMHEIGHT16:
|
case LB_GETITEMHEIGHT16:
|
||||||
case LB_GETITEMHEIGHT:
|
case LB_GETITEMHEIGHT:
|
||||||
retvalue = LISTBOX_GetItemHeight( wnd, descr, wParam );
|
return LISTBOX_GetItemHeight( wnd, descr, wParam );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_SETITEMHEIGHT16:
|
case LB_SETITEMHEIGHT16:
|
||||||
lParam = LOWORD(lParam);
|
lParam = LOWORD(lParam);
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case LB_SETITEMHEIGHT:
|
case LB_SETITEMHEIGHT:
|
||||||
retvalue = LISTBOX_SetItemHeight( wnd, descr, wParam, lParam );
|
return LISTBOX_SetItemHeight( wnd, descr, wParam, lParam );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_ITEMFROMPOINT:
|
case LB_ITEMFROMPOINT:
|
||||||
{
|
{
|
||||||
|
@ -2284,30 +2254,25 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
||||||
rect.right = descr->width;
|
rect.right = descr->width;
|
||||||
rect.bottom = descr->height;
|
rect.bottom = descr->height;
|
||||||
|
|
||||||
retvalue = MAKELONG( LISTBOX_GetItemFromPoint(wnd, descr, pt.x, pt.y),
|
return MAKELONG( LISTBOX_GetItemFromPoint(wnd, descr, pt.x, pt.y),
|
||||||
PtInRect( &rect, pt ) );
|
PtInRect( &rect, pt ) );
|
||||||
goto END;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case LB_SETCARETINDEX16:
|
case LB_SETCARETINDEX16:
|
||||||
case LB_SETCARETINDEX:
|
case LB_SETCARETINDEX:
|
||||||
retvalue = LISTBOX_SetCaretIndex( wnd, descr, wParam, !lParam );
|
return LISTBOX_SetCaretIndex( wnd, descr, wParam, !lParam );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_GETCARETINDEX16:
|
case LB_GETCARETINDEX16:
|
||||||
case LB_GETCARETINDEX:
|
case LB_GETCARETINDEX:
|
||||||
retvalue = descr->focus_item;
|
return descr->focus_item;
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_SETTOPINDEX16:
|
case LB_SETTOPINDEX16:
|
||||||
case LB_SETTOPINDEX:
|
case LB_SETTOPINDEX:
|
||||||
retvalue = LISTBOX_SetTopItem( wnd, descr, wParam, TRUE );
|
return LISTBOX_SetTopItem( wnd, descr, wParam, TRUE );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_SETCOLUMNWIDTH16:
|
case LB_SETCOLUMNWIDTH16:
|
||||||
case LB_SETCOLUMNWIDTH:
|
case LB_SETCOLUMNWIDTH:
|
||||||
retvalue = LISTBOX_SetColumnWidth( wnd, descr, wParam );
|
return LISTBOX_SetColumnWidth( wnd, descr, wParam );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_GETITEMRECT16:
|
case LB_GETITEMRECT16:
|
||||||
{
|
{
|
||||||
|
@ -2315,28 +2280,24 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
||||||
ret = LISTBOX_GetItemRect( wnd, descr, (INT16)wParam, &rect );
|
ret = LISTBOX_GetItemRect( wnd, descr, (INT16)wParam, &rect );
|
||||||
CONV_RECT32TO16( &rect, (RECT16 *)PTR_SEG_TO_LIN(lParam) );
|
CONV_RECT32TO16( &rect, (RECT16 *)PTR_SEG_TO_LIN(lParam) );
|
||||||
}
|
}
|
||||||
retvalue = ret;
|
return ret;
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_GETITEMRECT:
|
case LB_GETITEMRECT:
|
||||||
retvalue = LISTBOX_GetItemRect( wnd, descr, wParam, (RECT *)lParam );
|
return LISTBOX_GetItemRect( wnd, descr, wParam, (RECT *)lParam );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_FINDSTRING16:
|
case LB_FINDSTRING16:
|
||||||
wParam = (INT)(INT16)wParam;
|
wParam = (INT)(INT16)wParam;
|
||||||
if (HAS_STRINGS(descr)) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
if (HAS_STRINGS(descr)) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case LB_FINDSTRING:
|
case LB_FINDSTRING:
|
||||||
retvalue = LISTBOX_FindString( wnd, descr, wParam, (LPCSTR)lParam, FALSE );
|
return LISTBOX_FindString( wnd, descr, wParam, (LPCSTR)lParam, FALSE );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_FINDSTRINGEXACT16:
|
case LB_FINDSTRINGEXACT16:
|
||||||
wParam = (INT)(INT16)wParam;
|
wParam = (INT)(INT16)wParam;
|
||||||
if (HAS_STRINGS(descr)) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
if (HAS_STRINGS(descr)) lParam = (LPARAM)PTR_SEG_TO_LIN(lParam);
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case LB_FINDSTRINGEXACT:
|
case LB_FINDSTRINGEXACT:
|
||||||
retvalue = LISTBOX_FindString( wnd, descr, wParam, (LPCSTR)lParam, TRUE );
|
return LISTBOX_FindString( wnd, descr, wParam, (LPCSTR)lParam, TRUE );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_SELECTSTRING16:
|
case LB_SELECTSTRING16:
|
||||||
wParam = (INT)(INT16)wParam;
|
wParam = (INT)(INT16)wParam;
|
||||||
|
@ -2347,13 +2308,9 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
||||||
INT index = LISTBOX_FindString( wnd, descr, wParam,
|
INT index = LISTBOX_FindString( wnd, descr, wParam,
|
||||||
(LPCSTR)lParam, FALSE );
|
(LPCSTR)lParam, FALSE );
|
||||||
if (index == LB_ERR)
|
if (index == LB_ERR)
|
||||||
{
|
return LB_ERR;
|
||||||
retvalue = LB_ERR;
|
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
LISTBOX_SetSelection( wnd, descr, index, TRUE, FALSE );
|
LISTBOX_SetSelection( wnd, descr, index, TRUE, FALSE );
|
||||||
retvalue = index;
|
return index;
|
||||||
goto END;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case LB_GETSEL16:
|
case LB_GETSEL16:
|
||||||
|
@ -2361,171 +2318,129 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case LB_GETSEL:
|
case LB_GETSEL:
|
||||||
if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
|
if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
|
||||||
{
|
return LB_ERR;
|
||||||
retvalue = LB_ERR;
|
return descr->items[wParam].selected;
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
retvalue = descr->items[wParam].selected;
|
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_SETSEL16:
|
case LB_SETSEL16:
|
||||||
lParam = (INT)(INT16)lParam;
|
lParam = (INT)(INT16)lParam;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case LB_SETSEL:
|
case LB_SETSEL:
|
||||||
retvalue = LISTBOX_SetSelection( wnd, descr, lParam, wParam, FALSE );
|
return LISTBOX_SetSelection( wnd, descr, lParam, wParam, FALSE );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_SETCURSEL16:
|
case LB_SETCURSEL16:
|
||||||
wParam = (INT)(INT16)wParam;
|
wParam = (INT)(INT16)wParam;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case LB_SETCURSEL:
|
case LB_SETCURSEL:
|
||||||
LISTBOX_SetCaretIndex( wnd, descr, wParam, TRUE );
|
LISTBOX_SetCaretIndex( wnd, descr, wParam, TRUE );
|
||||||
retvalue = LISTBOX_SetSelection( wnd, descr, wParam, TRUE, FALSE );
|
return LISTBOX_SetSelection( wnd, descr, wParam, TRUE, FALSE );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_GETSELCOUNT16:
|
case LB_GETSELCOUNT16:
|
||||||
case LB_GETSELCOUNT:
|
case LB_GETSELCOUNT:
|
||||||
retvalue = LISTBOX_GetSelCount( wnd, descr );
|
return LISTBOX_GetSelCount( wnd, descr );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_GETSELITEMS16:
|
case LB_GETSELITEMS16:
|
||||||
retvalue = LISTBOX_GetSelItems16( wnd, descr, wParam,
|
return LISTBOX_GetSelItems16( wnd, descr, wParam,
|
||||||
(LPINT16)PTR_SEG_TO_LIN(lParam) );
|
(LPINT16)PTR_SEG_TO_LIN(lParam) );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_GETSELITEMS:
|
case LB_GETSELITEMS:
|
||||||
retvalue = LISTBOX_GetSelItems( wnd, descr, wParam, (LPINT)lParam );
|
return LISTBOX_GetSelItems( wnd, descr, wParam, (LPINT)lParam );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_SELITEMRANGE16:
|
case LB_SELITEMRANGE16:
|
||||||
case LB_SELITEMRANGE:
|
case LB_SELITEMRANGE:
|
||||||
if (LOWORD(lParam) <= HIWORD(lParam))
|
if (LOWORD(lParam) <= HIWORD(lParam))
|
||||||
{
|
return LISTBOX_SelectItemRange( wnd, descr, LOWORD(lParam),
|
||||||
retvalue = LISTBOX_SelectItemRange( wnd, descr, LOWORD(lParam),
|
|
||||||
HIWORD(lParam), wParam );
|
HIWORD(lParam), wParam );
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
return LISTBOX_SelectItemRange( wnd, descr, HIWORD(lParam),
|
||||||
retvalue = LISTBOX_SelectItemRange( wnd, descr, HIWORD(lParam),
|
|
||||||
LOWORD(lParam), wParam );
|
LOWORD(lParam), wParam );
|
||||||
}
|
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_SELITEMRANGEEX16:
|
case LB_SELITEMRANGEEX16:
|
||||||
case LB_SELITEMRANGEEX:
|
case LB_SELITEMRANGEEX:
|
||||||
if ((INT)lParam >= (INT)wParam)
|
if ((INT)lParam >= (INT)wParam)
|
||||||
retvalue = LISTBOX_SelectItemRange( wnd, descr, wParam, lParam, TRUE );
|
return LISTBOX_SelectItemRange( wnd, descr, wParam, lParam, TRUE );
|
||||||
else
|
else
|
||||||
retvalue = LISTBOX_SelectItemRange( wnd, descr, lParam, wParam, FALSE);
|
return LISTBOX_SelectItemRange( wnd, descr, lParam, wParam, FALSE);
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_GETHORIZONTALEXTENT16:
|
case LB_GETHORIZONTALEXTENT16:
|
||||||
case LB_GETHORIZONTALEXTENT:
|
case LB_GETHORIZONTALEXTENT:
|
||||||
retvalue = descr->horz_extent;
|
return descr->horz_extent;
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_SETHORIZONTALEXTENT16:
|
case LB_SETHORIZONTALEXTENT16:
|
||||||
case LB_SETHORIZONTALEXTENT:
|
case LB_SETHORIZONTALEXTENT:
|
||||||
retvalue = LISTBOX_SetHorizontalExtent( wnd, descr, wParam );
|
return LISTBOX_SetHorizontalExtent( wnd, descr, wParam );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_GETANCHORINDEX16:
|
case LB_GETANCHORINDEX16:
|
||||||
case LB_GETANCHORINDEX:
|
case LB_GETANCHORINDEX:
|
||||||
retvalue = descr->anchor_item;
|
return descr->anchor_item;
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_SETANCHORINDEX16:
|
case LB_SETANCHORINDEX16:
|
||||||
wParam = (INT)(INT16)wParam;
|
wParam = (INT)(INT16)wParam;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case LB_SETANCHORINDEX:
|
case LB_SETANCHORINDEX:
|
||||||
if (((INT)wParam < -1) || ((INT)wParam >= descr->nb_items))
|
if (((INT)wParam < -1) || ((INT)wParam >= descr->nb_items))
|
||||||
{
|
return LB_ERR;
|
||||||
retvalue = LB_ERR;
|
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
descr->anchor_item = (INT)wParam;
|
descr->anchor_item = (INT)wParam;
|
||||||
retvalue = LB_OKAY;
|
return LB_OKAY;
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_DIR16:
|
case LB_DIR16:
|
||||||
retvalue = LISTBOX_Directory( wnd, descr, wParam,
|
return LISTBOX_Directory( wnd, descr, wParam,
|
||||||
(LPCSTR)PTR_SEG_TO_LIN(lParam), FALSE );
|
(LPCSTR)PTR_SEG_TO_LIN(lParam), FALSE );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_DIR:
|
case LB_DIR:
|
||||||
retvalue = LISTBOX_Directory( wnd, descr, wParam, (LPCSTR)lParam, TRUE );
|
return LISTBOX_Directory( wnd, descr, wParam, (LPCSTR)lParam, TRUE );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_GETLOCALE:
|
case LB_GETLOCALE:
|
||||||
retvalue = descr->locale;
|
return descr->locale;
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_SETLOCALE:
|
case LB_SETLOCALE:
|
||||||
descr->locale = (LCID)wParam; /* FIXME: should check for valid lcid */
|
descr->locale = (LCID)wParam; /* FIXME: should check for valid lcid */
|
||||||
retvalue = LB_OKAY;
|
return LB_OKAY;
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_INITSTORAGE:
|
case LB_INITSTORAGE:
|
||||||
retvalue = LISTBOX_InitStorage( wnd, descr, wParam, (DWORD)lParam );
|
return LISTBOX_InitStorage( wnd, descr, wParam, (DWORD)lParam );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_SETCOUNT:
|
case LB_SETCOUNT:
|
||||||
retvalue = LISTBOX_SetCount( wnd, descr, (INT)wParam );
|
return LISTBOX_SetCount( wnd, descr, (INT)wParam );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_SETTABSTOPS16:
|
case LB_SETTABSTOPS16:
|
||||||
retvalue = LISTBOX_SetTabStops( wnd, descr, (INT)(INT16)wParam,
|
return LISTBOX_SetTabStops( wnd, descr, (INT)(INT16)wParam,
|
||||||
(LPINT)PTR_SEG_TO_LIN(lParam), TRUE );
|
(LPINT)PTR_SEG_TO_LIN(lParam), TRUE );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_SETTABSTOPS:
|
case LB_SETTABSTOPS:
|
||||||
retvalue = LISTBOX_SetTabStops( wnd, descr, wParam,
|
return LISTBOX_SetTabStops( wnd, descr, wParam, (LPINT)lParam, FALSE );
|
||||||
(LPINT)lParam, FALSE );
|
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_CARETON16:
|
case LB_CARETON16:
|
||||||
case LB_CARETON:
|
case LB_CARETON:
|
||||||
if (descr->caret_on)
|
if (descr->caret_on)
|
||||||
{
|
return LB_OKAY;
|
||||||
retvalue = LB_OKAY;
|
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
descr->caret_on = TRUE;
|
descr->caret_on = TRUE;
|
||||||
if ((descr->focus_item != -1) && (GetFocus() == wnd->hwndSelf))
|
if ((descr->focus_item != -1) && (GetFocus() == wnd->hwndSelf))
|
||||||
LISTBOX_RepaintItem( wnd, descr, descr->focus_item, ODA_FOCUS );
|
LISTBOX_RepaintItem( wnd, descr, descr->focus_item, ODA_FOCUS );
|
||||||
retvalue = LB_OKAY;
|
return LB_OKAY;
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_CARETOFF16:
|
case LB_CARETOFF16:
|
||||||
case LB_CARETOFF:
|
case LB_CARETOFF:
|
||||||
if (!descr->caret_on)
|
if (!descr->caret_on)
|
||||||
{
|
return LB_OKAY;
|
||||||
retvalue = LB_OKAY;
|
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
descr->caret_on = FALSE;
|
descr->caret_on = FALSE;
|
||||||
if ((descr->focus_item != -1) && (GetFocus() == wnd->hwndSelf))
|
if ((descr->focus_item != -1) && (GetFocus() == wnd->hwndSelf))
|
||||||
LISTBOX_RepaintItem( wnd, descr, descr->focus_item, ODA_FOCUS );
|
LISTBOX_RepaintItem( wnd, descr, descr->focus_item, ODA_FOCUS );
|
||||||
retvalue = LB_OKAY;
|
return LB_OKAY;
|
||||||
goto END;
|
|
||||||
|
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
retvalue = LISTBOX_Destroy( wnd, descr );
|
return LISTBOX_Destroy( wnd, descr );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case WM_ENABLE:
|
case WM_ENABLE:
|
||||||
InvalidateRect( hwnd, NULL, TRUE );
|
InvalidateRect( hwnd, NULL, TRUE );
|
||||||
retvalue = 0;
|
return 0;
|
||||||
goto END;
|
|
||||||
|
|
||||||
case WM_SETREDRAW:
|
case WM_SETREDRAW:
|
||||||
LISTBOX_SetRedraw( wnd, descr, wParam != 0 );
|
LISTBOX_SetRedraw( wnd, descr, wParam != 0 );
|
||||||
retvalue = 0;
|
return 0;
|
||||||
goto END;
|
|
||||||
|
|
||||||
case WM_GETDLGCODE:
|
case WM_GETDLGCODE:
|
||||||
retvalue =DLGC_WANTARROWS | DLGC_WANTCHARS;
|
return DLGC_WANTARROWS | DLGC_WANTCHARS;
|
||||||
goto END;
|
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
{
|
{
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
||||||
|
@ -2534,67 +2449,52 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
||||||
ret = LISTBOX_Paint( wnd, descr, hdc );
|
ret = LISTBOX_Paint( wnd, descr, hdc );
|
||||||
if( !wParam ) EndPaint( hwnd, &ps );
|
if( !wParam ) EndPaint( hwnd, &ps );
|
||||||
}
|
}
|
||||||
retvalue =ret;
|
return ret;
|
||||||
goto END;
|
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
LISTBOX_UpdateSize( wnd, descr );
|
LISTBOX_UpdateSize( wnd, descr );
|
||||||
retvalue =0;
|
return 0;
|
||||||
goto END;
|
|
||||||
case WM_GETFONT:
|
case WM_GETFONT:
|
||||||
retvalue =descr->font;
|
return descr->font;
|
||||||
goto END;
|
|
||||||
case WM_SETFONT:
|
case WM_SETFONT:
|
||||||
LISTBOX_SetFont( wnd, descr, (HFONT)wParam );
|
LISTBOX_SetFont( wnd, descr, (HFONT)wParam );
|
||||||
if (lParam) InvalidateRect( wnd->hwndSelf, 0, TRUE );
|
if (lParam) InvalidateRect( wnd->hwndSelf, 0, TRUE );
|
||||||
retvalue =0;
|
return 0;
|
||||||
goto END;
|
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
descr->caret_on = TRUE;
|
descr->caret_on = TRUE;
|
||||||
if (descr->focus_item != -1)
|
if (descr->focus_item != -1)
|
||||||
LISTBOX_RepaintItem( wnd, descr, descr->focus_item, ODA_FOCUS );
|
LISTBOX_RepaintItem( wnd, descr, descr->focus_item, ODA_FOCUS );
|
||||||
SEND_NOTIFICATION( wnd, descr, LBN_SETFOCUS );
|
SEND_NOTIFICATION( wnd, descr, LBN_SETFOCUS );
|
||||||
retvalue =0;
|
return 0;
|
||||||
goto END;
|
|
||||||
case WM_KILLFOCUS:
|
case WM_KILLFOCUS:
|
||||||
if ((descr->focus_item != -1) && descr->caret_on)
|
if ((descr->focus_item != -1) && descr->caret_on)
|
||||||
LISTBOX_RepaintItem( wnd, descr, descr->focus_item, ODA_FOCUS );
|
LISTBOX_RepaintItem( wnd, descr, descr->focus_item, ODA_FOCUS );
|
||||||
SEND_NOTIFICATION( wnd, descr, LBN_KILLFOCUS );
|
SEND_NOTIFICATION( wnd, descr, LBN_KILLFOCUS );
|
||||||
retvalue =0;
|
return 0;
|
||||||
goto END;
|
|
||||||
case WM_HSCROLL:
|
case WM_HSCROLL:
|
||||||
retvalue =LISTBOX_HandleHScroll( wnd, descr, wParam, lParam );
|
return LISTBOX_HandleHScroll( wnd, descr, wParam, lParam );
|
||||||
goto END;
|
|
||||||
case WM_VSCROLL:
|
case WM_VSCROLL:
|
||||||
retvalue =LISTBOX_HandleVScroll( wnd, descr, wParam, lParam );
|
return LISTBOX_HandleVScroll( wnd, descr, wParam, lParam );
|
||||||
goto END;
|
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
retvalue =LISTBOX_HandleLButtonDown( wnd, descr, wParam,
|
return LISTBOX_HandleLButtonDown( wnd, descr, wParam,
|
||||||
(INT16)LOWORD(lParam),
|
(INT16)LOWORD(lParam),
|
||||||
(INT16)HIWORD(lParam) );
|
(INT16)HIWORD(lParam) );
|
||||||
goto END;
|
|
||||||
case WM_LBUTTONDBLCLK:
|
case WM_LBUTTONDBLCLK:
|
||||||
if (descr->style & LBS_NOTIFY)
|
if (descr->style & LBS_NOTIFY)
|
||||||
SEND_NOTIFICATION( wnd, descr, LBN_DBLCLK );
|
SEND_NOTIFICATION( wnd, descr, LBN_DBLCLK );
|
||||||
retvalue =0;
|
return 0;
|
||||||
goto END;
|
|
||||||
case WM_MOUSEMOVE:
|
case WM_MOUSEMOVE:
|
||||||
if (GetCapture() == hwnd)
|
if (GetCapture() == hwnd)
|
||||||
LISTBOX_HandleMouseMove( wnd, descr, (INT16)LOWORD(lParam),
|
LISTBOX_HandleMouseMove( wnd, descr, (INT16)LOWORD(lParam),
|
||||||
(INT16)HIWORD(lParam) );
|
(INT16)HIWORD(lParam) );
|
||||||
retvalue =0;
|
return 0;
|
||||||
goto END;
|
|
||||||
case WM_LBUTTONUP:
|
case WM_LBUTTONUP:
|
||||||
retvalue =LISTBOX_HandleLButtonUp( wnd, descr );
|
return LISTBOX_HandleLButtonUp( wnd, descr );
|
||||||
goto END;
|
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
retvalue =LISTBOX_HandleKeyDown( wnd, descr, wParam );
|
return LISTBOX_HandleKeyDown( wnd, descr, wParam );
|
||||||
goto END;
|
|
||||||
case WM_CHAR:
|
case WM_CHAR:
|
||||||
retvalue =LISTBOX_HandleChar( wnd, descr, wParam );
|
return LISTBOX_HandleChar( wnd, descr, wParam );
|
||||||
goto END;
|
|
||||||
case WM_SYSTIMER:
|
case WM_SYSTIMER:
|
||||||
retvalue =LISTBOX_HandleSystemTimer( wnd, descr );
|
return LISTBOX_HandleSystemTimer( wnd, descr );
|
||||||
goto END;
|
|
||||||
case WM_ERASEBKGND:
|
case WM_ERASEBKGND:
|
||||||
if (IS_OWNERDRAW(descr))
|
if (IS_OWNERDRAW(descr))
|
||||||
{
|
{
|
||||||
|
@ -2604,14 +2504,10 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
||||||
GetClientRect(hwnd, &rect);
|
GetClientRect(hwnd, &rect);
|
||||||
if (hbrush) FillRect( (HDC)wParam, &rect, hbrush );
|
if (hbrush) FillRect( (HDC)wParam, &rect, hbrush );
|
||||||
}
|
}
|
||||||
retvalue =1;
|
return 1;
|
||||||
goto END;
|
|
||||||
case WM_DROPFILES:
|
case WM_DROPFILES:
|
||||||
if( !descr->lphc )
|
if( !descr->lphc )
|
||||||
{
|
return SendMessageA( descr->owner, msg, wParam, lParam );
|
||||||
retvalue =SendMessageA( descr->owner, msg, wParam, lParam );
|
|
||||||
goto END;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_DROPOBJECT:
|
case WM_DROPOBJECT:
|
||||||
|
@ -2623,27 +2519,37 @@ LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
||||||
LPDRAGINFO dragInfo = (LPDRAGINFO)PTR_SEG_TO_LIN( (SEGPTR)lParam );
|
LPDRAGINFO dragInfo = (LPDRAGINFO)PTR_SEG_TO_LIN( (SEGPTR)lParam );
|
||||||
dragInfo->l = LISTBOX_GetItemFromPoint( wnd, descr, dragInfo->pt.x,
|
dragInfo->l = LISTBOX_GetItemFromPoint( wnd, descr, dragInfo->pt.x,
|
||||||
dragInfo->pt.y );
|
dragInfo->pt.y );
|
||||||
retvalue =SendMessageA( descr->owner, msg, wParam, lParam );
|
return SendMessageA( descr->owner, msg, wParam, lParam );
|
||||||
goto END;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_NCCREATE:
|
case WM_NCCREATE:
|
||||||
if (TWEAK_WineLook > WIN31_LOOK)
|
if (TWEAK_WineLook > WIN31_LOOK)
|
||||||
wnd->dwExStyle |= WS_EX_CLIENTEDGE;
|
wnd->dwExStyle |= WS_EX_CLIENTEDGE;
|
||||||
retvalue =DefWindowProcA( hwnd, msg, wParam, lParam );
|
return DefWindowProcA( hwnd, msg, wParam, lParam );
|
||||||
goto END;
|
|
||||||
default:
|
default:
|
||||||
if ((msg >= WM_USER) && (msg < 0xc000))
|
if ((msg >= WM_USER) && (msg < 0xc000))
|
||||||
WARN(listbox, "[%04x]: unknown msg %04x wp %08x lp %08lx\n",
|
WARN(listbox, "[%04x]: unknown msg %04x wp %08x lp %08lx\n",
|
||||||
hwnd, msg, wParam, lParam );
|
hwnd, msg, wParam, lParam );
|
||||||
retvalue =DefWindowProcA( hwnd, msg, wParam, lParam );
|
return DefWindowProcA( hwnd, msg, wParam, lParam );
|
||||||
goto END;
|
|
||||||
}
|
}
|
||||||
retvalue =0;
|
return 0;
|
||||||
END:
|
}
|
||||||
WIN_ReleaseWndPtr(wnd);
|
|
||||||
return retvalue;
|
/***********************************************************************
|
||||||
|
* ListBoxWndProc
|
||||||
|
*
|
||||||
|
* This is just a wrapper for the real wndproc, it only does window locking
|
||||||
|
* and unlocking.
|
||||||
|
*/
|
||||||
|
LRESULT WINAPI ListBoxWndProc( HWND hwnd, UINT msg,
|
||||||
|
WPARAM wParam, LPARAM lParam )
|
||||||
|
{
|
||||||
|
WND* wndPtr = WIN_FindWndPtr( hwnd );
|
||||||
|
LRESULT res = ListBoxWndProc_locked(wndPtr,msg,wParam,lParam);
|
||||||
|
|
||||||
|
WIN_ReleaseWndPtr(wndPtr);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
|
@ -2671,16 +2577,15 @@ LRESULT COMBO_Directory( LPHEADCOMBO lphc, UINT attrib, LPSTR dir, BOOL bLong)
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* ComboLBWndProc
|
* ComboLBWndProc_locked
|
||||||
*
|
*
|
||||||
* NOTE: in Windows, winproc address of the ComboLBox is the same
|
* The real combo listbox wndproc, but called with locked WND struct.
|
||||||
* as that of the Listbox.
|
|
||||||
*/
|
*/
|
||||||
LRESULT WINAPI ComboLBWndProc( HWND hwnd, UINT msg,
|
static inline LRESULT WINAPI ComboLBWndProc_locked( WND* wnd, UINT msg,
|
||||||
WPARAM wParam, LPARAM lParam )
|
WPARAM wParam, LPARAM lParam )
|
||||||
{
|
{
|
||||||
LRESULT lRet = 0;
|
LRESULT lRet = 0;
|
||||||
WND *wnd = WIN_FindWndPtr( hwnd );
|
HWND hwnd = wnd->hwndSelf;
|
||||||
|
|
||||||
if (wnd)
|
if (wnd)
|
||||||
{
|
{
|
||||||
|
@ -2702,20 +2607,16 @@ LRESULT WINAPI ComboLBWndProc( HWND hwnd, UINT msg,
|
||||||
|
|
||||||
lphc = (LPHEADCOMBO)(lpcs->lpCreateParams);
|
lphc = (LPHEADCOMBO)(lpcs->lpCreateParams);
|
||||||
#undef lpcs
|
#undef lpcs
|
||||||
lRet =LISTBOX_Create( wnd, lphc );
|
return LISTBOX_Create( wnd, lphc );
|
||||||
goto END;
|
|
||||||
case WM_LBUTTONDOWN:
|
case WM_LBUTTONDOWN:
|
||||||
lRet =LISTBOX_HandleLButtonDown( wnd, descr, wParam,
|
return LISTBOX_HandleLButtonDown( wnd, descr, wParam,
|
||||||
(INT16)LOWORD(lParam), (INT16)HIWORD(lParam));
|
(INT16)LOWORD(lParam), (INT16)HIWORD(lParam));
|
||||||
goto END;
|
|
||||||
/* avoid activation at all costs */
|
/* avoid activation at all costs */
|
||||||
|
|
||||||
case WM_MOUSEACTIVATE:
|
case WM_MOUSEACTIVATE:
|
||||||
lRet =MA_NOACTIVATE;
|
return MA_NOACTIVATE;
|
||||||
goto END;
|
|
||||||
case WM_NCACTIVATE:
|
case WM_NCACTIVATE:
|
||||||
lRet =FALSE;
|
return FALSE;
|
||||||
goto END;
|
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
if( CB_GETTYPE(lphc) != CBS_SIMPLE )
|
if( CB_GETTYPE(lphc) != CBS_SIMPLE )
|
||||||
{
|
{
|
||||||
|
@ -2727,34 +2628,47 @@ LRESULT WINAPI ComboLBWndProc( HWND hwnd, UINT msg,
|
||||||
&& (wParam == VK_DOWN || wParam == VK_UP)) )
|
&& (wParam == VK_DOWN || wParam == VK_UP)) )
|
||||||
{
|
{
|
||||||
COMBO_FlipListbox( lphc, FALSE );
|
COMBO_FlipListbox( lphc, FALSE );
|
||||||
lRet =0;
|
return 0;
|
||||||
goto END;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lRet =LISTBOX_HandleKeyDown( wnd, descr, wParam );
|
return LISTBOX_HandleKeyDown( wnd, descr, wParam );
|
||||||
goto END;
|
|
||||||
|
|
||||||
case LB_SETCURSEL16:
|
case LB_SETCURSEL16:
|
||||||
case LB_SETCURSEL:
|
case LB_SETCURSEL:
|
||||||
lRet = ListBoxWndProc( hwnd, msg, wParam, lParam );
|
lRet = ListBoxWndProc( hwnd, msg, wParam, lParam );
|
||||||
lRet =(lRet == LB_ERR) ? lRet : descr->selected_item;
|
lRet =(lRet == LB_ERR) ? lRet : descr->selected_item;
|
||||||
goto END;
|
return lRet;
|
||||||
case WM_NCDESTROY:
|
case WM_NCDESTROY:
|
||||||
if( CB_GETTYPE(lphc) != CBS_SIMPLE )
|
if( CB_GETTYPE(lphc) != CBS_SIMPLE )
|
||||||
lphc->hWndLBox = 0;
|
lphc->hWndLBox = 0;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
|
|
||||||
default:
|
default:
|
||||||
lRet =ListBoxWndProc( hwnd, msg, wParam, lParam );
|
return ListBoxWndProc( hwnd, msg, wParam, lParam );
|
||||||
goto END;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lRet = DefWindowProcA( hwnd, msg, wParam, lParam );
|
lRet = DefWindowProcA( hwnd, msg, wParam, lParam );
|
||||||
|
|
||||||
TRACE(combo,"\t default on msg [%04x]\n", (UINT16)msg );
|
TRACE(combo,"\t default on msg [%04x]\n", (UINT16)msg );
|
||||||
}
|
}
|
||||||
END:
|
|
||||||
WIN_ReleaseWndPtr(wnd);
|
|
||||||
return lRet;
|
return lRet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* ComboLBWndProc
|
||||||
|
*
|
||||||
|
* NOTE: in Windows, winproc address of the ComboLBox is the same
|
||||||
|
* as that of the Listbox.
|
||||||
|
*
|
||||||
|
* This is just a wrapper for the real wndproc, it only does window locking
|
||||||
|
* and unlocking.
|
||||||
|
*/
|
||||||
|
LRESULT WINAPI ComboLBWndProc( HWND hwnd, UINT msg,
|
||||||
|
WPARAM wParam, LPARAM lParam )
|
||||||
|
{
|
||||||
|
WND *wnd = WIN_FindWndPtr( hwnd );
|
||||||
|
LRESULT res = ComboLBWndProc_locked(wnd,msg,wParam,lParam);
|
||||||
|
|
||||||
|
WIN_ReleaseWndPtr(wnd);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue