ReactOS  0.4.14-dev-614-gbfd8a84
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 95 of file scrnsave.c.

96 {
97  // Don't do any special processing when in preview mode
98  if (fChildPreview)
99  return DefWindowProc(hWnd, uMsg, wParam, lParam);
100 
101  switch (uMsg)
102  {
103  case WM_NCACTIVATE:
104  case WM_ACTIVATE:
105  case WM_ACTIVATEAPP:
106  if (!wParam)
107  {
108  // wParam is FALSE, so the screen saver is losing the focus.
109  PostMessage(hWnd, WM_CLOSE, 0, 0);
110  }
111  break;
112 
113  case WM_MOUSEMOVE:
114  {
115  POINT pt;
116  GetCursorPos(&pt);
117  // TODO: Implement mouse move threshold. See:
118  // http://svn.reactos.org/svn/reactos/trunk/rosapps/applications/screensavers/starfield/screensaver.c?r1=67455&r2=67454&pathrev=67455
119  if (pt.x == pt_orig.x && pt.y == pt_orig.y)
120  break;
121 
122  // Fall through
123  }
124 
125  case WM_LBUTTONDOWN:
126  case WM_MBUTTONDOWN:
127  case WM_RBUTTONDOWN:
128  case WM_XBUTTONDOWN:
129  case WM_KEYDOWN:
130  case WM_KEYUP:
131  case WM_SYSKEYDOWN:
132  // Send a WM_CLOSE to close the screen saver (allows
133  // the screen saver to perform clean-up tasks)
134  PostMessage(hWnd, WM_CLOSE, 0, 0);
135  break;
136 
137  case WM_SETCURSOR:
138  SetCursor(NULL);
139  return TRUE;
140  }
141 
142  return DefWindowProc(hWnd, uMsg, wParam, lParam);
143 }
#define TRUE
Definition: types.h:120
long y
Definition: polytest.cpp:48
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
long x
Definition: polytest.cpp:48
#define pt(x, y)
Definition: drawing.c:79
HWND hWnd
Definition: settings.c:17
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
WPARAM wParam
Definition: combotst.c:138
BOOL fChildPreview
Definition: scrnsave.c:24
#define WM_NCACTIVATE
Definition: winuser.h:1670
#define WM_SETCURSOR
Definition: winuser.h:1618
static POINT pt_orig
Definition: scrnsave.c:35
smooth NULL
Definition: ftsmooth.c:416
#define WM_KEYDOWN
Definition: winuser.h:1697
#define DefWindowProc
Definition: ros2win.h:31
#define WM_RBUTTONDOWN
Definition: winuser.h:1761
#define PostMessage
Definition: winuser.h:5807
#define WM_CLOSE
Definition: winuser.h:1603
#define WM_KEYUP
Definition: winuser.h:1698
#define WM_ACTIVATEAPP
Definition: winuser.h:1614
#define WM_ACTIVATE
Definition: winuser.h:1594
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define WM_MBUTTONDOWN
Definition: winuser.h:1764
#define WM_MOUSEMOVE
Definition: winuser.h:1757
#define WM_SYSKEYDOWN
Definition: winuser.h:1701
LPARAM lParam
Definition: combotst.c:139

Referenced by ScreenSaverProc().

◆ RegisterDialogClasses()

BOOL WINAPI RegisterDialogClasses ( HANDLE  hInst)

Definition at line 416 of file 3dtext.c.

417 {
418  return TRUE;
419 }
#define TRUE
Definition: types.h:120

Referenced by LaunchConfig().

◆ ScreenSaverConfigureDialog()

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

Definition at line 381 of file 3dtext.c.

382 {
383  switch (uMsg)
384  {
385  case WM_INITDIALOG:
386  LoadSettings();
388  return TRUE;
389 
390  case WM_COMMAND:
391  switch (LOWORD(wParam))
392  {
393  case IDOK:
395  SaveSettings();
396 
397  /* Fall through */
398 
399  case IDCANCEL:
400  EndDialog(hDlg, IDCANCEL);
401  break;
402  }
403  return FALSE;
404 
405  case WM_CLOSE:
406  EndDialog(hDlg, 0);
407  break;
408 
409  default:
410  return FALSE;
411  }
412 
413  return TRUE;
414 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
void SaveSettings(void)
Definition: settings.c:115
void LoadSettings(void)
Definition: settings.c:53
TCHAR m_Text[MAX_PATH]
Definition: settings.c:25
#define IDC_MESSAGE_TEXT
Definition: resource.h:5
#define GetDlgItemText
Definition: winuser.h:5760
#define WM_CLOSE
Definition: winuser.h:1603
#define MAX_PATH
Definition: compat.h:26
#define SetDlgItemText
Definition: winuser.h:5824
#define WM_COMMAND
Definition: winuser.h:1722
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1721
#define LOWORD(l)
Definition: pedump.c:82

Referenced by LaunchConfig().

◆ ScreenSaverProc()

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

Definition at line 256 of file 3dtext.c.

257 {
258  RECT Screen; // Used Later On To Get The Size Of The Window
259  GLuint PixelFormat; // Pixel Format Storage
260  static PIXELFORMATDESCRIPTOR pfd= // Pixel Format Descriptor
261  {
262  sizeof(PIXELFORMATDESCRIPTOR), // Size Of This Pixel Format Descriptor
263  1, // Version Number (?)
264  PFD_DRAW_TO_WINDOW | // Format Must Support Window
265  PFD_SUPPORT_OPENGL | // Format Must Support OpenGL
266  PFD_DOUBLEBUFFER, // Must Support Double Buffering
267  PFD_TYPE_RGBA, // Request An RGBA Format
268  16, // Select A 16Bit Color Depth
269  0, 0, 0, 0, 0, 0, // Color Bits Ignored (?)
270  0, // No Alpha Buffer
271  0, // Shift Bit Ignored (?)
272  0, // No Accumulation Buffer
273  0, 0, 0, 0, // Accumulation Bits Ignored (?)
274  16, // 16Bit Z-Buffer (Depth Buffer)
275  0, // No Stencil Buffer
276  0, // No Auxiliary Buffer (?)
277  PFD_MAIN_PLANE, // Main Drawing Layer
278  0, // Reserved (?)
279  0, 0, 0 // Layer Masks Ignored (?)
280  };
281 
282  switch (message)
283  {
284  case WM_CREATE:
285  LoadSettings();
286 
287  // Gets A Device Context For The Window
288  hDC = GetDC(hWnd);
289 
290  // Finds The Closest Match To The Pixel Format We Set Above
292 
293  // No Matching Pixel Format?
294  if (!PixelFormat)
295  {
296  MessageBox(0, _TEXT("Can't Find A Suitable PixelFormat."), _TEXT("Error"),MB_OK | MB_ICONERROR);
297 
298  // This Sends A 'Message' Telling The Program To Quit
299  PostQuitMessage(0);
300  break;
301  }
302 
303  // Can We Set The Pixel Mode?
305  {
306  MessageBox(0, _TEXT("Can't Set The PixelFormat."), _TEXT("Error"), MB_OK | MB_ICONERROR);
307 
308  // This Sends A 'Message' Telling The Program To Quit
309  PostQuitMessage(0);
310  break;
311  }
312 
313  // Grab A Rendering Context
315 
316  // Did We Get One?
317  if (!hRC)
318  {
319  MessageBox(0, _TEXT("Can't Create A GL Rendering Context."), _TEXT("Error"), MB_OK | MB_ICONERROR);
320 
321  // This Sends A 'Message' Telling The Program To Quit
322  PostQuitMessage(0);
323  break;
324  }
325 
326  // Can We Make The RC Active?
327  if (!wglMakeCurrent(hDC, hRC))
328  {
329  MessageBox(0, _TEXT("Can't Activate GLRC."), _TEXT("Error"), MB_OK | MB_ICONERROR);
330 
331  // This Sends A 'Message' Telling The Program To Quit
332  PostQuitMessage(0);
333  break;
334  }
335 
336  // Grab Screen Info For The Current Window
338 
339  // Initialize The GL Screen Using Screen Info
340  InitGL(Screen.right, Screen.bottom);
341  break;
342 
343  case WM_DESTROY:
344  // Disable Fullscreen Mode
345  ChangeDisplaySettings(NULL, 0);
346 
347  // Deletes The Font Display List
348  KillFont();
349 
350  // Make The DC Current
352 
353  // Kill The RC
355 
356  // Free The DC
357  ReleaseDC(hWnd, hDC);
358  break;
359 
360  case WM_PAINT:
361  DrawGLScene();
362  SwapBuffers(hDC);
363  break;
364 
365  case WM_SIZE: // Resizing The Screen
366  // Resize To The New Window Size
368  break;
369 
370  default:
371  // Pass Windows Messages to the default screensaver window procedure
373  }
374 
375  return 0;
376 }
static HGLRC hRC
Definition: 3dtext.c:32
GLvoid DrawGLScene(GLvoid)
Definition: 3dtext.c:210
Definition: tftpd.h:59
BOOL WINAPI wglDeleteContext(HGLRC hglrc)
Definition: wgl.c:514
#define PFD_MAIN_PLANE
Definition: wingdi.h:297
HDC WINAPI GetDC(_In_opt_ HWND)
GLvoid ReSizeGLScene(GLsizei Width, GLsizei Height)
Definition: 3dtext.c:184
HWND hWnd
Definition: settings.c:17
GLvoid KillFont(GLvoid)
Definition: 3dtext.c:108
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI SetPixelFormat(_In_ HDC, _In_ int, _In_ const PIXELFORMATDESCRIPTOR *)
#define PFD_DOUBLEBUFFER
Definition: wingdi.h:300
void LoadSettings(void)
Definition: settings.c:53
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
smooth NULL
Definition: ftsmooth.c:416
#define _TEXT(x)
Definition: tchar.h:1543
#define WM_DESTROY
Definition: winuser.h:1591
BOOL WINAPI SwapBuffers(HDC)
Definition: wingl.c:187
#define WM_SIZE
Definition: winuser.h:1593
int WINAPI ChoosePixelFormat(_In_ HDC hdc, _In_ const PIXELFORMATDESCRIPTOR *ppfd)
#define WM_PAINT
Definition: winuser.h:1602
#define PFD_TYPE_RGBA
Definition: wingdi.h:295
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67
INT PixelFormat
#define MB_ICONERROR
Definition: winuser.h:781
#define MessageBox
Definition: winuser.h:5797
BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
Definition: wgl.c:650
static HDC hDC
Definition: 3dtext.c:33
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
unsigned int GLuint
Definition: gl.h:159
GLvoid InitGL(GLsizei Width, GLsizei Height)
Definition: 3dtext.c:141
#define MB_OK
Definition: winuser.h:784
#define WM_CREATE
Definition: winuser.h:1590
struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR
#define HIWORD(l)
Definition: typedefs.h:246
LRESULT WINAPI DefScreenSaverProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: scrnsave.c:95
Definition: console.h:34
#define PFD_SUPPORT_OPENGL
Definition: wingdi.h:305
#define PFD_DRAW_TO_WINDOW
Definition: wingdi.h:302
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
HGLRC WINAPI wglCreateContext(HDC hdc)
Definition: wgl.c:383

Referenced by SysScreenSaverProc().

Variable Documentation

◆ fChildPreview

BOOL fChildPreview

Definition at line 24 of file scrnsave.c.

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

◆ hMainInstance

HINSTANCE hMainInstance

Definition at line 25 of file scrnsave.c.

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

◆ hMainWindow

HWND hMainWindow

Definition at line 23 of file scrnsave.c.

Referenced by LaunchScreenSaver().

◆ MyHelpMessage

UINT MyHelpMessage

Definition at line 32 of file scrnsave.c.

◆ szAppName

◆ szHelpFile

TCHAR szHelpFile[]

Definition at line 30 of file scrnsave.c.

Referenced by Control_LoadApplet(), and ICreateErrorInfoImpl_SetHelpFile().

◆ szIniFile

◆ szName

TCHAR szName[]

Definition at line 104 of file fdi.c.

◆ szNoHelpMemory

TCHAR szNoHelpMemory[]

Definition at line 31 of file scrnsave.c.

◆ szScreenSaver

TCHAR szScreenSaver[]

Definition at line 29 of file scrnsave.c.