X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2341cf5f5955a55d80aebca877a14098803af6a3..6c6bf502f996f48bf200c3588cd21b1921756d71:/src/msw/gsockmsw.c?ds=inline diff --git a/src/msw/gsockmsw.c b/src/msw/gsockmsw.c index 7bc845bed0..a51169eaf0 100644 --- a/src/msw/gsockmsw.c +++ b/src/msw/gsockmsw.c @@ -36,8 +36,8 @@ #endif #ifndef __GSOCKET_STANDALONE__ -#include "wx/defs.h" -#include "wx/setup.h" +# include "wx/platform.h" +# include "wx/setup.h" #endif #if wxUSE_SOCKETS || defined(__GSOCKET_STANDALONE__) @@ -84,7 +84,10 @@ HINSTANCE wxGetInstance(void); #endif #define CLASSNAME TEXT("_GSocket_Internal_Window_Class") -#define WINDOWNAME TEXT("_GSocket_Internal_Window_Name") + +/* implemented in utils.cpp */ +extern WXDLLIMPEXP_BASE HWND +wxCreateHiddenWindow(LPCTSTR *pclassname, LPCTSTR classname, WNDPROC wndproc); /* Maximum number of different GSocket objects at a given time. * This value can be modified at will, but it CANNOT be greater @@ -109,28 +112,13 @@ static int firstAvailable; int _GSocket_GUI_Init(void) { - WNDCLASS winClass; + static LPCTSTR pclassname = NULL; int i; /* Create internal window for event notifications */ - winClass.style = 0; - winClass.lpfnWndProc = _GSocket_Internal_WinProc; - winClass.cbClsExtra = 0; - winClass.cbWndExtra = 0; - winClass.hInstance = INSTANCE; - winClass.hIcon = (HICON) NULL; - winClass.hCursor = (HCURSOR) NULL; - winClass.hbrBackground = (HBRUSH) NULL; - winClass.lpszMenuName = (LPCTSTR) NULL; - winClass.lpszClassName = CLASSNAME; - - RegisterClass(&winClass); - hWin = CreateWindow(CLASSNAME, - WINDOWNAME, - 0, 0, 0, 0, 0, - (HWND) NULL, (HMENU) NULL, INSTANCE, (LPVOID) NULL); - - if (!hWin) return FALSE; + hWin = wxCreateHiddenWindow(&pclassname, CLASSNAME, _GSocket_Internal_WinProc); + if (!hWin) + return FALSE; /* Initialize socket list */ InitializeCriticalSection(&critical); @@ -141,7 +129,7 @@ int _GSocket_GUI_Init(void) } firstAvailable = 0; - return 1; + return TRUE; } void _GSocket_GUI_Cleanup(void)