General information
Category:
Coding, syntax & commands
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only