Results 1 to 6 of 6

Thread: Form Blinks when Showing Up

  1. #1

    Thread Starter
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192

    Resolved Form Blinks when Showing Up

    I know this has been discussed already in the following threads:
    Pop Up Program
    Bring window to front..

    I have tried their solutions (the first one just addressed to the second one) and none worked for me.

    I have a program that is something like an Advanced Search in NotePad, so I want it to appear on top of NotePad after I make a hot key combination (All of this I already have it)

    The problem is that the first time I do it the Form will Blink in the TaskBar and NotePad will still have focus.

    The same happens when I change the focus from NotePad to somewhere else, I return to NotePad and display the Form again (After that the Form will show over NotePad)

    Could anyone please help me? I am going crazy with this... I have searched in the forums but I can't get an answer that will work for me.

    Thank you!
    Last edited by Tec-Nico; Jan 1st, 2005 at 05:20 PM.
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  2. #2
    Addicted Member Rogier's Avatar
    Join Date
    Jun 2004
    Location
    Netherlands
    Posts
    143

    Re: Form Blinks when Showing Up

    Is it a Form or an exe what starts unfocussed up?
    for a program:
    VB Code:
    1. shell "C:/blabla.exe" vbmodal

    But for a Form:
    VB Code:
    1. Me.SetFocus

    Hope this helps

  3. #3

    Thread Starter
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192

    Re: Form Blinks when Showing Up

    Thanks, Roger. But your first answer cannot be applied to my case and I have already tried the second one... For hours.

    Anyway, I found a way to do it. I will post it for future reference:


    VB Code:
    1. 'API Function Needed:
    2. Private Declare Function Putfocus Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long
    3.  
    4. 'This Procedure will force any form given to show and get the Focus
    5. '(It won't blink)
    6. Private Sub forceShowUp(frmGiven As Form)
    7.  frmGiven.Show
    8.  Putfocus frmGiven.hwnd
    9. End Sub
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  4. #4
    Addicted Member Rogier's Avatar
    Join Date
    Jun 2004
    Location
    Netherlands
    Posts
    143

    Re: Form Blinks when Showing Up

    OK.
    I'm just a beginner.........so I never know who I can help

  5. #5

    Thread Starter
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192

    Re: Form Blinks when Showing Up

    Don't worry at all. Trying to help people is really admirable, no matter the level of your skills.

    So keep at it, you never know who you are going to help with a fresh view of the problem. Also, it means more than people who know a lot and don't share it at all.
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  6. #6
    Addicted Member Rogier's Avatar
    Join Date
    Jun 2004
    Location
    Netherlands
    Posts
    143

    Talking Re: Form Blinks when Showing Up

    Thank you for your very good words!

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