1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #include "nel/misc/dummy_window.h"
32 static LRESULT CALLBACK
nlDefaultWinProc(HWND hwnd
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
34 return DefWindowProc(hwnd
, uMsg
, wParam
, lParam
);
38 // ***************************************************************
39 CDummyWindow::CDummyWindow() : _HWnd(NULL
)
43 // ***************************************************************
44 bool CDummyWindow::init(HINSTANCE hInstance
, WNDPROC winProc
)
47 static const char *INVISIBLE_WINDOW_CLASS
= "nl_invisible_wnd_class";
49 wc
.cbSize
= sizeof(WNDCLASSEXA
);
50 if (!GetClassInfoExA(hInstance
, INVISIBLE_WINDOW_CLASS
, &wc
))
52 wc
.cbSize
= sizeof(WNDCLASSEXA
);
53 wc
.style
= CS_HREDRAW
| CS_VREDRAW
| CS_DBLCLKS
;
54 wc
.lpfnWndProc
= nlDefaultWinProc
;
57 wc
.hInstance
= hInstance
;
60 wc
.hbrBackground
= NULL
;
61 wc
.lpszMenuName
= NULL
;
62 wc
.lpszClassName
= INVISIBLE_WINDOW_CLASS
;
64 RegisterClassExA(&wc
);
66 _HWnd
= CreateWindowA(INVISIBLE_WINDOW_CLASS
, "", WS_POPUP
,
67 CW_USEDEFAULT
,CW_USEDEFAULT
,
68 CW_USEDEFAULT
,CW_USEDEFAULT
,
73 if (winProc
) SetWindowLongPtrA(_HWnd
, GWLP_WNDPROC
, (LONG_PTR
) winProc
);
79 // ***************************************************************
80 void CDummyWindow::release()
89 // ***************************************************************
90 CDummyWindow::~CDummyWindow()
97 #endif // NL_OS_WINDOWS