Click to See Complete Forum and Search --> : Haha, you think YOU have what it takes to answer this question!
Joey_k29
Nov 1st, 2001, 08:08 AM
I have designed a macro program, but I do not want anyone doing anything while it is running. To prevent people from making a mistake, I want to display a form that is always the top most window that says to not interfere. But to do this, I have to make it the top most window without allowing the other windows to become inactive. The focus has to be on the other apps in order to send the keystrokes. Can anyone help me? Thank you very much. NOTE: I would prefer this work in both NT and 9x, but it is neccesary that it work in NT.
Joe
jim mcnamara
Nov 1st, 2001, 08:39 AM
If I get what you want try BlockInput stops users from doing anyhting --
from www.allapi.net
Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Form_Activate()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
DoEvents
'block the mouse and keyboard input
BlockInput True
'wait 10 seconds before unblocking it
Sleep 10000
'unblock the mouse and keyboard input
BlockInput False
End Sub
Joey_k29
Nov 1st, 2001, 08:49 AM
I am not looking to block input really. All I am interested in is keeping a form I design as the foreground window to remind the user that the macro is running. The trick is, I can not allow that window to have the focus, or sending the keystrokes will not work. Thank you for the suggestion, and hopefully you know how to do what I am asking now that I have clarified. Thank you again for the help.
Joe
Arc
Nov 1st, 2001, 12:08 PM
Just umm... HAve a hidden label on the form become visible saying Working Please Wait.....
And disable all buttons ect...
Then when the macro is finished enable the buttons and hide the label...
jim mcnamara
Nov 1st, 2001, 12:12 PM
I agree - his design is hard to implement. If he's working from cast-iron user specs, then he's stuck.
Joey_k29
Nov 1st, 2001, 01:03 PM
The hidden label thing does not work. As soon as I shell an application, mine isn't going to be the foremost. You can't read a caption behind something else. The whole idea is just to make the user aware that a macro is running without affecting the functionality of the macro. I have seen the API call; it is very simple. I just do not remember it. All it is a command similar in function to show window except the parameters make a window the front most window, but does not give it focus and make it active. Any help would be much appreciated.
Joe
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.