Results 1 to 6 of 6

Thread: Haha, you think YOU have what it takes to answer this question!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    Question Haha, you think YOU have what it takes to answer this question!

    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
    Last edited by Joey_k29; Nov 2nd, 2001 at 09:25 AM.

  2. #2
    jim mcnamara
    Guest
    If I get what you want try BlockInput stops users from doing anyhting --

    from www.allapi.net

    Code:
    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: [email protected]
        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

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    Not Quite...

    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

  4. #4
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    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...
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  5. #5
    jim mcnamara
    Guest
    I agree - his design is hard to implement. If he's working from cast-iron user specs, then he's stuck.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2000
    Posts
    352

    This really is not as hard as it sounds...

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width