Article ID: 136755
Article Last Modified on 11/17/2003
*******************************************************************
** Starter.prg Extreme minimum sample Code to start the application
*******************************************************************
*
DO FORM appform.scx
READ EVENTS
PROCEDURE back2vfp
** The application's form was activated from the desktop level as a
** desktop level form. The event handler is at the desktop level, and
** is equivalent to a property of the _SCREEN object, so it must be
** terminated by a method of the _SCREEN object. As no _SCREEN
** object members are visible (no command buttons, text boxes, etc.),
** a Timer event is used to clear events. The timer object is not
** visible, and doesn't need to be in order to be activated.
** To activate the Timer: Add it to the _SCREEN
*
_SCREEN.AddObject('oTime','MyTimer') && MyTimer is the
** current instance
** End of procedure Back2vfp
**
** Class definition. The TIMER event is triggered after two seconds
DEFINE CLASS MyTimer AS Timer
Interval= 2000
PROCEDURE Timer
CLEAR EVENTS
_SCREEN.RemoveObject('oTime')
ENDPROC
ENDDEFINE
**
** End of extreme minimum sample Starter.prg*******************
***************************************************************
141315 Changing Subclassed Form's Desktop Property Has No Effect
** The following is the code to hide the Visual FoxPro desktop.
**************************************************************
* This function may be called in the Load Event of the
* application's form that has these properties:
*
* WindowType = Modal,
* AlwaysOnTop = True, and
* DeskTop = True
**************************************************************
#DEFINE W32sDLL "W32SCOMB.DLL"
#DEFINE W32DLL "USER32.DLL"
IF "3.5" $ OS(1) OR "Windows 4" $ OS(1) OR "NT" $ OS(1) &&
cDLL = W32DLL
ELSE
cDLL = W32sDLL
ENDIF
DECLARE integer FindWindow IN &cDLL integer, string
DECLARE Integer ShowWindow IN &cDLL Integer, Integer
SW_MAXIMIZE = 3
SW_SHOWNORMAL = 1
SW_SHOWMINIMIZED = 2
SW_SHOWGONE = 0
ThisForm.showstate = SW_SHOWNORMAL
NullPointer = 0
ThisForm.FoxHWND = FindWindow(NullPointer, _SCREEN.Caption)
* Hide the Main Visual FoxPro Window
ThisForm.FoxGone = ShowWindow(ThisForm.FoxHWND, SW_SHOWGONE)
** The next command is optional - it shows the successful
** execution of this function's code.
** =MessageBox("Visual FoxPro Desktop is hidden...")
**************************************************************
** End of function.
**************************************************************
* Clear the form
ThisForm.Release
*
* Restore the Visual FoxPro desktop
ThisForm.FoxGone = ShowWindow(ThisForm.FoxHWND, ThisForm.showstate)
*
* Terminate the READ EVENTS with a CLEAR EVENTS two seconds after
* restoring the Visual FoxPro desktop
DO Back2vfp && Procedure found in the calling program Starter.prg
Additional query words: SDI Command window timer _SCREEN
Keywords: kbhowto kbcode KB136755