Add WXWNDPROC typedef and use it in wxMSW instead of WXFARPROC

WNDPROC and FARPROC are not the same thing in MSW and it's wrong to use
WXFARPROC as the type of different window procedures we use.

Introduce WXWNDPROC which is more clear and correct and use it instead.

Also get rid of a few casts which are not necessary any longer.
This commit is contained in:
Vadim Zeitlin
2018-05-28 23:10:13 +02:00
parent 7624e31a95
commit 4230cb24de
8 changed files with 24 additions and 20 deletions

View File

@@ -81,10 +81,10 @@
#if USE_NOTEBOOK_ANTIFLICKER
// the pointer to standard spin button wnd proc
static WXFARPROC gs_wndprocNotebookSpinBtn = (WXFARPROC)NULL;
static WXWNDPROC gs_wndprocNotebookSpinBtn = NULL;
// the pointer to standard tab control wnd proc
static WXFARPROC gs_wndprocNotebook = (WXFARPROC)NULL;
static WXWNDPROC gs_wndprocNotebook = NULL;
LRESULT APIENTRY
wxNotebookWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
@@ -202,8 +202,7 @@ bool wxNotebook::Create(wxWindow *parent,
if ( ::GetClassInfo(NULL, WC_TABCONTROL, &wc) )
{
gs_wndprocNotebook =
reinterpret_cast<WXFARPROC>(wc.lpfnWndProc);
gs_wndprocNotebook = wc.lpfnWndProc;
wc.lpszClassName = wxT("_wx_SysTabCtl32");
wc.style &= ~(CS_HREDRAW | CS_VREDRAW);
wc.hInstance = wxGetInstance();
@@ -996,7 +995,7 @@ void wxNotebook::OnSize(wxSizeEvent& event)
{
// subclass the spin button to override WM_ERASEBKGND
if ( !gs_wndprocNotebookSpinBtn )
gs_wndprocNotebookSpinBtn = (WXFARPROC)wxGetWindowProc(child);
gs_wndprocNotebookSpinBtn = wxGetWindowProc(child);
wxSetWindowProc(child, wxNotebookSpinBtnWndProc);
m_hasSubclassedUpdown = true;