From: Vadim Zeitlin Date: Wed, 21 Sep 2011 15:07:32 +0000 (+0000) Subject: No changes, just extract wxCreateHiddenWindow() declaration in a header. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b481194f519028fb10aa436e857c015eb253d688 No changes, just extract wxCreateHiddenWindow() declaration in a header. Add wx/msw/private/hiddenwin.h with wxCreateHiddenWindow() declaration instead of declaring it manually in all the files using it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69170 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/msw/private/hiddenwin.h b/include/wx/msw/private/hiddenwin.h new file mode 100644 index 0000000000..4353d9c3cb --- /dev/null +++ b/include/wx/msw/private/hiddenwin.h @@ -0,0 +1,31 @@ +/////////////////////////////////////////////////////////////////////////////// +// Name: wx/msw/private/hiddenwin.h +// Purpose: Helper for creating a hidden window used by wxMSW internally. +// Author: Vadim Zeitlin +// Created: 2011-09-16 +// RCS-ID: $Id: wxhead.h,v 1.12 2010-04-22 12:44:51 zeitlin Exp $ +// Copyright: (c) 2011 Vadim Zeitlin +// Licence: wxWindows licence +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_MSW_PRIVATE_HIDDENWIN_H_ +#define _WX_MSW_PRIVATE_HIDDENWIN_H_ + +#include "wx/msw/private.h" + +/* + Creates a hidden window with supplied window proc registering the class for + it if necessary (i.e. the first time only). Caller is responsible for + destroying the window and unregistering the class (note that this must be + done because wxWidgets may be used as a DLL and so may be loaded/unloaded + multiple times into/from the same process so we can't rely on automatic + Windows class unregistration). + + pclassname is a pointer to a caller stored classname, which must initially be + NULL. classname is the desired wndclass classname. If function successfully + registers the class, pclassname will be set to classname. + */ +extern "C" WXDLLIMPEXP_BASE HWND +wxCreateHiddenWindow(LPCTSTR *pclassname, LPCTSTR classname, WNDPROC wndproc); + +#endif // _WX_MSW_PRIVATE_HIDDENWIN_H_ diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp index 7b536c9e9e..be2ba02e39 100644 --- a/src/msw/dialup.cpp +++ b/src/msw/dialup.cpp @@ -40,6 +40,7 @@ #include "wx/generic/choicdgg.h" #include "wx/msw/private.h" +#include "wx/msw/private/hiddenwin.h" #include "wx/dynlib.h" wxDEFINE_EVENT( wxEVT_DIALUP_CONNECTED, wxDialUpEvent ); @@ -66,10 +67,6 @@ wxDEFINE_EVENT( wxEVT_DIALUP_DISCONNECTED, wxDialUpEvent ); #define INTERNET_CONNECTION_PROXY 4 #endif -// implemented in utils.cpp -extern "C" WXDLLIMPEXP_BASE HWND -wxCreateHiddenWindow(LPCTSTR *pclassname, LPCTSTR classname, WNDPROC wndproc); - static const wxChar * wxMSWDIALUP_WNDCLASSNAME = wxT("_wxDialUpManager_Internal_Class"); static const wxChar *gs_classForDialUpWindow = NULL; diff --git a/src/msw/sockmsw.cpp b/src/msw/sockmsw.cpp index d531813ca6..ae92c8873b 100644 --- a/src/msw/sockmsw.cpp +++ b/src/msw/sockmsw.cpp @@ -59,11 +59,9 @@ WX_DECLARE_HASH_MAP(int,bool,wxIntegerHash,wxIntegerEqual,SocketHash); # pragma warning(default:4115) /* named type definition in parentheses */ #endif -#define CLASSNAME TEXT("_wxSocket_Internal_Window_Class") +#include "wx/msw/private/hiddenwin.h" -/* implemented in utils.cpp */ -extern "C" WXDLLIMPEXP_BASE HWND -wxCreateHiddenWindow(LPCTSTR *pclassname, LPCTSTR classname, WNDPROC wndproc); +#define CLASSNAME TEXT("_wxSocket_Internal_Window_Class") /* Maximum number of different wxSocket objects at a given time. * This value can be modified at will, but it CANNOT be greater diff --git a/src/msw/timer.cpp b/src/msw/timer.cpp index fae7e00d87..21f40cfb03 100644 --- a/src/msw/timer.cpp +++ b/src/msw/timer.cpp @@ -31,6 +31,7 @@ #endif #include "wx/msw/private.h" +#include "wx/msw/private/hiddenwin.h" // ---------------------------------------------------------------------------- // private globals @@ -76,11 +77,6 @@ UINT_PTR GetNewTimerId(wxMSWTimerImpl *t) LRESULT APIENTRY _EXPORT wxTimerWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); -// implemented in utils.cpp -extern "C" WXDLLIMPEXP_BASE HWND -wxCreateHiddenWindow(LPCTSTR *pclassname, LPCTSTR classname, WNDPROC wndproc); - - // ---------------------------------------------------------------------------- // wxTimerHiddenWindowModule: used to manage the hidden window used for // catching timer messages (we need a module to ensure that the window is diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index f208feb48f..703a65ae20 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -41,6 +41,7 @@ #include "wx/confbase.h" // for wxExpandEnvVars() #include "wx/msw/private.h" // includes +#include "wx/msw/private/hiddenwin.h" #include "wx/msw/missing.h" // for CHARSET_HANGUL #if defined(__CYGWIN__) @@ -1724,18 +1725,6 @@ extern long wxCharsetToCodepage(const char *name) #endif // wxUSE_FONTMAP/!wxUSE_FONTMAP -/* - Creates a hidden window with supplied window proc registering the class for - it if necesssary (i.e. the first time only). Caller is responsible for - destroying the window and unregistering the class (note that this must be - done because wxWidgets may be used as a DLL and so may be loaded/unloaded - multiple times into/from the same process so we cna't rely on automatic - Windows class unregistration). - - pclassname is a pointer to a caller stored classname, which must initially be - NULL. classname is the desired wndclass classname. If function successfully - registers the class, pclassname will be set to classname. - */ extern "C" WXDLLIMPEXP_BASE HWND wxCreateHiddenWindow(LPCTSTR *pclassname, LPCTSTR classname, WNDPROC wndproc) { diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index 2887ce5340..c2cc31a73b 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -82,9 +82,7 @@ #include "wx/dde.h" // for WX_DDE hack in wxExecute #endif // wxUSE_IPC -// implemented in utils.cpp -extern "C" WXDLLIMPEXP_BASE HWND -wxCreateHiddenWindow(LPCTSTR *pclassname, LPCTSTR classname, WNDPROC wndproc); +#include "wx/msw/private/hiddenwin.h" // ---------------------------------------------------------------------------- // constants