mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-11-24 14:25:37 +08:00
6f3bc497ab
1 1 1 1 1
35 lines
934 B
C++
35 lines
934 B
C++
#ifndef LUNA_BASE_WINDOW_H
|
|
#define LUNA_BASE_WINDOW_H
|
|
class control;
|
|
class basewindow{
|
|
public:
|
|
HFONT hfont=0;
|
|
HWND winId;
|
|
virtual void setgeo(int,int,int,int);
|
|
virtual void on_size(int w,int h);
|
|
RECT getgeo();
|
|
std::wstring text();
|
|
void settext(const std::wstring&);
|
|
void setfont(int,LPCWSTR fn=0);
|
|
operator HWND(){return winId;}
|
|
};
|
|
class mainwindow:public basewindow{
|
|
public:
|
|
std::vector<control*>controls;
|
|
mainwindow* parent;
|
|
HWND lastcontexthwnd;
|
|
control* layout;
|
|
virtual void on_show();
|
|
virtual void on_close();
|
|
void on_size(int w,int h);
|
|
mainwindow(mainwindow* _parent=0);
|
|
LRESULT wndproc(UINT message, WPARAM wParam, LPARAM lParam);
|
|
static void run();
|
|
void show();
|
|
void close();
|
|
void setcentral(int,int);
|
|
std::pair<int,int>calculateXY(int w,int h);
|
|
void setlayout(control*);
|
|
};
|
|
HICON GetExeIcon(const std::wstring& filePath);
|
|
#endif |