Leaked source code of windows server 2003
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.

168 lines
6.6 KiB

  1. /*****************************************************************************\
  2. * *
  3. * scrnsave.h Windows 3.1 screensaver defines and definitions.
  4. * *
  5. * Version 1.0 *
  6. * *
  7. * NOTE: windows.h must be #included first *
  8. * *
  9. * Copyright (c) 1992, Microsoft Corp. All rights reserved. *
  10. * *
  11. \*****************************************************************************/
  12. #ifndef _INC_SCRNSAVE
  13. #define _INC_SCRNSAVE
  14. #ifndef RC_INVOKED
  15. #pragma pack(1) /* Assume byte packing throughout */
  16. #endif /* !RC_INVOKED */
  17. #ifdef __cplusplus
  18. extern "C" { /* Assume C declarations for C++ */
  19. #endif /* __cplusplus */
  20. #ifndef _INC_WINDOWS /* If not included with 3.1 headers... */
  21. #define LPCSTR LPSTR
  22. #define WINAPI FAR PASCAL
  23. #define CALLBACK FAR PASCAL
  24. #define UINT WORD
  25. #define LPARAM LONG
  26. #define WPARAM WORD
  27. #define LRESULT LONG
  28. #define HMODULE HANDLE
  29. #define HINSTANCE HANDLE
  30. #define HLOCAL HANDLE
  31. #define HGLOBAL HANDLE
  32. #endif /* _INC_WINDOWS */
  33. /* Icon resource ID.
  34. *
  35. * This should be the first icon used and must have this resource number.
  36. * This is needed as the first icon in the file will be grabbed
  37. */
  38. #define ID_APP 100
  39. #define DLG_CHANGEPASSWORD 2000
  40. #define DLG_ENTERPASSWORD 2001
  41. #define DLG_INVALIDPASSWORD 2002
  42. #define DLG_SCRNSAVECONFIGURE 2003
  43. #define idsIsPassword 1000
  44. #define idsIniFile 1001
  45. #define idsScreenSaver 1002
  46. #define idsPassword 1003
  47. #define idsDifferentPW 1004
  48. #define idsChangePW 1005
  49. #define idsBadOldPW 1006
  50. #define idsAppName 1007
  51. #define idsNoHelpMemory 1008
  52. #define idsHelpFile 1009
  53. /* This function is the Window Procedure for the screen saver. It is
  54. * up to the programmer to handle any of the messages that wish to be
  55. * interpretted. Any unused messages are then passed back to
  56. * DefScreenSaverProc if desired which will take default action on any
  57. * unprocessed message...
  58. */
  59. LRESULT WINAPI ScreenSaverProc(HWND, unsigned, UINT, LPARAM);
  60. /* This function performs default message processing. Currently handles
  61. * the following messages:
  62. *
  63. * WM_SYSCOMMAND: return FALSE if wParam is SC_SCREENSAVE or SC_CLOSE
  64. *
  65. * WM_DESTROY: PostQuitMessage(0)
  66. *
  67. * WM_SETCURSOR: By default, this will set the cursor to a null cursor,
  68. * thereby removing it from the screen.
  69. *
  70. * WM_LBUTTONDOWN:
  71. * WM_MBUTTONDOWN:
  72. * WM_RBUTTONDOWN:
  73. * WM_KEYDOWN:
  74. * WM_KEYUP:
  75. * WM_MOUSEMOVE: By default, these will cause the program to terminate.
  76. * Unless the password option is enabled. In that case
  77. * the DlgGetPassword() dialog box is brought up.
  78. *
  79. * WM_NCACTIVATE:
  80. * WM_ACTIVATEAPP:
  81. * WM_ACTIVATE: By default, if the wParam parameter is FALSE (signifying
  82. * that transfer is being taken away from the application),
  83. * then the program will terminate. Termination is
  84. * accomplished by generating a WM_CLOSE message. This way,
  85. * if the user sets something up in the WM_CREATE, a
  86. * WM_DESTROY will be generated and it can be destroyed
  87. * properly.
  88. * This message is ignored, however is the password option
  89. * is enabled.
  90. */
  91. LRESULT WINAPI DefScreenSaverProc(HWND, UINT, WPARAM, LPARAM);
  92. /* A function is also needed for configuring the screen saver. The function
  93. * should be exactly like it is below and must be exported such that the
  94. * program can use MAKEPROCINSTANCE on it and call up a dialog box. Further-
  95. * more, the template used for the dialog must be called
  96. * ScreenSaverConfigure to allow the main function to access it...
  97. */
  98. BOOL WINAPI ScreenSaverConfigureDialog(HWND, UINT, WPARAM, LPARAM);
  99. /* This function is called from the ScreenSaveConfigureDialog() to change
  100. * the Screen Saver's password. Note: passwords are GLOBAL to all
  101. * screen savers using this model. Whether or not the password is enabled
  102. * is LOCAL to a particular screen saver.
  103. */
  104. BOOL WINAPI DlgChangePassword(HWND, UINT, WPARAM, 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 _cdecl RegisterDialogClasses(HINSTANCE);
  111. /* The following three functions are called by DefScreenSaverProc and must
  112. * be exported by all screensavers using this model.
  113. */
  114. BOOL WINAPI DlgGetPassword(HWND, UINT, WPARAM, LPARAM);
  115. BOOL WINAPI DlgInvalidPassword(HWND, UINT, WPARAM, LPARAM);
  116. DWORD WINAPI HelpMessageFilterHookFunction(int, WORD, LPMSG);
  117. /*
  118. * There are only three other points that should be of notice:
  119. * 1) The screen saver must have a string declared as 'szAppName' contaning the
  120. * name of the screen saver, and it must be declared as a global.
  121. * 2) The screen saver EXE file should be renamed to a file with a SCR
  122. * extension so that the screen saver dialog form the control panel can
  123. * find it when is searches for screen savers.
  124. */
  125. #define WS_GT (WS_GROUP | WS_TABSTOP)
  126. #define MAXFILELEN 13
  127. #define TITLEBARNAMELEN 40
  128. #define BUFFLEN 255
  129. /* The following globals are defined in scrnsave.lib */
  130. extern HINSTANCE _cdecl hMainInstance;
  131. extern HWND _cdecl hMainWindow;
  132. extern char _cdecl szName[TITLEBARNAMELEN];
  133. extern char _cdecl szIsPassword[22];
  134. extern char _cdecl szIniFile[MAXFILELEN];
  135. extern char _cdecl szScreenSaver[22];
  136. extern char _cdecl szPassword[16];
  137. extern char _cdecl szDifferentPW[BUFFLEN];
  138. extern char _cdecl szChangePW[30];
  139. extern char _cdecl szBadOldPW[BUFFLEN];
  140. extern char _cdecl szHelpFile[MAXFILELEN];
  141. extern char _cdecl szNoHelpMemory[BUFFLEN];
  142. extern UINT _cdecl MyHelpMessage;
  143. extern HOOKPROC _cdecl fpMessageFilter;
  144. #ifdef __cplusplus
  145. }
  146. #endif /* __cplusplus */
  147. #ifndef RC_INVOKED
  148. #pragma pack()
  149. #endif /* !RC_INVOKED */
  150. #endif /* !_INC_SCRNSAVE */