Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
EXE forced in front of other EXE at runtime
Message
 
To
10/04/2015 09:16:14
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01618033
Message ID:
01618165
Views:
57
>>>>Hi Gang!
>>>>
>>>>Questioin.....
>>>>
>>>>Given 2 VFP programs running as EXE's on a given PC.
>>>>
>>>>The 1st program, POS.exe is running in it's own window.
>>>>
>>>>The 2nd program, called EZSign.exe runs minimized to the taskbar, but pops up to the forefront when needed by calling the WindowState property when needed.
>>>>
>>>>Thisform.WindowState = 0 && Normal
>>>>_Screen.WindowState = 0 && Normal
>>>>
>>>>
>>>>Thisform.WindowState = 1 && Minimized
>>>>_Screen.WindowState = 1 && Minimized
>>>>
>>>>
>>>>But this does not always get the EZSign program to display in FRONT of the POS program ( by design, we wanted the EZSign to popup up IN FRONT of the POS program, then disappear back to the taskbar when needed.
>>>>
>>>>How would YOU go about making the EZSign program pop up in front of the POS program when needed, then disappear back to the taskbar when not wanted to be visible or in front of the POS program??
>>>>
>>>
>>>Use the BringWindowToTop API function.
>>>
>>>Tamar
>>
>>Is this ok ???
>>
>>DECLARE INTEGER FindWindow IN user32 STRING lpClassName, STRING lpWindowName
>>DECLARE INTEGER BringWindowToTop IN user32 INTEGER hWindow
>>
>>hWnd = FindWindow(Null, Thisform.Caption)
>>BringWindowToTop(hWnd)
>>
>>and place it in the forms ACTIVATE in question, to force it to the FRONT of the other EXE's running ??
>
>You shouldn't need FindWindow, since forms have a hWnd property to give you the handle. Otherwise, yeah, the call to BringWindowToTop should do what you need.
>
>Tamar

Tamar

I used this....

*DECLARE INTEGER FindWindow IN user32 STRING lpClassName, STRING lpWindowName
DECLARE INTEGER BringWindowToTop IN user32 INTEGER hWindow

*hWnd = FindWindow(Null, Thisform.Caption)
BringWindowToTop(Thisform.HWnd)

In a method called from a countdown time ( that just runs once for testing purposes) in a form. When it fires, and goes through this code, the window stays behind any other window and/or form ( I quickly cover the form up with other forms and exes before the time expires ).

Any idea what I am doing incorrectly ??

Thanks a bunch !
Tommy Tillman A+ NetWork+ MCP
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform