forked from negrutiu/nsis-nscurl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.h
81 lines (69 loc) · 2.31 KB
/
gui.h
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
//? Marius Negrutiu (mailto:[email protected]) :: 2019/12/08
//? User Interface
#pragma once
#include "queue.h"
//+ struct GUI_REQUEST
typedef struct {
QUEUE_SELECTION qsel; /// HTTP requests that we're waiting for
LPTSTR pszReturn; /// Can be NULL. Custom return string (e.g. "@ERRORCODE@")
BOOLEAN bBackground : 1; /// Background transfer, no waiting
BOOLEAN bSilent : 1; /// Wait in Silent-mode
BOOLEAN bPopup : 1; /// Wait in Popup-mode
BOOLEAN bCancel : 1; /// Enable Cancel button in Page-mode and Popup-mode
HWND hTitle, hText, hProgress; /// Optional window handles. Can be NULL
HWND hCancel; /// Optional button handle. Can be NULL
LPTSTR pszTitle;
LPTSTR pszTitleNoSize;
LPTSTR pszTitleMulti;
LPTSTR pszText;
LPTSTR pszTextNoSize;
LPTSTR pszTextMulti;
struct {
ULONG iVisibleId; /// May be 0
ULONG iAnimIndex; /// Auto increment
HWND hTitle, hText, hProgress; /// Runtime controls
HWND hCancel; /// RUntime controls
LPTSTR pszTitle0, pszText0;
} Runtime;
} GUI_REQUEST, *PGUI_REQUEST;
//+ GuiRequestInit
static void GuiRequestInit( _Inout_ PGUI_REQUEST pGui ) {
if (!pGui) return;
ZeroMemory( pGui, sizeof( *pGui ) );
}
//+ GuiRequestDestroy
static void GuiRequestDestroy( _Inout_ PGUI_REQUEST pGui ) {
if (!pGui) return;
MyFree( pGui->qsel.pszTag );
MyFree( pGui->pszReturn );
MyFree( pGui->pszTitle );
MyFree( pGui->pszTitleNoSize );
MyFree( pGui->pszTitleMulti );
MyFree( pGui->pszText );
MyFree( pGui->pszTextNoSize );
MyFree( pGui->pszTextMulti );
MyFree( pGui->Runtime.pszTitle0 );
MyFree( pGui->Runtime.pszText0 );
ZeroMemory( pGui, sizeof( *pGui ) );
}
// ____________________________________________________________________________________________________________________________________ //
// //
//+ Initialization
void GuiInitialize();
void GuiDestroy();
//+ GuiParseRequestParam
BOOL GuiParseRequestParam(
_In_ LPTSTR pszParam, /// Working buffer with the current parameter
_In_ int iParamMaxLen,
_Out_ PGUI_REQUEST pGui
);
//+ GuiWait
void GuiWait(
_Inout_ PGUI_REQUEST pGui,
_Out_ LPTSTR pszResult,
_In_ int iResultMaxLen
);
//+ GuiRefresh
void GuiRefresh(
_Inout_ PGUI_REQUEST pGui
);