DefScreenSaverProc

3.1

  #include <scrnsave.h>    

  LRESULT DefScreenSaverProc(hwnd, msg, wParam, lParam)    
  HWND hwnd; /* handle of screen saver window */
  UINT msg; /* message */
  WPARAM wParam; /* first message parameter */
  LPARAM lParam; /* second message parameter */

The DefScreenSaverProc function provides default processing for any messages that a screen saver application does not process. All window messages that are not explicitly processed by the screen saver application's ScreenSaverProc window procedure must be passed to the DefScreenSaverProc function.

Parameters

hwnd

Identifies the screen saver window.

msg

Specifies the message to be processed. The DefScreenSaverProc function responds to messages that affect screen saver operation as follows:

Message Response

WM_ACTIVATE, WM_ACTIVATEAPP, WM_NCACTIVATE Closes the screen saver if wParam is FALSE, unless the password option is enabled in the configuration dialog box. If the password option is enabled, these messages are ignored. A wParam value of FALSE indicates that the screen saver is losing the input focus. The screen saver is closed by sending a WM_CLOSE message.
WM_SETCURSOR Removes the cursor from the screen by setting the cursor to NULL.
WM_LBUTTONDOWN, WM_RBUTTONDOWN, WM_MBUTTONDOWN, WM_KEYDOWN, WM_KEYUP, WM_MOUSEMOVE Posts a WM_CLOSE message to close the screen saver window, unless the password option is enabled. If the password option is enabled, a WM_MOUSEMOVE message displays the dialog box created by the DlgGetPassword function.
WM_DESTROY Calls the PostQuitMessage function to close the screen saver.
WM_SYSCOMMAND Returns FALSE if the wParam parameter of the WM_SYSCOMMAND message is either SC_SCREENSAVE or SC_CLOSE.

If a screen saver application must perform a different action in response to any of these messages, the application's ScreenSaverProc window procedure should process the message and not call DefScreenSaverProc for that message.

wParam

Specifies 16 bits of additional message-dependent information.

lParam

Specifies 32 bits of additional message-dependent information.

Return Value

The return value specifies the result of the message processing and depends on the message sent.

Comments

A screen saver application's ScreenSaverProc window procedure should use DefScreenSaverProc in place of the DefWindowProc function. The DefScreenSaverProc function passes any messages that do not affect screen saver operation to DefWindowProc.

See Also

ScreenSaverProc