Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Determining the currently active window
Message
From
13/10/2001 13:35:26
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00567748
Message ID:
00568170
Views:
17
Michelle,
Not sure if this will help, but I found situations where the native WONTOP() function didn't work. E.g. it returns an empty string when you're in the command window, the view window or the document view. In situations like this I use the _WOnTop() function from FoxTools. You could try something like this:
IF NOT "FOXTOOLS" $ SET("LIBRARY")
	IF FILE("FOXTOOLS.FLL")
		SET LIBRARY TO FOXTOOLS ADDITIVE
	ELSE
		MESSAGEBOX("Cannot find FoxTools.fll. Procedure canceled.", 16, PROGRAM(), 1000)
		RETURN
	ENDIF
ENDIF

lnWhandle = _WOnTop()

IF lnWhandle = 0
	MESSAGEBOX("_WFindTitl returned 0. Procedure canceled.", 16, PROGRAM())
	RETURN
ELSE
	MESSAGEBOX("Currently Selected Window = '" + _WTitle(lnWhandle)+ "'")
ENDIF

ACTIVATE WINDOW SCREEN
?"Hi"

_WSelect(lnWhandle)

RETURN


>I've be going through the help and all the window commands like WONTOP() and can't find anything that will return the name of the currently active window. I need to make sure that _screen or the toolbar are active before executing some code. Am I missing it? All these commands refer to the currently active window, but none of them will tell me what it is!
>
>Anyone know?
>
>Thanks,
>
>Michelle
Daniel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform