|
-
Mar 9th, 2002, 08:51 PM
#1
Thread Starter
Lively Member
System tray code... a little help please
I currently have an app which minimizes to system tray, but what I want to happen is that when you right click on the tray icon, form2 is loaded (as opposed to a popup menu).
To be a little more specific, I want the lower right corner of form2 to be right next to the mouse cursor. I've searched high and low for sample code that does this and I haven't found anything even close to it.
Could someone please help out a beginner... or point me in the right direction?
Thanks in advance,
- Cam
-
Mar 9th, 2002, 08:56 PM
#2
VB Code:
Option Explicit
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Sub Form_Load()
Dim tPOINT As POINTAPI
Call GetCursorPos(tPOINT)
Me.Move (tPOINT.x * Screen.TwipsPerPixelX) - Width, (tPOINT.y * Screen.TwipsPerPixelY) - Height
End Sub
-
Mar 9th, 2002, 09:02 PM
#3
Thread Starter
Lively Member
Damn... what a quick response!
Thanks!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|