I have a small stand alone application that is fired when a user adds a document to our database. I want to make it so that the application always sits on top of any other window/program that the user has open on their computer and ideally, the user cannot click outside of the application until they fill in the info on the sheet and click ok, or cancel. So in a nutshell, I want it to lock up the computer until the user deals with the window.
I have tried using SetForegroundWindow( HWND ) and this pops it to the top, but can easily be pushed to the back again with a click outside the program.
Anyone have some code to accomplish this?
Rick
Thanks for the advise. Do you have an example of how you implemented this in the deactivate event? I tried to follow the above suggestion and not keeping focus on the window. It still allows the user to click outside the window and push it behind other windows.
Here is what I put in the Deactivate event:
if ib_ok_to_close = true then
//ok to close
else
//keep open
post setfocus()
yield()
end if
For a general "keep in focus" PB App vs other MS-Windows apps that are running. still use the Deactivate Event but then issue the commands ...
Yield()
SetForegroundWindow()
Regards ... Chris