Results 1 to 3 of 3

Thread: System tray code... a little help please

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    85

    Question 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

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    VB Code:
    1. Option Explicit
    2.  
    3. Private Type POINTAPI
    4.         x As Long
    5.         y As Long
    6. End Type
    7.  
    8. Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
    9.  
    10. Private Sub Form_Load()
    11.     Dim tPOINT As POINTAPI
    12.    
    13.     Call GetCursorPos(tPOINT)
    14.     Me.Move (tPOINT.x * Screen.TwipsPerPixelX) - Width, (tPOINT.y * Screen.TwipsPerPixelY) - Height
    15. End Sub

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Posts
    85
    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
  •  



Click Here to Expand Forum to Full Width