Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to control the program to execute once again??
Message
From
06/02/2002 11:10:34
Max Chen
Yx Software
Shunde, China
 
 
To
05/02/2002 21:26:42
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00615843
Message ID:
00616083
Views:
24
uTag=_screen.caption
_screen.caption=''
IF gnFindWindow(guTag)>0
glSetForegroundWindow(guTag)
QUIT
ELSE
_screen.caption=guTag
ENDIF

*********************************
FUNCTION gnFindWindow
*--return a window's handle
PARAMETER tcWinCaption
DECLARE integer FindWindow in WIN32API as _dll_findwindow string cNull, string cWinName
RETURN _dll_Findwindow(0,tcWinCaption)
********************************************************************
FUNCTION glShowWindow
PARAMETER tuHandlOrCaption,tnShowCmd

* SW_HIDE = 0, SW_SHOWNORMAL = 1, SW_NORMAL = 1
* SW_SHOWMINIMIZED = 2, SW_SHOWMAXIMIZED = 3
* SW_MAXIMIZE = 3, SW_SHOWNOACTIVATE = 4, SW_SHOW = 5
* SW_MINIMIZE = 6, SW_SHOWMINNOACTIVE = 7, SW_SHOWNA = 8
* SW_RESTORE = 9, SW_SHOWDEFAULT = 10, SW_MAX = 10

LOCAL lnWhnd,llRet
If Type('tuHandlOrCaption') = "C"
lnWhnd = gnFindWindow(tuHandlOrCaption)
Else
If Type('tuHandlOrCaption') <> 'N'
Return .F.
EndIf
lnWhnd=tuHandlOrCaption
EndIf

DECLARE integer ShowWindow in WIN32API as _dll_ShowWindow integer hWinHandle, integer nShowCmd

llRet= ( _dll_ShowWindow(lnWhnd,tnShowCmd)#0 )
RETURN llRet
********************************************************************
FUNCTION glSetForegroundWindow
PARAMETER tuHandlOrCaption
LOCAL lnWhnd,llRet
If Type('tuHandlOrCaption') = "C"
lnWhnd = gnFindWindow(tuHandlOrCaption)
Else
If Type('tuHandlOrCaption') <> 'N'
Return .F.
EndIf
lnWhnd=tuHandlOrCaption
EndIf

DECLARE integer SetForegroundWindow in WIN32API as _dll_SetForegroundWindow integer hWinHandle

llRet= ( _dll_SetForegroundWindow(lnWhnd)#0 )
RETURN llRet
********************************************************************

--
Previous
Reply
Map
View

Click here to load this message in the networking platform