1 // Windows/Window.h 2 3 #ifndef __WINDOWS_WINDOW_H 4 #define __WINDOWS_WINDOW_H 5 6 #include "Windows/Defs.h" 7 #include "Common/MyString.h" 8 9 namespace NWindows { 10 11 HWND GetDlgItem(HWND dialogWindow, int ControlID); 12 void MySetWindowText(HWND wnd, LPCWSTR s); 13 14 class CWindow 15 { 16 private: 17 // bool ModifyStyleBase(int styleOffset, DWORD remove, DWORD add, UINT flags); 18 protected: 19 HWND _window; 20 public: _window(newWindow)21 CWindow(HWND newWindow = NULL): _window(newWindow){}; 22 CWindow& operator=(HWND newWindow) 23 { 24 _window = newWindow; 25 return *this; 26 } HWND()27 operator HWND() const { return _window; } Attach(HWND newWindow)28 void Attach(HWND newWindow) { _window = newWindow; } Detach()29 HWND Detach() 30 { 31 HWND window = _window; 32 _window = NULL; 33 return window; 34 } SetText(LPCWSTR s)35 virtual void SetText(LPCWSTR s) { MySetWindowText(_window, s); } 36 virtual bool GetText(CSysString &s); 37 bool IsEnabled(); 38 }; 39 40 } 41 42 #endif 43 44