Results 1 to 12 of 12

Thread: Move System Tray, Start Button etc.

  1. #1

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Move System Tray, Start Button etc.

    Move System Tray, Start Button etc along the Taskbar using a Timer.
    Tested with Windows XP.

    Note- little update (removing an unnecessary if condition and few comments have been added) has been made to the code.
    Attached Files Attached Files
    Last edited by Fazi; Oct 16th, 2007 at 01:06 PM.

  2. #2
    Hyperactive Member Davadvice's Avatar
    Join Date
    Apr 2007
    Location
    Glasgow (Scotland)
    Posts
    440

    Re: Move System Tray, Start Button etc.

    had a little fun with this, thanks

    David

  3. #3

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Move System Tray, Start Button etc.

    Thanks for the Comment Davadvice. Comments are Really appriciated

  4. #4
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    Re: Move System Tray, Start Button etc.

    Hehehe.. Had some fun here. Small code b.t.w. Never knew that it would be "that easy".


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  5. #5

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Move System Tray, Start Button etc.

    Thanks Radjesh

  6. #6
    Hyperactive Member cameron2's Avatar
    Join Date
    Mar 2008
    Location
    Australia
    Posts
    401

    Re: Move System Tray, Start Button etc.

    Wow this is really good, so simple.
    Did you manage this by yourself?

  7. #7
    Hyperactive Member
    Join Date
    Aug 2006
    Location
    TeXaS
    Posts
    497

    Re: Move System Tray, Start Button etc.

    fun, but it only works if your task bar sits horizontal(bottom or top of screen), if its on the side of the screen it doesn't look good.

  8. #8

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Move System Tray, Start Button etc.

    Hai cameron2 & Billy Conner,
    extreamly sorry for the late comment to your posts.coz i am sure i did not notify of your comments.

    caeonen2,
    Wow this is really good, so simple.
    Did you manage this by yourself?
    yah yah, just undestanding the window & it's messages helped me a lot.
    there are plenty of articles on the net on Window Messages and Undestaning the Window architect.

    BillCorner
    fun, but it only works if your task bar sits horizontal(bottom or top of screen), if its on the side of the screen it doesn't look good.
    Ooops. just noted that problem ><

  9. #9
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    Re: Move System Tray, Start Button etc.

    Here is my small code i wrote not so long ago, to determine where is the taskbar just aligned. It also helps to determine the actual desktop area.

    Basic but works as well.

    Code:
    Option Explicit
    
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    
    Private Type RECT
        Left As Long
        Top As Long
        Right As Long
        Bottom As Long
    End Type
    
    Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
    
    Private Sub Form_Load()
    
    Dim Rt As RECT
    Rt = GetDesktopRect
    
    With Rt
        Debug.Print .Left; .Top; .Right; .Bottom
    End With
    
    End
    End Sub
    
    Private Function GetDesktopRect(Optional ByRef GetTaskBarP As Long = -1) As RECT
        Static tWnd As Long
        Dim Rt As RECT
        Dim sX As Long, sY As Long
        sX = Screen.Width / Screen.TwipsPerPixelX
        sY = Screen.Height / Screen.TwipsPerPixelY
        
        If tWnd = 0 Then tWnd = FindWindow("Shell_TrayWnd", vbNullString)
        
        GetWindowRect tWnd, Rt
        
        With GetDesktopRect
            .Left = 0
            .Top = 0
            .Right = sX
            .Bottom = sY
        End With
        
        With Rt
            If .Left < 1 And .Top > 1 Then
                GetDesktopRect.Bottom = .Top
                GetTaskBarP = 1
                Exit Function
            End If
            
            If .Left < 1 And .Top < 1 And .Bottom > sY Then
                GetDesktopRect.Left = .Right
                GetTaskBarP = 2
                Exit Function
            End If
            
            If .Left < 1 And .Top < 1 And .Right > sX Then
                GetDesktopRect.Top = .Bottom
                GetTaskBarP = 3
                Exit Function
            End If
            
            If .Left > 0 Then
                GetDesktopRect.Right = .Left
                GetTaskBarP = 4
                Exit Function
            End If
            
        End With
        
        
    End Function
    Funny code Maybe you can extend it to detect how close the mouse pointer is, then you can move the object close to the pointer, to make it easy to click on it.... Or just run before it, to be hard to catch :-D
    Last edited by Jim Davis; Nov 14th, 2008 at 12:11 AM.

  10. #10

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Move System Tray, Start Button etc.

    Thanks Davis for the code

  11. #11
    New Member
    Join Date
    Jan 2009
    Posts
    4

    Re: Move System Tray, Start Button etc.

    Just got registered and was looking through the forum. I've been using AutoHotKey for doing small apps and this is something I was trying to do with that {the system tray part anyway}. I haven't taken a look at this yet, but I wanted to thank you in advance

    Peace to you and yours,
    Matthew "Dra'Gon" Stohler

  12. #12

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Move System Tray, Start Button etc.

    Thank You TechnoDragon

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