Results 1 to 8 of 8

Thread: Blinking Tray Icon

  1. #1
    Guest

    Question

    I am making a program, in which I need a blinking tray icon.

    I know how to place the tray Icon, I just dont know how to blink it,

    sure I could keep Adding it and Removing it in a continuous loop, but I think that would steal quite alot of resources.

    If somebody could help me, I would greatly appreciate it.


    Thank You in advance

  2. #2
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    Please refer to:
    http://forums.vb-world.net/showthrea...threadid=22924
    It just basicly sets a timer to have an icon for a sec and then take it away and does it over and over.

    Gl,
    D!m
    Dim

  3. #3
    Guest
    is there any way I can do this without a timer?

  4. #4
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    I'm not sure...you can make it blink REALY fast by refreshing it constantly..or setting the icon = "" then icon = "file.ico"
    But using a timer would be best.

    You might want to ask the API experts for something in that area that would do that.

    Gl,
    D!m
    Dim

  5. #5
    Guest
    Of course there is a way...no Timer required.

    This is a way using the Do...Loop event.

    Code:
    Function timeout(interval)
    Current = Timer
    Do While Timer - Current < Val(interval)
    DoEvents
    Loop
    End Function
    
    'Timeout is optional..it is used to control speed..without it, it blinks very fast
    
    'code
    Form1.Icon = icon1.Picture 
    Do: DoEvents
    icon1.Visible = Not icon1.Visible
    timeout 0.1
    Loop
    Hope that helps.

  6. #6
    Hyperactive Member
    Join Date
    Dec 1999
    Posts
    321

    Um, in case you didn't noticed Dim


    He said

    sure I could keep Adding it and Removing it in a continuous loop, but I think that would steal quite alot of resources.
    so putting a Timer would just end up using about 3-4% of the CPU.

    You could manage it by loading an animated gif into the tray, although that'd be very advanced code,

    may I suggest instead of blinking, to put an icon with easy noticeable colors and/or fluorescent colors instead.

    Signed, Rodik ([email protected])
    Programmer,usesVB6ED
    ===========================
    Copyright©RodikCo,2002.

    Dont mind this signature ;] Its old

  7. #7
    Guest
    Oh yeah, and if you want to stop the blinking...

    Code:
    Do
    DoEvents
    Loop

  8. #8
    Guest
    thanks to everybody, but so far no luck,
    I used fox's demo to load the trayicon, and I used a timer to keep switching between icons, but the icon kept deleting itself before loading the other one, so the taskbar kept flickering....
    very NOT desirable....



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