ReactOS 0.4.15-dev-7906-g1b85a5f
scrnsave.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define idsIsPassword   1000
 
#define idsIniFile   1001
 
#define idsScreenSaver   1002
 
#define idsPassword   1003
 
#define idsDifferentPW   1004
 
#define idsChangePW   1005
 
#define idsBadOldPW   1006
 
#define idsAppName   1007
 
#define idsNoHelpMemory   1008
 
#define idsHelpFile   1009
 
#define idsDefKeyword   1010
 
#define DLG_SCRNSAVECONFIGURE   2003
 
#define IDS_DESCRIPTION   1
 
#define ID_APP   100
 
#define WS_GT   (WS_GROUP | WS_TABSTOP)
 
#define MAXFILELEN   13
 
#define TITLEBARNAMELEN   40
 
#define APPNAMEBUFFERLEN   40
 
#define BUFFLEN   255
 

Functions

BOOL WINAPI ScreenSaverConfigureDialog (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL WINAPI RegisterDialogClasses (HANDLE hInst)
 
LRESULT WINAPI ScreenSaverProc (HWND, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI DefScreenSaverProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 

Variables

HINSTANCE hMainInstance
 
HWND hMainWindow
 
BOOL fChildPreview
 
TCHAR szName []
 
TCHAR szAppName []
 
TCHAR szIniFile []
 
TCHAR szScreenSaver []
 
TCHAR szHelpFile []
 
TCHAR szNoHelpMemory []
 
UINT MyHelpMessage
 

Macro Definition Documentation

◆ APPNAMEBUFFERLEN

#define APPNAMEBUFFERLEN   40

Definition at line 38 of file scrnsave.h.

◆ BUFFLEN

#define BUFFLEN   255

Definition at line 39 of file scrnsave.h.

◆ DLG_SCRNSAVECONFIGURE

#define DLG_SCRNSAVECONFIGURE   2003

Definition at line 30 of file scrnsave.h.

◆ ID_APP

#define ID_APP   100

Definition at line 33 of file scrnsave.h.

◆ IDS_DESCRIPTION

#define IDS_DESCRIPTION   1

Definition at line 32 of file scrnsave.h.

◆ idsAppName

#define idsAppName   1007

Definition at line 24 of file scrnsave.h.

◆ idsBadOldPW

#define idsBadOldPW   1006

Definition at line 23 of file scrnsave.h.

◆ idsChangePW

#define idsChangePW   1005

Definition at line 22 of file scrnsave.h.

◆ idsDefKeyword

#define idsDefKeyword   1010

Definition at line 27 of file scrnsave.h.

◆ idsDifferentPW

#define idsDifferentPW   1004

Definition at line 21 of file scrnsave.h.

◆ idsHelpFile

#define idsHelpFile   1009

Definition at line 26 of file scrnsave.h.

◆ idsIniFile

#define idsIniFile   1001

Definition at line 18 of file scrnsave.h.

◆ idsIsPassword

#define idsIsPassword   1000

Definition at line 17 of file scrnsave.h.

◆ idsNoHelpMemory

#define idsNoHelpMemory   1008

Definition at line 25 of file scrnsave.h.

◆ idsPassword

#define idsPassword   1003

Definition at line 20 of file scrnsave.h.

◆ idsScreenSaver

#define idsScreenSaver   1002

Definition at line 19 of file scrnsave.h.

◆ MAXFILELEN

#define MAXFILELEN   13

Definition at line 36 of file scrnsave.h.

◆ TITLEBARNAMELEN

#define TITLEBARNAMELEN   40

Definition at line 37 of file scrnsave.h.

◆ WS_GT

#define WS_GT   (WS_GROUP | WS_TABSTOP)

Definition at line 35 of file scrnsave.h.

Function Documentation

◆ DefScreenSaverProc()

LRESULT WINAPI DefScreenSaverProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 92 of file scrnsave.c.

93{
94 // Don't do any special processing when in preview mode
95 if (fChildPreview)
96 return DefWindowProc(hWnd, uMsg, wParam, lParam);
97
98 switch (uMsg)
99 {
100 case WM_NCACTIVATE:
101 case WM_ACTIVATE:
102 case WM_ACTIVATEAPP:
103 if (!wParam)
104 {
105 // wParam is FALSE, so the screen saver is losing the focus.
106 PostMessage(hWnd, WM_CLOSE, 0, 0);
107 }
108 break;
109
110 case WM_MOUSEMOVE:
111 {
112 POINT pt;
114
115 if (!pt_init)
116 {
117 pt_orig = pt;
118 pt_init = TRUE;
119 break;
120 }
121
122 if (abs(pt.x-pt_orig.x) > 10 || abs(pt.y-pt_orig.y) > 10)
123 PostMessage(hWnd, WM_CLOSE, 0, 0);
124 break;
125 }
126
127 case WM_LBUTTONDOWN:
128 case WM_MBUTTONDOWN:
129 case WM_RBUTTONDOWN:
130 case WM_XBUTTONDOWN:
131 case WM_KEYDOWN:
132 case WM_KEYUP:
133 case WM_SYSKEYDOWN:
134 // Send a WM_CLOSE to close the screen saver (allows
135 // the screen saver to perform clean-up tasks)
136 PostMessage(hWnd, WM_CLOSE, 0, 0);
137 break;
138
139 case WM_SETCURSOR:
141 return TRUE;
142 }
143
144 return DefWindowProc(hWnd, uMsg, wParam, lParam);
145}
HWND hWnd
Definition: settings.c:17
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define pt(x, y)
Definition: drawing.c:79
#define abs(i)
Definition: fconv.c:206
#define DefWindowProc
Definition: ros2win.h:31
static POINT pt_orig
Definition: scrnsave.c:36
BOOL fChildPreview
Definition: scrnsave.c:25
static BOOL pt_init
Definition: scrnsave.c:37
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define WM_CLOSE
Definition: winuser.h:1621
#define WM_KEYUP
Definition: winuser.h:1716
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2670
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define WM_MOUSEMOVE
Definition: winuser.h:1775
#define WM_LBUTTONDOWN
Definition: winuser.h:1776
#define WM_ACTIVATE
Definition: winuser.h:1612
#define WM_RBUTTONDOWN
Definition: winuser.h:1779
#define WM_NCACTIVATE
Definition: winuser.h:1688
#define PostMessage
Definition: winuser.h:5832
#define WM_SETCURSOR
Definition: winuser.h:1636
#define WM_ACTIVATEAPP
Definition: winuser.h:1632
#define WM_KEYDOWN
Definition: winuser.h:1715
#define WM_SYSKEYDOWN
Definition: winuser.h:1719
#define WM_MBUTTONDOWN
Definition: winuser.h:1782

Referenced by ScreenSaverProc().

◆ RegisterDialogClasses()

BOOL WINAPI RegisterDialogClasses ( HANDLE  hInst)

Definition at line 432 of file 3dtext.c.

433{
434 return TRUE;
435}

Referenced by LaunchConfig().

◆ ScreenSaverConfigureDialog()

BOOL WINAPI ScreenSaverConfigureDialog ( HWND  hDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 397 of file 3dtext.c.

398{
399 switch (uMsg)
400 {
401 case WM_INITDIALOG:
402 LoadSettings();
404 return TRUE;
405
406 case WM_COMMAND:
407 switch (LOWORD(wParam))
408 {
409 case IDOK:
411 SaveSettings();
412
413 /* Fall through */
414
415 case IDCANCEL:
416 EndDialog(hDlg, IDCANCEL);
417 break;
418 }
419 return FALSE;
420
421 case WM_CLOSE:
422 EndDialog(hDlg, 0);
423 break;
424
425 default:
426 return FALSE;
427 }
428
429 return TRUE;
430}
TCHAR m_Text[MAX_PATH]
Definition: settings.c:25
void SaveSettings(void)
Definition: settings.c:115
void LoadSettings(void)
Definition: settings.c:53
#define IDC_MESSAGE_TEXT
Definition: resource.h:5
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
#define LOWORD(l)
Definition: pedump.c:82
#define IDCANCEL
Definition: winuser.h:831
#define GetDlgItemText
Definition: winuser.h:5785
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_INITDIALOG
Definition: winuser.h:1739
#define IDOK
Definition: winuser.h:830
#define SetDlgItemText
Definition: winuser.h:5849
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)

Referenced by LaunchConfig().

◆ ScreenSaverProc()

LRESULT WINAPI ScreenSaverProc ( HWND  hWnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 259 of file 3dtext.c.

260{
261 RECT Screen; // Used Later On To Get The Size Of The Window
262 GLuint PixelFormat; // Pixel Format Storage
263 static PIXELFORMATDESCRIPTOR pfd= // Pixel Format Descriptor
264 {
265 sizeof(PIXELFORMATDESCRIPTOR), // Size Of This Pixel Format Descriptor
266 1, // Version Number (?)
267 PFD_DRAW_TO_WINDOW | // Format Must Support Window
268 PFD_SUPPORT_OPENGL | // Format Must Support OpenGL
269 PFD_DOUBLEBUFFER, // Must Support Double Buffering
270 PFD_TYPE_RGBA, // Request An RGBA Format
271 16, // Select A 16Bit Color Depth
272 0, 0, 0, 0, 0, 0, // Color Bits Ignored (?)
273 0, // No Alpha Buffer
274 0, // Shift Bit Ignored (?)
275 0, // No Accumulation Buffer
276 0, 0, 0, 0, // Accumulation Bits Ignored (?)
277 16, // 16Bit Z-Buffer (Depth Buffer)
278 0, // No Stencil Buffer
279 0, // No Auxiliary Buffer (?)
280 PFD_MAIN_PLANE, // Main Drawing Layer
281 0, // Reserved (?)
282 0, 0, 0 // Layer Masks Ignored (?)
283 };
284
285 switch (message)
286 {
287 case WM_CREATE:
288 LoadSettings();
289
290 // Gets A Device Context For The Window
291 hDC = GetDC(hWnd);
292
293 // Finds The Closest Match To The Pixel Format We Set Above
295
296 // No Matching Pixel Format?
297 if (!PixelFormat)
298 {
299 MessageBox(0, _TEXT("Can't Find A Suitable PixelFormat."), _TEXT("Error"),MB_OK | MB_ICONERROR);
300
301 // This Sends A 'Message' Telling The Program To Quit
303 break;
304 }
305
306 // Can We Set The Pixel Mode?
308 {
309 MessageBox(0, _TEXT("Can't Set The PixelFormat."), _TEXT("Error"), MB_OK | MB_ICONERROR);
310
311 // This Sends A 'Message' Telling The Program To Quit
313 break;
314 }
315
316 // Grab A Rendering Context
318
319 // Did We Get One?
320 if (!hRC)
321 {
322 MessageBox(0, _TEXT("Can't Create A GL Rendering Context."), _TEXT("Error"), MB_OK | MB_ICONERROR);
323
324 // This Sends A 'Message' Telling The Program To Quit
326 break;
327 }
328
329 // Can We Make The RC Active?
330 if (!wglMakeCurrent(hDC, hRC))
331 {
332 MessageBox(0, _TEXT("Can't Activate GLRC."), _TEXT("Error"), MB_OK | MB_ICONERROR);
333
334 // This Sends A 'Message' Telling The Program To Quit
336 break;
337 }
338
339 // Grab Screen Info For The Current Window
341
342 // Initialize The GL Screen Using Screen Info
343 InitGL(Screen.right, Screen.bottom);
344
345 // Create Graphics update timer
347 break;
348
349 case WM_DESTROY:
350 // Disable Fullscreen Mode
351 ChangeDisplaySettings(NULL, 0);
352
353 // Delete the Update Timer
355
356 // Deletes The Font Display List
357 KillFont();
358
359 // Make The DC Current
361
362 // Kill The RC
364
365 // Free The DC
367 break;
368
369 case WM_PAINT:
370 DrawGLScene();
372 // Mark this window as updated, so the OS won't ask us to update it again.
374 break;
375
376 case WM_SIZE: // Resizing The Screen
377 // Resize To The New Window Size
379 break;
380
381 case WM_TIMER:
382 // Used to update graphic based on timer udpate interval
384 break;
385
386 default:
387 // Pass Windows Messages to the default screensaver window procedure
389 }
390
391 return 0;
392}
GLvoid InitGL(GLsizei Width, GLsizei Height)
Definition: 3dtext.c:144
GLvoid ReSizeGLScene(GLsizei Width, GLsizei Height)
Definition: 3dtext.c:187
GLvoid KillFont(GLvoid)
Definition: 3dtext.c:111
#define APP_TIMER_INTERVAL
Definition: 3dtext.c:46
static HDC hDC
Definition: 3dtext.c:33
static HGLRC hRC
Definition: 3dtext.c:32
GLvoid DrawGLScene(GLvoid)
Definition: 3dtext.c:213
#define APP_TIMER
Definition: 3dtext.c:45
UINT uTimerID
Definition: 3dtext.c:44
@ Screen
Definition: console.h:34
INT PixelFormat
unsigned int GLuint
Definition: gl.h:159
#define _TEXT(x)
Definition: tchar.h:1535
LRESULT WINAPI DefScreenSaverProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: scrnsave.c:92
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67
Definition: tftpd.h:60
#define HIWORD(l)
Definition: typedefs.h:247
BOOL WINAPI wglDeleteContext(HGLRC hglrc)
Definition: wgl.c:514
HGLRC WINAPI wglCreateContext(HDC hdc)
Definition: wgl.c:383
BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
Definition: wgl.c:650
int WINAPI ChoosePixelFormat(_In_ HDC hdc, _In_ const PIXELFORMATDESCRIPTOR *ppfd)
BOOL WINAPI SetPixelFormat(_In_ HDC, _In_ int, _In_ const PIXELFORMATDESCRIPTOR *)
#define PFD_SUPPORT_OPENGL
Definition: wingdi.h:306
struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR
BOOL WINAPI SwapBuffers(HDC)
Definition: wingl.c:187
#define PFD_DRAW_TO_WINDOW
Definition: wingdi.h:303
#define PFD_MAIN_PLANE
Definition: wingdi.h:298
#define PFD_TYPE_RGBA
Definition: wingdi.h:296
#define PFD_DOUBLEBUFFER
Definition: wingdi.h:301
#define WM_PAINT
Definition: winuser.h:1620
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define WM_CREATE
Definition: winuser.h:1608
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SIZE
Definition: winuser.h:1611
BOOL WINAPI ValidateRect(_In_opt_ HWND, _In_opt_ LPCRECT)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define MB_ICONERROR
Definition: winuser.h:787
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define WM_TIMER
Definition: winuser.h:1742
HDC WINAPI GetDC(_In_opt_ HWND)
#define MB_OK
Definition: winuser.h:790
#define MessageBox
Definition: winuser.h:5822
#define WM_DESTROY
Definition: winuser.h:1609
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

Referenced by SysScreenSaverProc().

Variable Documentation

◆ fChildPreview

BOOL fChildPreview
extern

Definition at line 25 of file scrnsave.c.

Referenced by DefScreenSaverProc(), LaunchScreenSaver(), and SysScreenSaverProc().

◆ hMainInstance

HINSTANCE hMainInstance
extern

Definition at line 26 of file scrnsave.c.

Referenced by _tWinMain(), LaunchConfig(), LaunchScreenSaver(), and RegisterScreenSaverClass().

◆ hMainWindow

HWND hMainWindow
extern

Definition at line 24 of file scrnsave.c.

Referenced by LaunchScreenSaver().

◆ MyHelpMessage

UINT MyHelpMessage
extern

Definition at line 33 of file scrnsave.c.

◆ szAppName

◆ szHelpFile

TCHAR szHelpFile[]
extern

◆ szIniFile

◆ szName

TCHAR szName[]
extern

Definition at line 104 of file fdi.c.

◆ szNoHelpMemory

TCHAR szNoHelpMemory[]
extern

Definition at line 32 of file scrnsave.c.

◆ szScreenSaver

TCHAR szScreenSaver[]
extern

Definition at line 30 of file scrnsave.c.