-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindow.h
More file actions
112 lines (93 loc) · 2.48 KB
/
Copy pathWindow.h
File metadata and controls
112 lines (93 loc) · 2.48 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#pragma once
#include <Windows.h>
#include <CommCtrl.h>
#if _WIN32_WINNT >= 0x600 && defined(ENABLE_THUMBNAIL)
#include "Thumbnail.h"
#endif
struct WM_SETTEXT_PARAMS
{
HWND hWnd;
LPCTSTR lParam;
};
typedef struct WM_SETTEXT_PARAMS WM_SETTEXT_PARAMS;
struct SET_WINDOW_LONGPTR_PARAMS
{
HWND hWnd;
int nIndex;
LONG_PTR dwNewLong;
};
typedef struct SET_WINDOW_LONGPTR_PARAMS SET_WINDOW_LONGPTR_PARAMS;
struct API_WATCHDOG
{
LPTHREAD_START_ROUTINE proc;
void * parameter;
unsigned int timeout_sec;
};
typedef struct API_WATCHDOG API_WATCHDOG;
enum AdjustBase
{
ByWidth, ByHeight
};
class Window
{
private:
HWND handle;
HWND parent_handle;
unsigned char depth;
HICON w_icon;
HICON w_icon_small;
HICON e_icon;
INT64 item_time_stamp;
DWORD process;
#if _WIN32_WINNT >= 0x600 && defined(ENABLE_THUMBNAIL)
class Thumbnail * thumb;
#endif
bool is_unicode_window;
public:
Window(HWND);
~Window();
bool IsUnicodeWindow() { return is_unicode_window; }
DWORD GetProcess(){return process;}
INT64 GetTimeStamp(){return item_time_stamp;}
HWND GetHandle(){return handle;}
HWND GetParentHandle(){return parent_handle;}
unsigned char GetDepth(){return depth;}
HICON GetIcon(){return w_icon;}
HICON GetCaptionIcon(){return w_icon_small;}
HICON GetProcessIcon(){return e_icon;}
INT_PTR SendMsg(UINT, WPARAM, LPARAM);
bool SendMsg(UINT, WPARAM, LPARAM, UINT, DWORD_PTR *);
void PostMsg(UINT, WPARAM, LPARAM);
void UpdateIcon();
void GetWindowLocation(POINT *, SIZE *);
void GetClientLocation(POINT *, SIZE *);
void SetWindowLocation(const POINT *, const SIZE *);
void SetClientLocation(const POINT *, const SIZE *);
void Move(const POINT *);
void ClientMove(const POINT *);
void Resize(const SIZE *);
void ClientResize(const SIZE *);
DWORD GetStyle();
void SetStyle(DWORD);
DWORD GetExtendStyle();
void SetExtendStyle(DWORD);
void Iconic();
void Maximize();
void Restore();
void BringToTop();
void SinkToBottom();
void ZoomClient(float);
void AdjustWide(AdjustBase);
void AdjustEdison(AdjustBase);
unsigned int GetCaptionLength();
PTSTR GetCaption();
void SetCaption(PCTSTR);
PTSTR GetClassName2();
void GetDispInfo(NMLVDISPINFO *,class WindowList *);
void PopupThumbnail();
static DWORD WINAPI set_caption_thread(LPVOID);
static DWORD WINAPI set_window_longptr_thread(LPVOID);
static DWORD WINAPI api_watchdog(LPVOID);
private:
HICON get_icon_handle(bool);
};