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!

Outlook-style email notification popup

Status
Not open for further replies.

AndyGroom

Programmer
Joined
May 23, 2001
Messages
972
Location
GB
I've been trying to find some sample code that would do something along the lines of displaying the kind of popup notification window you get in Outlook when you receive an email.

It doesn't matter so much about the fading in and out, although that would be a bonus. The only examples I can find are for yellow balloons, which isn't what I want.

Has anyone got any sample code?

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
yep
Code:
Public Declare Function SetLayeredWindowAttributes Lib "user32.dll" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Public Const LWA_ALPHA As Long = &H2

Code:
Dim nOpacity As Integer
Dim nStepDelay As Integer, nBaseOpacity As Integer


    nStepDelay = 100 'Delay between steps 
    nBaseOpacity = 0 'How transparent to start?
    Show
    For nOpacity = nBaseOpacity To 255 Step 5
        Sleep nStepDelay
        SetLayeredWindowAttributes me.hWnd, 0, nOpacity, LWA_ALPHA ' Hwnd is Handle to Window....
        Refresh
    Next

Credit where credit is due - but i can't remember where I found it (probably it has Strongm's fingers somewhere near)

SetLayeredWindowAttributes is the key to it

Take Care

Matt
I have always wished that my computer would be as easy to use as my telephone.
My wish has come true. I no longer know how to use my telephone.
 
Thanks.

Do you remember if anything else is required for this to work? The code as it stands doesn't seem to do anything.

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
I'll answer my own question :-)

Code:
  Style = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
  If Not (Style And WS_EX_LAYERED = WS_EX_LAYERED) Then
    Style = Style Or WS_EX_LAYERED
    SetWindowLong Me.hwnd, GWL_EXSTYLE, Style
  End If

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top