CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2001
    Posts
    4

    System Tray Area

    I was looking for an API function by which I would get the location of the System Clock within the System Tray. Or for that matter, the position of any icon within the System Tray. Even if there is a way to get the System Tray's position itself, it might help. I can get the work area's width and height by the following code:


    private Sub Command1_Click()

    With SysInfo1

    print "WorkAreaLeft: " & .WorkAreaLeft / Screen.TwipsPerPixelX
    print "WorkAreaTop: " & .WorkAreaTop / Screen.TwipsPerPixelY
    print "WorkAreaWidth: " & .WorkAreaWidth / Screen.TwipsPerPixelX
    print "WorkAreaHeight: " & .WorkAreaHeight / Screen.TwipsPerPixelY
    print "ScreenHeight: " & Screen.Height / Screen.TwipsPerPixelY
    print "ScreenWidth: " & Screen.Width / Screen.TwipsPerPixelX

    End With

    End Sub




    Any help would greatly be appreciated. Thanks in advance.


  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: System Tray Area

    You can get the tray area by using the FindWindow API, I can't give you the code cause for some reason or another, I keep getting this message from PlanetSourceCode that I'm hitting the server to hard (something about 81 times per second, now try telling me IE doesn't send stuff it isn't supposed to :throwup ) and that I'm banned for 24 hours, but if you go there and search the VB section of the site using something like "tray", you should get back a program with the title "Place your form in the tray", which allows you to place a form (not an icon, an entire form) in the tray. This also uses code to get the position of the tray.

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Sep 2001
    Posts
    4

    Re: System Tray Area

    Thanks a lot for your help. I will try that.


  4. #4
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: System Tray Area

    Tom,
    Tried searching P.S.C.com for the mentioned sample app to place a form in the system tray and could not find it. I got 8 hits using your search argument. Most but not all had to do with Icons in the system tray but nothing stuck out as being able to place a form.
    ????

    John G

  5. #5
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: System Tray Area


  6. #6
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

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

Featured