Results 1 to 6 of 6

Thread: Minimizing Event

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    15
    I want to send the my application to the system tray
    when the user press the minimize( _ ) of the form.
    How can I catch this event ?


    TIA,
    Eddie.

  2. #2
    Addicted Member
    Join Date
    Feb 2001
    Location
    Upstate NY
    Posts
    210
    i'm assuming you now how to send it to the tray, (if you dont, ask and ill post the code):

    put in a timer with a rathedr fast interval(10 ro 20)
    Code:
    Static Ste&
    if ste=me.windowstate then exit sub 'if it's already minimized, don't add another tray icon
    Ste=Me.Windowstate
    if me.windowstate=1 then 
    'code for tray icon
    end if
    < o >

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2001
    Posts
    15
    Thanks,

    It's a good idea, but won't it overload the system ?

  4. #4
    Megatron
    Guest
    Overload the system??

  5. #5
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Maybe this can help:
    Code:
    WM_NCHITTEST
    The WM_NCHITTEST message is sent to a window when the cursor moves, or when a mouse button is pressed or released. If the mouse is not captured, the message is sent to the window beneath the cursor. Otherwise, the message is sent to the window that has captured the mouse. 
    
    WM_NCHITTEST 
    xPos = LOWORD(lParam);  // horizontal position of cursor 
    yPos = HIWORD(lParam);  // vertical position of cursor 
     
    Parameters
    xPos 
    Value of the low-order word of lParam. Specifies the x-coordinate of the cursor. The coordinate is relative to the upper-left corner of the screen. 
    yPos 
    Value of the high-order word of lParam. Specifies the y-coordinate of the cursor. The coordinate is relative to the upper-left corner of the screen. 
    Return Values
    The return value of the DefWindowProc function is one of the following values, indicating the position of the cursor hot spot: 
    
    Value Location of hot spot 
    HTBORDER In the border of a window that does not have a sizing border 
    HTBOTTOM In the lower horizontal border of a resizable window (the user can click the mouse to resize the window vertically) 
    HTBOTTOMLEFT In the lower-left corner of a border of a resizable window (the user can click the mouse to resize the window diagonally) 
    HTBOTTOMRIGHT In the lower-right corner of a border of a resizable window (the user can click the mouse to resize the window diagonally) 
    HTCAPTION In a title bar 
    HTCLIENT In a client area 
    HTCLOSE In a close button 
    HTERROR On the screen background or on a dividing line between windows (same as HTNOWHERE, except that the DefWindowProc function produces a system beep to indicate an error) 
    HTGROWBOX In a size box (same as HTSIZE) 
    HTHELP In a Help button 
    HTHSCROLL In a horizontal scroll bar 
    HTLEFT In the left border of a resizable window (the user can click the mouse to resize the window horizontally) 
    HTMENU In a menu 
    HTMAXBUTTON In Maximize button 
    HTMINBUTTON In Minimize button 
    HTNOWHERE On the screen background or on a dividing line between windows 
    HTREDUCE In a Minimize button 
    HTRIGHT In the right border of a resizable window (the user can click the mouse to resize the window horizontally) 
    HTSIZE In a size box (same as HTGROWBOX) 
    HTSYSMENU In a System menu or in a Close button in a child window 
    HTTOP In the upper horizontal border of a window 
    HTTOPLEFT In the upper-left corner of a window border 
    HTTOPRIGHT In the upper right corner of a window border 
    HTTRANSPARENT In a window currently covered by another window in the same thread (the message will be sent to underlying windows in the same thread until one of them returns a code that is not HTTRANSPARENT) 
    HTVSCROLL In the vertical scroll bar 
    HTZOOM In a Maximize button
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  6. #6
    Megatron
    Guest
    That would mean subclassing your Form ,which really isn't necessary in this case.

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