summaryrefslogtreecommitdiff
path: root/plugins/AsSingleWindow/src/WindowsManager.h
blob: b3e7e5297f78cf9a2e1f7cea4a3502077a44a428 (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
44
45
46
47
48
49
50
51
52
53
54
#pragma once

#include "stdafx.h"

enum WindowState
{
	WINDOW_STATE_NORMAL,
	WINDOW_STATE_MINIMIZED,
	WINDOW_STATE_MAXIMIZED,
	WINDOW_STATE_HIDDEN,
	WINDOW_STATE_CLOSED, // not used ?
};

enum eWindowPosition
{
	WINDOW_POSITION_LEFT = 1,
	WINDOW_POSITION_RIGHT = 2,
};

struct sWndCoords
{
	LONG x, y, width, height;
};

struct sWindowInfo
{
	HWND hWnd;
	WindowState eState;
	RECT rLastSavedPosition;

	void saveState();
	void saveRect();
};

// critical section tools
void pluginSetProgress();
void pluginSetDone();
bool pluginIsAlreadyRunning();

// system
sWindowInfo* windowFind(HWND);
void windowAdd(HWND, bool);
HWND windowGetRoot(HWND);
void windowListUpdate();
void windowReposition(HWND);

// tools
bool calcNewWindowPosition(HWND, HWND, sWndCoords*, eWindowPosition);
//LONG calcNewWindowPosition(HWND, HWND, RECT*, eWindowPosition);

// window callbacks
LRESULT CALLBACK wndProcSync(HWND, UINT, WPARAM, LPARAM);
void allWindowsMoveAndSize(HWND);
void allWindowsActivation(HWND);