Results 1 to 9 of 9

Thread: [RESOLVED] make your program blink(orange) in taskbar like msn messenger

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2007
    Posts
    200

    Resolved [RESOLVED] make your program blink(orange) in taskbar like msn messenger

    I'm just creating a chess program and connecting through tcp.

    I want to alert the user, in a similar fashion to that of msn messenger when one receives a message. Making the program/conversation window's in the taskbar blink orange.

    Anyone know how? thanks

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    Re: make your program blink(orange) in taskbar like msn messenger

    You can add in a FlashWindow API call to accomplish this. There maybe a .Net equivalent, but I'm not aware of one so far:

    http://www.vbforums.com/showthread.p...ht=flashwindow

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    Re: make your program blink(orange) in taskbar like msn messenger

    Updated after guesswork failed, this is a tried and tested version of the call in a .Net environment:
    Code:
    Imports System.Runtime.InteropServices
    
    Public Class Form1
        <DllImport("user32.dll", EntryPoint:="FlashWindow")> _
        Public Shared Function FlashWindow(ByVal hwnd As Integer, ByVal bInvert As Integer) As Integer
        End Function
    
        Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            With Timer1
                .Interval = 300
                .Enabled = True
                .Start()
            End With
        End Sub
    
        Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
            FlashWindow(Me.Handle, 1)
        End Sub
    End Class
    Last edited by alex_read; Jun 6th, 2008 at 05:23 AM.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Mar 2007
    Posts
    200

    Re: make your program blink(orange) in taskbar like msn messenger

    ill try that now =)

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Mar 2007
    Posts
    200

    Re: make your program blink(orange) in taskbar like msn messenger

    Hmm i think dllimport is C#. Sorry, i suck with any other languages apart from vb.net, and even with vb.net, im not very good.

  6. #6
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    Re: make your program blink(orange) in taskbar like msn messenger

    Hiya Zapper! Between posts I wrote a quick sample and changed the code above from a "try something like this which might work" to an actual tested solution coding example. DllImport isn't C# specific, but the original suggestion of the square brackets rather than the angle brackets was - apologies there!

    Basically fire up a new VB Windows Application project. Add a timer control to the form, then use that code posted above and it'll work for you.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  7. #7
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    Re: make your program blink(orange) in taskbar like msn messenger

    Then if you need a beta tester, let me know! Not fantastic at chess at all but I play from time to time. Good luck with your project!

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Mar 2007
    Posts
    200

    Re: make your program blink(orange) in taskbar like msn messenger

    lol haha yea! ty alot. almost finished with it, parts of the code may be tedious, but works!
    just implied Enpassant, castle and promotion
    Im almost finished my exams, only 2 easy ones left. but still kinda need to study for them.
    Hope to verse u soon, =)

  9. #9
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    Re: make your program blink(orange) in taskbar like msn messenger

    No problem. Just shout again if you can't get that one above working, or please mark the thread title with the word [Resolved] at the start of it if all's ok and working again.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

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