ReactOS  0.4.15-dev-4614-ga5a6101
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 }
long y
Definition: polytest.cpp:48
#define WM_LBUTTONDOWN
Definition: winuser.h:1763
long x
Definition: polytest.cpp:48
#define TRUE
Definition: types.h:120
#define pt(x, y)
Definition: drawing.c:79
HWND hWnd
Definition: settings.c:17
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2639
WPARAM wParam
Definition: combotst.c:138
BOOL fChildPreview
Definition: scrnsave.c:24
#define WM_NCACTIVATE
Definition: winuser.h:1675
#define WM_SETCURSOR
Definition: winuser.h:1623
static POINT pt_orig
Definition: scrnsave.c:35
#define WM_KEYDOWN
Definition: winuser.h:1702
#define DefWindowProc
Definition: ros2win.h:31
#define WM_RBUTTONDOWN
Definition: winuser.h:1766
#define PostMessage
Definition: winuser.h:5812
#define WM_CLOSE
Definition: winuser.h:1608
#define WM_KEYUP
Definition: winuser.h:1703
#define WM_ACTIVATEAPP
Definition: winuser.h:1619
#define WM_ACTIVATE
Definition: winuser.h:1599
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define WM_MBUTTONDOWN
Definition: winuser.h:1769
#define WM_MOUSEMOVE
Definition: winuser.h:1762
#define NULL
Definition: types.h:112
#define WM_SYSKEYDOWN
Definition: winuser.h:1706
LPARAM lParam
Definition: combotst.c:139

Referenced by ScreenSaverProc().

◆ RegisterDialogClasses()

BOOL WINAPI RegisterDialogClasses ( HANDLE  hInst)

Definition at line 432 of file 3dtext.c.

433 {
434  return TRUE;
435 }
#define TRUE
Definition: types.h:120

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 }
#define IDOK
Definition: winuser.h:824
#define TRUE
Definition: types.h:120
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
#define FALSE
Definition: types.h:117
TCHAR m_Text[MAX_PATH]
Definition: settings.c:25
#define IDC_MESSAGE_TEXT
Definition: resource.h:5
#define GetDlgItemText
Definition: winuser.h:5765
#define WM_CLOSE
Definition: winuser.h:1608
#define MAX_PATH
Definition: compat.h:34
#define SetDlgItemText
Definition: winuser.h:5829
#define WM_COMMAND
Definition: winuser.h:1727
#define IDCANCEL
Definition: winuser.h:825
#define WM_INITDIALOG
Definition: winuser.h:1726
#define LOWORD(l)
Definition: pedump.c:82

Referenced by LaunchConfig().

◆ ScreenSaverProc()

LRESULT WINAPI ScreenSaverProc ( 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
302  PostQuitMessage(0);
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
312  PostQuitMessage(0);
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
325  PostQuitMessage(0);
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
335  PostQuitMessage(0);
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
366  ReleaseDC(hWnd, hDC);
367  break;
368 
369  case WM_PAINT:
370  DrawGLScene();
371  SwapBuffers(hDC);
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 }
static HGLRC hRC
Definition: 3dtext.c:32
UINT uTimerID
Definition: 3dtext.c:44
GLvoid DrawGLScene(GLvoid)
Definition: 3dtext.c:213
Definition: tftpd.h:59
BOOL WINAPI wglDeleteContext(HGLRC hglrc)
Definition: wgl.c:514
#define PFD_MAIN_PLANE
Definition: wingdi.h:298
HDC WINAPI GetDC(_In_opt_ HWND)
#define TRUE
Definition: types.h:120
GLvoid ReSizeGLScene(GLsizei Width, GLsizei Height)
Definition: 3dtext.c:187
HWND hWnd
Definition: settings.c:17
GLvoid KillFont(GLvoid)
Definition: 3dtext.c:111
WPARAM wParam
Definition: combotst.c:138
BOOL WINAPI SetPixelFormat(_In_ HDC, _In_ int, _In_ const PIXELFORMATDESCRIPTOR *)
#define PFD_DOUBLEBUFFER
Definition: wingdi.h:301
void LoadSettings(void)
Definition: settings.c:53
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define _TEXT(x)
Definition: tchar.h:1535
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_DESTROY
Definition: winuser.h:1596
BOOL WINAPI SwapBuffers(HDC)
Definition: wingl.c:187
#define APP_TIMER_INTERVAL
Definition: 3dtext.c:46
#define WM_SIZE
Definition: winuser.h:1598
#define WM_TIMER
Definition: winuser.h:1729
BOOL WINAPI ValidateRect(_In_opt_ HWND, _In_opt_ LPCRECT)
int WINAPI ChoosePixelFormat(_In_ HDC hdc, _In_ const PIXELFORMATDESCRIPTOR *ppfd)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define WM_PAINT
Definition: winuser.h:1607
#define PFD_TYPE_RGBA
Definition: wingdi.h:296
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
INT PixelFormat
#define MB_ICONERROR
Definition: winuser.h:781
#define MessageBox
Definition: winuser.h:5802
#define APP_TIMER
Definition: 3dtext.c:45
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
#define NULL
Definition: types.h:112
GLvoid InitGL(GLsizei Width, GLsizei Height)
Definition: 3dtext.c:144
#define MB_OK
Definition: winuser.h:784
#define WM_CREATE
Definition: winuser.h:1595
struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR
#define HIWORD(l)
Definition: typedefs.h:247
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:306
#define PFD_DRAW_TO_WINDOW
Definition: wingdi.h:303
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.