// WindowClassDefinition.h // // Since the unregistration of the class occurs in the destructor, // it's crucial to create all the classes in the main() or top // level function. // // Revision Log // // Date Who SAR Notes // ========== === ======= ===================================== // (c) Reliable Software, 1997, 98 // Bartosz Milewski, www.relisoft.com // 2001-06-04 mph add namespace rfc(Reliable Foundation Class) // 2001-10-22 mph Add functionality // // // #ifndef WINCLASSMAKER_H #define WINCLASSMAKER_H #include #include "SimpleWindowClassDefinition.h" #include "Icon.h" namespace rfc { class WindowClassDefinition: public SimpleWindowClassDefinition { public: WindowClassDefinition(char const * className, HINSTANCE hInst, WNDPROC wndProc); WindowClassDefinition(int resIdClassName, HINSTANCE hInst, WNDPROC wndProc); ~WindowClassDefinition(); void SetBackgroundBrush(HBRUSH b) { _class.hbrBackground = b; } void SetBackgroundSystemColorValue(int v) { _class.hbrBackground = (HBRUSH)(v+1); } void SetStdMDIFrame() { SetSizeRedraw(); } void SetStdMDIChild() { SetSizeRedraw(); } void SetResIcons(int resId); void SetMenu(int resId); void SetMenu(const char* menuName) { _class.lpszMenuName = menuName; } void SetCursor(HCURSOR hCursor); // nds: LoadImage() as argument void SetSysCursor(const char* id) { _class.hCursor = ::LoadCursor(0, id); } void SetBgSysColor (int sysColor) { _class.hbrBackground = (HBRUSH) (sysColor + 1); } void SetBgBrush (HBRUSH hbr) { _class.hbrBackground = hbr; } void SetStyle(UINT style); void SetDblClicks() { _class.style |= CS_DBLCLKS; } void SetSizeRedraw() { _class.style |= (CS_HREDRAW | CS_VREDRAW); } // Redraw the whole window every time size changes void AddExtraLong() { _class.cbWndExtra += 4; } void Register(); BOOL Unregister(); // only necessary when unloading from NT/W2000 DLL; otherwise, automatic protected: void SetDefaults(); WNDCLASSEX _class; StdIcon _stdIcon; SmallIcon _smallIcon; }; } #endif