bool SWindow::Create(void) { CreateModeless = true; if(ControlMode == ControlMode_Normal) { WNDCLASSEX wndclass; wndclass.cbSize = sizeof wndclass; wndclass.style = CS_DBLCLKS; wndclass.lpfnWndProc = SWindowProc; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hInstance = WSLhInstance; wndclass.hIcon = Attr.Icon; wndclass.hCursor = Attr.Cursor; wndclass.hbrBackground = Attr.BackBrush; wndclass.lpszMenuName = NULL; wndclass.lpszClassName = ClassName; wndclass.hIconSm = NULL; ::RegisterClassEx(&wndclass); } switch(ControlMode) { case ControlMode_Normal: case ControlMode_Control: HWindow = ::CreateWindowEx( Attr.ExStyle, ClassName, Caption, Attr.Style, Attr.X, Attr.Y, Attr.W, Attr.H, Parent ? Parent->HWindow : HParentWindow, Attr.Menu ? Attr.Menu : reinterpret_cast<HMENU>(Attr.Id), WSLhInstance, (ControlMode == ControlMode_Normal) ? this : NULL); if(ControlMode == ControlMode_Control) SetSubClass(); break; case ControlMode_Dialog: HWindow = ::CreateDialogParam( WSLhInstance, Attr.DlgId, Parent ? Parent->HWindow : HParentWindow, SDialogProc, reinterpret_cast<LPARAM>(this)); break; } UpdateWindow(); return true; }
void SWindow::HookProc(HWND hwnd, bool Modeless) { if(hwnd) { HWindow = hwnd; HParentWindow = GetParent(); } CreateModeless = Modeless; SetSubClass(); }
bool Control::AddWindowMessages() { if (SetSubClass() == TRUE) return Window::AddWindowMessages(); return false; }