dcsimg
Results 1 to 3 of 3

Thread: [RESOLVED] Taskbar location and size change events

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2016
    Posts
    51

    Resolved [RESOLVED] Taskbar location and size change events

    I'm trying to find an event that triggers when the location of the taskbar changes and another for when the size of the taskbar changes but I can't find any. Is there any? I would prefer to use the event rather than using a timer and constantly checking if it's still the same...
    Thanks in advance
    When someone talks sh*t about me:


    Are you ta'king to me?..
    Are you ta'king to the special one?..
    Are you ta'king to the special one?..
    There's nobody else here,
    you must be talking to the special one!
    Are you ta'king to me?
    Are are, are you ta'king to me?


  2. #2
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,251

    Re: Taskbar location and size change events

    I think SystemEvents might be worth looking at, for example this beeps when I changed the size of taskbar in Win7, not sure what else triggers it tho, as I didn't read any doc.

    Code:
    Imports Microsoft.Win32
    
    Public Class Form1
    
        Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
        ' MSDN: Because this is a static event, you must detach your event handlers
        ' when your application is disposed, or memory leaks will result.
            RemoveHandler SystemEvents.UserPreferenceChanged, AddressOf SystemEvents_UserPreferenceChanged
        End Sub
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            AddHandler SystemEvents.UserPreferenceChanged, AddressOf SystemEvents_UserPreferenceChanged
        End Sub
    
        Private Sub SystemEvents_UserPreferenceChanged(sender As Object, e As UserPreferenceChangedEventArgs)
            If e.Category = UserPreferenceCategory.Desktop Then
                ' Do something after user changes desktop.
                Beep()
            End If
        End Sub
    
    End Class
    Last edited by Edgemeal; Mar 12th, 2016 at 03:56 PM.

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 2016
    Posts
    51

    Re: Taskbar location and size change events

    Wow, that works exactly as I wanted! Thanks
    When someone talks sh*t about me:


    Are you ta'king to me?..
    Are you ta'king to the special one?..
    Are you ta'king to the special one?..
    There's nobody else here,
    you must be talking to the special one!
    Are you ta'king to me?
    Are are, are you ta'king to me?


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width