aboutsummaryrefslogtreecommitdiff
path: root/include/cru/win/native/god_window.hpp
blob: 9ac4985888ddd7a4902de880c1d47160f83e9760 (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
#pragma once
#include "../win_pre_config.hpp"

#include "cru/common/base.hpp"

#include <memory>

namespace cru::win::native {
class WinApplication;
class WindowClass;

class GodWindow : public Object {
 public:
  explicit GodWindow(WinApplication* application);
  GodWindow(const GodWindow& other) = delete;
  GodWindow(GodWindow&& other) = delete;
  GodWindow& operator=(const GodWindow& other) = delete;
  GodWindow& operator=(GodWindow&& other) = delete;
  ~GodWindow() override;

  HWND GetHandle() const { return hwnd_; }

  bool HandleGodWindowMessage(HWND hwnd, UINT msg, WPARAM w_param,
                              LPARAM l_param, LRESULT* result);

 private:
  WinApplication* application_;

  std::shared_ptr<WindowClass> god_window_class_;
  HWND hwnd_;
};
}  // namespace cru::win::native