General information
Category:
Windows API functions
Title:
Getting a VFP Window to be on top of all other windows
I am writing an application in VFP 6.0 to run on WinNT workstations. My app runs "behind the scenes" in that it reads a text file created by another app, does a bunch of verifications and returns a pop-up window (the only part of my app that's visible) to the end user letting them know if the text file is valid or not. I have the following code in my app to call a form window, but it doesn't return focus to my form. I would like the user to be able to hit the Enter key when they see the form to close my form and return focus to the other application. As it stands right now, the user has to click on the "OK" button to close my form.
Code in frmMessage.init:
***********************************
lparameters cText, cTitle
local lnHandle
DECLARE INTEGER ShowWindow IN WIN32API INTEGER hWnd, INTEGER ShowWindowMode
DECLARE INTEGER GetActiveWindow IN WIN32API
lnHandle = FindWindow(0, 'frmMessageForm')
=ShowWindow(GetActiveWindow(),5)
this.caption = cTitle
thisform.txtMessageText.caption = cText
thisform.cmdOK.setfocus
***********************************
Any ideas on how I can get my form to be the active window on my screen?
Thanks,
Joe
Next
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