added WinStruct<>

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20593 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2003-05-11 22:43:28 +00:00
parent c4e54c6d80
commit bffa02ff6f

View File

@ -330,6 +330,19 @@ inline RECT wxGetClientRect(HWND hwnd)
// small helper classes
// ---------------------------------------------------------------------------
// a template to make initializing Windows styructs less painful: it zeroes all
// the struct fields and also sets cbSize member to the correct value (and so
// can be only used with structures which have this member...)
template <class T>
struct WinStruct : public T
{
WinStruct()
{
::ZeroMemory(this, cbSize = sizeof(T));
}
};
// create an instance of this class and use it as the HDC for screen, will
// automatically release the DC going out of scope
class ScreenHDC