summaryrefslogtreecommitdiff
path: root/plugins/AsSingleWindow/src/WindowsManager.h
blob: e47c03655e5058eecef1eddfbed6a2516535ae12 (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
55
56
57
58
59
60
61
62
#pragma once

#ifndef WINDOWSMANAGER_H
#define WINDOWSMANAGER_H

#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;
    WNDPROC pPrevWndProc;
    RECT rLastSavedPosition;

    void saveState();
    void saveRect();
    //void restoreRect();
};

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

// system
sWindowInfo* windowFind(HWND);
//windowsList::iterator windowFindItr(HWND);
//windowsList::reverse_iterator windowFindRevItr(HWND);
void windowAdd(HWND, bool);
//void windowRemove(HWND);
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);

#endif WINDOWSMANAGER_H

// end of file