Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

187 lines
8.1 KiB

  1. /*****************************************************************************\
  2. * *
  3. * scrnsave.h Windows NT 3.1 screensaver defines and definitions. *
  4. * *
  5. * Version 1.0 *
  6. * *
  7. * NOTE: windows.h must be #included first *
  8. * *
  9. * Windows NT NOTE: (Differences from Win 3.1 Screensavers) *
  10. * *
  11. * All Screensavers are required to have a Description string *
  12. * of no more than 25 chars for display by the Control Panel's *
  13. * Desktop applet. This is string 1 in the resource string *
  14. * table of the Windows 32-bit screen saver .SCR (.EXE) file. *
  15. * *
  16. * Passwords for Windows NT Screen Savers are handled by the *
  17. * Winlogon process. If the registry value: *
  18. * *
  19. * HKEY_CURRENT_USER\Control Panel\Desktop\ScreenSaverIsSecure *
  20. * *
  21. * is nonzero, Winlogon will ask for the User's login password *
  22. * before allowing the Screen Saver to exit. All password data *
  23. * and dialogs have been removed from individual Screensavers. *
  24. * *
  25. * *
  26. * Copyright (c) 1992-1995, Microsoft Corp. All rights reserved. *
  27. * *
  28. \*****************************************************************************/
  29. #ifndef _INC_SCRNSAVE
  30. #define _INC_SCRNSAVE
  31. #include <pshpack1.h> /* Assume byte packing throughout */
  32. #ifdef __cplusplus
  33. extern "C" { /* Assume C declarations for C++ */
  34. #endif /* __cplusplus */
  35. /* MANDATORY string required in .RC file
  36. * This string should contain a less than 25 char name/description of the
  37. * screen saver. This string is what will be seen by the user in the Control
  38. * Panel's Desktop applet screen saver listbox.
  39. */
  40. #define IDS_DESCRIPTION 1
  41. /* Icon resource ID.
  42. *
  43. * This should be the first icon used and must have this resource number.
  44. * This is needed as the first icon in the file will be grabbed
  45. */
  46. #define ID_APP 100
  47. #define DLG_SCRNSAVECONFIGURE 2003
  48. #define idsIsPassword 1000
  49. #define idsIniFile 1001
  50. #define idsScreenSaver 1002
  51. #define idsPassword 1003
  52. #define idsDifferentPW 1004
  53. #define idsChangePW 1005
  54. #define idsBadOldPW 1006
  55. #define idsAppName 1007
  56. #define idsNoHelpMemory 1008
  57. #define idsHelpFile 1009
  58. #define idsDefKeyword 1010
  59. /* This function is the Window Procedure for the screen saver. It is
  60. * up to the programmer to handle any of the messages that wish to be
  61. * interpretted. Any unused messages are then passed back to
  62. * DefScreenSaverProc if desired which will take default action on any
  63. * unprocessed message...
  64. */
  65. LRESULT WINAPI ScreenSaverProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  66. /* This function performs default message processing. Currently handles
  67. * the following messages:
  68. *
  69. * WM_SYSCOMMAND: return FALSE if wParam is SC_SCREENSAVE or SC_CLOSE
  70. *
  71. * WM_DESTROY: PostQuitMessage(0)
  72. *
  73. * WM_SETCURSOR: By default, this will set the cursor to a null cursor,
  74. * thereby removing it from the screen.
  75. *
  76. * WM_LBUTTONDOWN:
  77. * WM_MBUTTONDOWN:
  78. * WM_RBUTTONDOWN:
  79. * WM_KEYDOWN:
  80. * WM_KEYUP:
  81. * WM_MOUSEMOVE: By default, these will cause the program to terminate.
  82. * Unless the password option is enabled. In that case
  83. * the DlgGetPassword() dialog box is brought up.
  84. *
  85. * WM_NCACTIVATE:
  86. * WM_ACTIVATEAPP:
  87. * WM_ACTIVATE: By default, if the wParam parameter is FALSE (signifying
  88. * that transfer is being taken away from the application),
  89. * then the program will terminate. Termination is
  90. * accomplished by generating a WM_CLOSE message. This way,
  91. * if the user sets something up in the WM_CREATE, a
  92. * WM_DESTROY will be generated and it can be destroyed
  93. * properly.
  94. * This message is ignored, however is the password option
  95. * is enabled.
  96. */
  97. LRESULT WINAPI DefScreenSaverProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
  98. /* A function is also needed for configuring the screen saver. The function
  99. * should be exactly like it is below and must be exported such that the
  100. * program can use MAKEPROCINSTANCE on it and call up a dialog box. Further-
  101. * more, the template used for the dialog must be called
  102. * ScreenSaverConfigure to allow the main function to access it...
  103. */
  104. BOOL WINAPI ScreenSaverConfigureDialog (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  105. /* To allow the programmer the ability to register child control windows, this
  106. * function is called prior to the creation of the dialog box. Any
  107. * registering that is required should be done here, or return TRUE if none
  108. * is needed...
  109. */
  110. BOOL WINAPI RegisterDialogClasses (HANDLE hInst);
  111. /* The following functions are called by DefScreenSaverProc and must
  112. * be exported by all screensavers using this model.
  113. */
  114. /*
  115. * There are only three other points that should be of notice:
  116. * 1) The screen saver must have a string declared as 'szAppName' contaning the
  117. * name of the screen saver, and it must be declared as a global.
  118. * 2) The screen saver EXE file should be renamed to a file with a SCR
  119. * extension so that the screen saver dialog from the control panel can
  120. * find it when is searches for screen savers.
  121. */
  122. #define WS_GT (WS_GROUP | WS_TABSTOP)
  123. #define MAXFILELEN 13
  124. #define TITLEBARNAMELEN 40
  125. #define APPNAMEBUFFERLEN 40
  126. #define BUFFLEN 255
  127. /* The following globals are defined in scrnsave.lib */
  128. extern HANDLE hMainInstance;
  129. extern HWND hMainWindow;
  130. extern BOOL fChildPreview;
  131. extern TCHAR szName[TITLEBARNAMELEN];
  132. extern TCHAR szAppName[APPNAMEBUFFERLEN];
  133. extern TCHAR szIniFile[MAXFILELEN];
  134. extern TCHAR szScreenSaver[22];
  135. extern TCHAR szHelpFile[MAXFILELEN];
  136. extern TCHAR szNoHelpMemory[BUFFLEN];
  137. extern UINT MyHelpMessage;
  138. /* OPTIONAL - Win95 Only */
  139. #define SCRM_VERIFYPW WM_APP
  140. /*
  141. * This message is sent to the main screen saver window when password
  142. * protection is enabled and the user is trying to close the screen saver. You
  143. * can process this message and provide your own validation technology. If you
  144. * process this message, you should also support the ScreenSaverChangePassword
  145. * function, described below. Return zero from this message if the password
  146. * check failed. Return nonzero for success. If you run out of memory or
  147. * encounter a similar class of error, return non-zero so the user isn't left
  148. * out in the cold. The default action is to call the Windows Master
  149. * Password Router to validate the user's password.
  150. */
  151. void WINAPI ScreenSaverChangePassword( HWND hParent );
  152. /*
  153. * You supply this if you provide your own authentication. Windows will call
  154. * it when the user wants to change the password. An implementation of this
  155. * function should present password change UI to the user.
  156. * You should only supply this function if you also hook the SCRM_VERIFYPW
  157. * message to validate passwords.
  158. * The default action is to call the Windows Master Password Router.
  159. */
  160. #ifdef __cplusplus
  161. }
  162. #endif /* __cplusplus */
  163. #include <poppack.h>
  164. #endif /* !_INC_SCRNSAVE */