summaryrefslogtreecommitdiffstats
path: root/src/libs/7zip/unix/CPP/Windows/Window.h
blob: 1970fe62d458ceb04542f07ff3bb202bf84e297d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Windows/Window.h

#ifndef __WINDOWS_WINDOW_H
#define __WINDOWS_WINDOW_H

#include "Windows/Defs.h"
#include "Common/MyString.h"

namespace NWindows {

HWND GetDlgItem(HWND dialogWindow, int ControlID);
void    MySetWindowText(HWND wnd, LPCWSTR s);

class CWindow
{
private:
   // bool ModifyStyleBase(int styleOffset, DWORD remove, DWORD add, UINT flags);
protected:
  HWND _window;
public:
  CWindow(HWND newWindow = NULL): _window(newWindow){};
  CWindow& operator=(HWND newWindow)
  {
    _window = newWindow;
    return *this;
  }
  operator HWND() const { return _window; }
  void Attach(HWND newWindow) { _window = newWindow; }
  HWND Detach()
  {
    HWND window = _window;
    _window = NULL;
    return window;
  }
  virtual void SetText(LPCWSTR s) { MySetWindowText(_window, s); }
  virtual bool GetText(CSysString &s);
  bool IsEnabled();
};

}

#endif