!
! ********************************************************************
! *                                                                  *
! *  Copyright 2001 Compaq Computer Corporation                      *
! *                                                                  *
! *  COMPAQ Registered in U.S. Patent and Trademark Office.          *
! *                                                                  *
! *  Confidential computer software. Valid license from Compaq or    *
! *  authorized sublicensor required for possession, use or copying. *
! *  Consistent with FAR 12.211 and 12.212, Commercial Computer      *
! *  Software, Computer Software Documentation, and Technical Data   *
! *  for Commercial Items are licensed to the U.S. Government under  *
! *  vendor's standard commercial license.                           *
! *                                                                  *
! ********************************************************************
!
!DEC$ IF .NOT. DEFINED (SCRNSAVE_ )
!DEC$ DEFINE SCRNSAVE_  
!
!DEC$ IF DEFINED (SCRN_THIS_IS_GOING_TO_BE_COMPILED )
! We don't compile this.  The user should copy the following
! if any of the items below are needed.
module scrnsavt
use dfwinty
!   The following globals are defined in scrnsave.lib
!DEC$ATTRIBUTES EXTERN ::  hMainInstance
!DEC$ATTRIBUTES EXTERN ::  hMainWindow
!DEC$ATTRIBUTES EXTERN ::  szName
!DEC$ATTRIBUTES EXTERN ::  szAppName
!DEC$ATTRIBUTES EXTERN ::  szIniFile
!DEC$ATTRIBUTES EXTERN ::  szScreenSaver
!DEC$ATTRIBUTES EXTERN ::  szHelpFile
!DEC$ATTRIBUTES EXTERN ::  szNoHelpMemory
!DEC$ATTRIBUTES EXTERN ::  MyHelpMessage
   
!DEC$ IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_hMainInstance'  ::  hMainInstance
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_hMainWindow'    ::  hMainWindow
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_szName'         ::  szName 
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_szAppName'      ::  szAppName
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_szIniFile'      ::  szIniFile
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_szScreenSaver'  ::  szScreenSaver
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_szHelpFile'     ::  szHelpFile
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_szNoHelpMemory' ::  szNoHelpMemory
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_MyHelpMessage'  ::  MyHelpMessage
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'hMainInstance'  ::  hMainInstance
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'hMainWindow'    ::  hMainWindow
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'szName'         ::  szName 
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'szAppName'      ::  szAppName
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'szIniFile'      ::  szIniFile
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'szScreenSaver'  ::  szScreenSaver
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'szHelpFile'     ::  szHelpFile
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'szNoHelpMemory' ::  szNoHelpMemory
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'MyHelpMessage'  ::  MyHelpMessage
!DEC$ ENDIF

    integer                     hMainInstance
    integer                     hMainWindow
    character(TITLEBARNAMELEN)  szName
    character(APPNAMEBUFFERLEN) szAppName
    character(MAXFILELEN)       szIniFile
    character(22)               szScreenSaver
    character(MAXFILELEN)       szHelpFile
    character(BUFFLEN)          szNoHelpMemory
    integer                     MyHelpMessage

end module scrnsavt
!DEC$ ENDIF

module scrnsave
use dfwinty
!DEC$OBJCOMMENT LIB:"SCRNSAVE.LIB"
!
!                               ****SCRNSAVE****
!
!  This function is the Window Procedure for the screen saver.  It is
!  * up to the programmer to handle any of the messages that wish to be
!  * interpretted.  Any unused messages are then passed back to
!  * DefScreenSaverProc if desired which will take default action on any
!  * unprocessed message...
!
!! User supplied.
!interface
!integer function  ScreenSaverProc  (hWnd ,message ,wParam ,lParam ) 
!DEC$ IF DEFINED(_X86_)
!!DEC$ ATTRIBUTES STDCALL, ALIAS : '_ScreenSaverProc@16' :: ScreenSaverProc  
!DEC$ ELSE
!!DEC$ ATTRIBUTES STDCALL, ALIAS :  'ScreenSaverProc'    :: ScreenSaverProc  
!DEC$ ENDIF
!integer hWnd
!integer message
!integer wParam
!integer lParam
!end function ScreenSaverProc
!end interface
!  This function performs default message processing.  Currently handles
!  * the following messages:
!  *
!  * WM_SYSCOMMAND:   return FALSE if wParam is SC_SCREENSAVE or SC_CLOSE
!  *
!  * WM_DESTROY:      PostQuitMessage(0)
!  *
!  * WM_SETCURSOR:    By default, this will set the cursor to a null cursor,
!  *                  thereby removing it from the screen.
!  *
!  * WM_LBUTTONDOWN:
!  * WM_MBUTTONDOWN:
!  * WM_RBUTTONDOWN:
!  * WM_KEYDOWN:
!  * WM_KEYUP:
!  * WM_MOUSEMOVE:    By default, these will cause the program to terminate.
!  *                  Unless the password option is enabled.  In that case
!  *                  the DlgGetPassword() dialog box is brought up.
!  *
!  * WM_NCACTIVATE:
!  * WM_ACTIVATEAPP:
!  * WM_ACTIVATE:     By default, if the wParam parameter is FALSE (signifying
!  *                  that transfer is being taken away from the application),
!  *                  then the program will terminate.  Termination is
!  *                  accomplished by generating a WM_CLOSE message.  This way,
!  *                  if the user sets something up in the WM_CREATE, a
!  *                  WM_DESTROY will be generated and it can be destroyed
!  *                  properly.
!  *                  This message is ignored, however is the password option
!  *                  is enabled.
!  
interface !lib=scrnsave.lib
integer function  DefScreenSaverProc  (hWnd ,msg ,wParam ,lParam ) 
!DEC$ ATTRIBUTES DEFAULT :: DefScreenSaverProc
!DEC$ IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_DefScreenSaverProc@16' :: DefScreenSaverProc  
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS :  'DefScreenSaverProc'    :: DefScreenSaverProc  
!DEC$ ENDIF
integer hWnd
integer msg
integer wParam
integer lParam
end function DefScreenSaverProc
end interface
!  A function is also needed for configuring the screen saver.  The function
!  * should be exactly like it is below and must be exported such that the
!  * program can use MAKEPROCINSTANCE on it and call up a dialog box. Further-
!  * more, the template used for the dialog must be called
!  * ScreenSaverConfigure to allow the main function to access it...
!
! User supplied
!interface
!logical(4) function  ScreenSaverConfigureDialog  (hDlg ,message ,wParam ,lParam ) 
!DEC$ IF DEFINED(_X86_)
!!DEC$ ATTRIBUTES STDCALL, ALIAS : '_ScreenSaverConfigureDialog@16' :: ScreenSaverConfigureDialog  
!DEC$ ELSE
!!DEC$ ATTRIBUTES STDCALL, ALIAS :  'ScreenSaverConfigureDialog'    :: ScreenSaverConfigureDialog  
!DEC$ ENDIF
!integer hDlg
!integer message
!integer wParam
!integer lParam
!end function ScreenSaverConfigureDialog
!end interface
!  To allow the programmer the ability to register child control windows, this
!  * function is called prior to the creation of the dialog box.  Any
!  * registering that is required should be done here, or return TRUE if none
!  * is needed...
! User supplied
!interface
!logical(4) function  RegisterDialogClasses  (hInst ) 
!DEC$ IF DEFINED(_X86_)
!!DEC$ ATTRIBUTES STDCALL, ALIAS : '_RegisterDialogClasses@4' :: RegisterDialogClasses  
!DEC$ ELSE
!!DEC$ ATTRIBUTES STDCALL, ALIAS :  'RegisterDialogClasses'   :: RegisterDialogClasses  
!DEC$ ENDIF
!integer hInst
!end function RegisterDialogClasses
!end interface
!  The following functions are called by DefScreenSaverProc and must
!  * be exported by all screensavers using this model.
!  * There are only three other points that should be of notice:
!  * 1) The screen saver must have a string declared as 'szAppName' contaning the
!  *     name of the screen saver, and it must be declared as a global.
!  * 2) The screen saver EXE file should be renamed to a file with a SCR
!  *     extension so that the screen saver dialog from the control panel can
!  *     find it when is searches for screen savers.
!
end module scrnsave
!
!DEC$ ENDIF ! /* SCRNSAVE_ */
