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.

163 lines
6.9 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, Microsoft Corp. All rights reserved. *
  27. * *
  28. \*****************************************************************************/
  29. #ifndef _INC_SCRNSAVE
  30. #define _INC_SCRNSAVE
  31. #ifndef RC_INVOKED
  32. #pragma pack(1) /* Assume byte packing throughout */
  33. #endif /* !RC_INVOKED */
  34. #ifdef __cplusplus
  35. extern "C" { /* Assume C declarations for C++ */
  36. #endif /* __cplusplus */
  37. /* MANDATORY string required in .RC file
  38. * This string should contain a less than 25 char name/description of the
  39. * screen saver. This string is what will be seen by the user in the Control
  40. * Panel's Desktop applet screen saver listbox.
  41. */
  42. #define IDS_DESCRIPTION 1
  43. /* Icon resource ID.
  44. *
  45. * This should be the first icon used and must have this resource number.
  46. * This is needed as the first icon in the file will be grabbed
  47. */
  48. #define ID_APP 100
  49. #define DLG_SCRNSAVECONFIGURE 2003
  50. #define idsIsPassword 1000
  51. #define idsIniFile 1001
  52. #define idsScreenSaver 1002
  53. #define idsPassword 1003
  54. #define idsDifferentPW 1004
  55. #define idsChangePW 1005
  56. #define idsBadOldPW 1006
  57. #define idsAppName 1007
  58. #define idsNoHelpMemory 1008
  59. #define idsHelpFile 1009
  60. /* This function is the Window Procedure for the screen saver. It is
  61. * up to the programmer to handle any of the messages that wish to be
  62. * interpretted. Any unused messages are then passed back to
  63. * DefScreenSaverProc if desired which will take default action on any
  64. * unprocessed message...
  65. */
  66. LRESULT WINAPI ScreenSaverProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
  67. /* This function performs default message processing. Currently handles
  68. * the following messages:
  69. *
  70. * WM_SYSCOMMAND: return FALSE if wParam is SC_SCREENSAVE or SC_CLOSE
  71. *
  72. * WM_DESTROY: PostQuitMessage(0)
  73. *
  74. * WM_SETCURSOR: By default, this will set the cursor to a null cursor,
  75. * thereby removing it from the screen.
  76. *
  77. * WM_LBUTTONDOWN:
  78. * WM_MBUTTONDOWN:
  79. * WM_RBUTTONDOWN:
  80. * WM_KEYDOWN:
  81. * WM_KEYUP:
  82. * WM_MOUSEMOVE: By default, these will cause the program to terminate.
  83. * Unless the password option is enabled. In that case
  84. * the DlgGetPassword() dialog box is brought up.
  85. *
  86. * WM_NCACTIVATE:
  87. * WM_ACTIVATEAPP:
  88. * WM_ACTIVATE: By default, if the wParam parameter is FALSE (signifying
  89. * that transfer is being taken away from the application),
  90. * then the program will terminate. Termination is
  91. * accomplished by generating a WM_CLOSE message. This way,
  92. * if the user sets something up in the WM_CREATE, a
  93. * WM_DESTROY will be generated and it can be destroyed
  94. * properly.
  95. * This message is ignored, however is the password option
  96. * is enabled.
  97. */
  98. LRESULT WINAPI DefScreenSaverProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
  99. /* A function is also needed for configuring the screen saver. The function
  100. * should be exactly like it is below and must be exported such that the
  101. * program can use MAKEPROCINSTANCE on it and call up a dialog box. Further-
  102. * more, the template used for the dialog must be called
  103. * ScreenSaverConfigure to allow the main function to access it...
  104. */
  105. BOOL WINAPI ScreenSaverConfigureDialog (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
  106. /* To allow the programmer the ability to register child control windows, this
  107. * function is called prior to the creation of the dialog box. Any
  108. * registering that is required should be done here, or return TRUE if none
  109. * is needed...
  110. */
  111. BOOL WINAPI RegisterDialogClasses (HANDLE hInst);
  112. /* The following functions are called by DefScreenSaverProc and must
  113. * be exported by all screensavers using this model.
  114. */
  115. /*
  116. * There are only three other points that should be of notice:
  117. * 1) The screen saver must have a string declared as 'szAppName' contaning the
  118. * name of the screen saver, and it must be declared as a global.
  119. * 2) The screen saver EXE file should be renamed to a file with a SCR
  120. * extension so that the screen saver dialog from the control panel can
  121. * find it when is searches for screen savers.
  122. */
  123. #define WS_GT (WS_GROUP | WS_TABSTOP)
  124. #define MAXFILELEN 13
  125. #define TITLEBARNAMELEN 40
  126. #define APPNAMEBUFFERLEN 40
  127. #define BUFFLEN 255
  128. /* The following globals are defined in scrnsave.lib */
  129. extern HANDLE hMainInstance;
  130. extern HWND hMainWindow;
  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. #ifdef __cplusplus
  139. }
  140. #endif /* __cplusplus */
  141. #ifndef RC_INVOKED
  142. #pragma pack()
  143. #endif /* !RC_INVOKED */
  144. #endif /* !_INC_SCRNSAVE */
  145.