-
Notifications
You must be signed in to change notification settings - Fork 8
/
globals.h
254 lines (191 loc) · 7.75 KB
/
globals.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
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
/*!=========================================================================
//
// Program: ZMatrix
// Module: $RCSfile: globals.h,v $
// Language: C/C++
// Date: $Date: 2003/05/10 17:06:18 $
// Version: $Revision: 1.26 $
//
// Copyright (c) 2001-2002 Z. Shaker
// All rights reserved.
// See License.txt for details.
//
// This file is part of ZMatrix.
//
// ZMatrix is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// ZMatrix is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with ZMatrix; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//=========================================================================*/
#pragma warning( disable : 4786 )
#ifndef __globals_h
#define __globals_h
#include <windows.h>
#include <windowsx.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <windowsx.h>
#include <shellapi.h>
#include <commctrl.h>
#include <wingdi.h>
#include <string.h>
#include <string>
#include <vector>
#include <deque>
#include <algorithm>
#include "resource.h"
#include "zsMatrix/zsMatrix.h"
#include "MsgHook/MsgHook.h"
#ifdef USE_MEM_MANAGER
#include "mmgr.h"
#endif
using namespace std;
#define MB(txt) {(MessageBox(ghWnd,_TEXT(txt),_TEXT("debug"),MB_OK)); OutputDebugString(__TEXT(txt));OutputDebugString(__TEXT("\n"));}
#define WM_TRAYICON (WM_USER + 1)
#define WM_START_SCREENSAVE (WM_USER + 2)
#define WM_END_SCREENSAVE (WM_USER + 3)
#define WM_OTHERDESKTOPSETTINGCHANGED (WM_USER + 4)
#define WM_DESKTOPWALLPAPERCHANGED (WM_USER + 5)
#define WM_GET_MATRIX_OBJECT (WM_USER + 6)
#define WM_GET_COEFF_R0 (WM_USER + 7)
#define WM_SET_COEFF_R0 (WM_USER + 8)
#define WM_GET_COEFF_R1 (WM_USER + 9)
#define WM_SET_COEFF_R1 (WM_USER + 10)
#define WM_GET_COEFF_G0 (WM_USER + 11)
#define WM_SET_COEFF_G0 (WM_USER + 12)
#define WM_GET_COEFF_G1 (WM_USER + 13)
#define WM_SET_COEFF_G1 (WM_USER + 14)
#define WM_GET_COEFF_B0 (WM_USER + 15)
#define WM_SET_COEFF_B0 (WM_USER + 16)
#define WM_GET_COEFF_B1 (WM_USER + 17)
#define WM_SET_COEFF_B1 (WM_USER + 18)
#define WM_DPICHANGED 0x02E0
#ifndef WM_UPDATEUISTATE
#define WM_UPDATEUISTATE 0x0128
#endif
#define REFRESH_TIMER_ID 400
#define SINGLE_CLICK_TIMER_ID 401
#define DESKTOPREDRAW_EVENT_ID _T("DESKTOPREDRAW_EVENT-{1593B99A-5D70-41d5-A271-AE6113B50BB7}")
#define HOMEPAGE_URL _T("http://zmatrix.n3.net")
#define PROJECTSUMMARYPAGE_URL _T("http://sourceforge.net/projects/zmatrix/")
#define SUPPORTREQUESTS_URL _T("http://sourceforge.net/tracker/?atid=493576&group_id=60257&func=browse")
#define BUGREPORTS_URL _T("http://sourceforge.net/tracker/?atid=493575&group_id=60257&func=browse")
#define FEATUREREQUESTS_URL _T("http://sourceforge.net/tracker/?atid=493578&group_id=60257&func=browse")
#define DISCUSSIONFORUMS_URL _T("http://sourceforge.net/forum/?group_id=60257")
#define DONATE_URL _T("http://zmatrix.n3.net/donate.html")
extern unsigned int RefreshTime;
extern HANDLE DESKTOPREDRAW_Event;
typedef std::basic_string<_TCHAR> _tstring;
typedef std::basic_string<_TCHAR> tstring;
typedef std::basic_string<WCHAR> widestring;
typedef std::basic_string<CHAR> string;
extern _TCHAR szWinName[];
extern unsigned int gscreenWidth;
extern unsigned int gscreenHeight;
extern int gscreenTop;
extern int gscreenLeft;
extern HDC ghdc;
extern HMENU gSysTrayMenu;
extern HMENU gSysTrayPopup;
extern HINSTANCE ghInstance;
extern HWND ghWnd;
extern HWND ghProgman;
extern HWND WorkerW;
extern HWND ghShellDLL;
extern HWND ghSysListView;
extern bool LiteStepMode;
extern NOTIFYICONDATA IconData;
extern HRGN ValidRGN;
extern IzsMatrix *PreScreenSaveMatrixObject;
extern bool PreScreenSavePauseState;
extern unsigned int PreScreenSaveRefreshTime;
extern DWORD PreScreenSavePriorityClass;
extern IzsMatrix *MatrixObject;
extern bool Paused;
extern bool DesktopIsCleared;
extern bool WallpaperIsCleared;
extern bool DesktopColorIsCleared;
extern bool OrigDesktopColorIsValid;
extern COLORREF OrigDesktopColor;
extern bool OrigWallpaperIsValid;
extern _tstring OrigWallpaperString;
extern bool OrigActiveDesktopWallpaperIsValid;
extern widestring OrigActiveDesktopWallpaperString;
extern TCHAR AllUsersStartupDirectoryPath[MAX_PATH];
extern _tstring AllUsersStartupShortcutPath;
extern TCHAR CurrentUserStartupDirectoryPath[MAX_PATH];
extern _tstring CurrentUserStartupShortcutPath;
extern _tstring MatrixCommandLine;
extern TCHAR CurrentUserAppDataDirectoryPath[MAX_PATH];
extern _tstring AppConfigDirectoryPath;
extern _tstring AppConfigFilePath;
extern _tstring AppScreenSaverConfigFilePath;
extern _tstring AppMiscConfigFilePath;
extern bool ReadyToScreenSave;
extern bool OutstandingScreenSaveRequest;
extern bool InScreenSaveMode;
extern bool UnSetSSWhenDone;
typedef pair<WPARAM,LPARAM> OutstandingScreenSaveRequestPair;
extern vector<OutstandingScreenSaveRequestPair> OutstandingScreenSaveRequestParams;
extern POINT MouseScreenPointAtScreenSaveStart;
extern bool AlwaysSetAsScreenSaverWhileRunning;
extern bool BlendScreenSaverWithBGOnly;
void SetAlwaysSetAsScreenSaverWhileRunning(bool NewVal);
void SetBlendScreenSaverWithBGOnly(bool NewVal);
typedef int (__stdcall *AboutFormLauncher)(void *Parent);
typedef int (__stdcall *HireFormLauncher)(void *Parent);
typedef int (__stdcall *ConfigFormLauncher)(IzsMatrix *Matrix,unsigned int &RefreshTime,DWORD &Priority);
typedef int (__stdcall *ConfigSaver)(IzsMatrix *Matrix,unsigned int RefreshTime,DWORD Priority,_TCHAR *FileName);
typedef int (__stdcall *ConfigLoader)(IzsMatrix *Matrix,unsigned int &RefreshTime,DWORD &Priority,_TCHAR *FileName);
void MinimizeAll(void);
void UndoMinimizeAll(void);
void StoreOrigWallpaper(const _TCHAR *NewPaper = NULL);
void StoreOrigActiveDesktopWallpaper(const WCHAR *NewActiveDesktopPaper = NULL);
void StoreOrigDesktopColor(const COLORREF *NewColor = NULL);
void StoreOrigDesktop(const _TCHAR *NewPaper = NULL,const WCHAR *NewActiveDesktopPaper = NULL,const COLORREF *NewColor = NULL);
void RestoreOrigWallpaper(void);
void RestoreOrigDesktopColor(void);
void RestoreOrigDesktop(void);
void ClearWallpaper(void);
void ClearDesktopColor(void);
void ClearDesktop(void);
void EnforceDesktop(void);
typedef _tstring IgnoredWallpaperChangeElement;
extern deque<IgnoredWallpaperChangeElement> WallpaperChangesToIgnore;
typedef COLORREF IgnoredBGColorChangeElement;
extern deque<IgnoredBGColorChangeElement> BGColorChangesToIgnore;
extern int SelfPostedDesktopChildAttached;
BYTE GetBGAlpha(void);
HBITMAP UpdateBG(void);
void UpdateRegions(void);
HBITMAP Refresh(void);
bool DirectoryExists(const _TCHAR *DirName);
bool FileExists(const _TCHAR *DirName);
HRESULT CreateLink(const TCHAR *LinkTarget, const TCHAR *LinkLocation);
void RemoveLink(const TCHAR *LinkLocation);
bool GetMatrixCommandLine(_tstring &Target);
void BeginScreenSaveMode(HWND WindowToNotify = NULL,UINT MessageToSend = 0);
void EndScreenSaveMode(void);
void SetZMatrixSS(void);
void UnSetZMatrixSS(void);
void SetZMatrixSS_NoBackup(void);
void ProcessMiscConfiguration(void);
bool LaunchConfig(IzsMatrix *&ObjectToConfig);
bool LaunchScreenSaverConfig(IzsMatrix *&ObjectToConfig);
bool SaveConfig(IzsMatrix *Matrix,unsigned int RefreshTime,const _TCHAR *ConfigFile = NULL);
bool LoadConfig(IzsMatrix *Matrix,unsigned int &RefreshTime,const _TCHAR *ConfigFile = NULL);
void BeforeClose(void);
bool SaveBitmap( HBITMAP hbmp, LPCTSTR pszFile );
void LogToFile(const _TCHAR *format, ...);
#endif