Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form on top without focus

Status
Not open for further replies.

jlsmithhartfiel

Programmer
Jan 7, 2002
336
US
I have a program that creates msn-like alerts on certain conditions. So a little form pops up in the lower-right hand corner. The problem is, if I'm typing in another app, the popups are taking focus.

I tried to use the setwindowpos and flag swp_noactivate, but it's not working. Is there another way?

Code:
Public Function SetOnTop(ByVal hwnd As Long, ByVal blnSetOnTop As Boolean)
    If blnSetOnTop Then
        SetOnTop = SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOACTIVATE Or SWP_NOSIZE)
    Else
        SetOnTop = SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOACTIVATE Or SWP_NOSIZE)
    End If
End Function

TIA,

Jessica [ponytails2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top