X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/85fa5d02d8a98d59bf1c302bc26212f3f84d1d81..3f93a7508ea292a0ba836eefcccf20a716eaf135:/include/wx/msw/private.h diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 72ef5888c9..421a71771e 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -192,6 +192,22 @@ protected: HANDLE m_handle; }; +// 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 +struct WinStruct : public T +{ + WinStruct() + { + ::ZeroMemory(this, sizeof(T)); + + // explicit qualification is required here for this to be valid C++ + this->cbSize = sizeof(T); + } +}; + + #if wxUSE_GUI #include @@ -342,22 +358,6 @@ 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 -struct WinStruct : public T -{ - WinStruct() - { - ::ZeroMemory(this, sizeof(T)); - - // explicit qualification is required here for this to be valid C++ - 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