Click to See Complete Forum and Search --> : System Tray Area


Payal77
October 5th, 2001, 12:43 PM
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.

Cakkie
October 5th, 2001, 01:03 PM
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
slisse@planetinternet.be

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

Payal77
October 5th, 2001, 03:48 PM
Thanks a lot for your help. I will try that.

John G Duffy
October 5th, 2001, 06:27 PM
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

John G Duffy
October 5th, 2001, 06:36 PM
I found it
http://www.planet-source-code.com/xq/ASP/txtCodeId.22370/lngWId.1/qx/vb/scripts/ShowCode.htm

John G

John G Duffy
October 5th, 2001, 06:36 PM
http://www.planet-source-code.com/xq/ASP/txtCodeId.22370/lngWId.1/qx/vb/scripts/ShowCode.htm

John G