Click here to Skip to main content
15,886,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am creating a messenger with a notification(MSN like).

How Can i show a notification windows without losing my focus on my active form?

i tried this
VB
Private Declare Function ShowWindow Lib "user32" (ByVal handle As IntPtr, ByVal nCmdShow As Integer) As Integer

Private Const SW_SHOWNA As Integer = 4

Private Sub ShowForm()
    ShowWindow(Me.Handle, SW_SHOWNA)
End Sub


and this
VB
Protected Overrides ReadOnly Property ShowWithoutActivation() As Boolean
        Get
            Return True
        End Get
End Property

But none of them working.

Everytime a notification windows pop up, i always lost my focus on my active form.

Thanks.
Posted

1 solution

I imagine what you want to do, is pop up your notification, then return focus to your active window.
 
Share this answer
 
Comments
Dwi Prawira 25-Aug-10 5:18am    
I have tought about that. But that is my worst case scenario if there is no other way. Thanks for your fast respond anyway. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900