Bay Six Software Forum Index Bay Six Software
Beyond the Basics
 
 FAQFAQ   SearchSearch   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

minimizing to icon

 
Post new topic   Reply to topic    Bay Six Software Forum Index -> WMLiberty DLL
View previous topic :: View next topic  
Author Message
doom3
Guest





PostPosted: Oct 9th, 2007, 1:37pm    Post subject: minimizing to icon Reply with quote

could somebody please post some example code on how to make a window minimize to the system notification area when the minimize button is pressed.

I have been trying to solve this for a a few months now but dont know how. I have downloaded LB nl124 and played around with the icon program but i still dont know how 2 do it.

Any help would be greatly apreciated.
Back to top
Brent
Site Admin


Joined: 01 Jul 2005
Posts: 797

PostPosted: Oct 10th, 2007, 9:15am    Post subject: Re: minimizing to icon Reply with quote

Does the following demo help? You would use the OnSize function in place of the NL demo's button click event handler.

Notice that the window still minimizes. So, before you re-show the window, you'll need to restore it. There are other messages you could trap to prevent minimization, but I think it would be easier to do it this way.
Code:
    Open "wmliberty" For DLL As #wmlib

    Open "Trapping Minimize Demo" For Window As #demo
    #demo "TrapClose demo.Close"

    Callback lpfnCB, OnSize( ULong, ULong, ULong, ULong ), Long

    r = SetWMHandler(HWnd(#demo), _WM_SIZE, lpfnCB, 0)

    Call DoEvents

Function OnSize( hWnd, uMsg, wParam, lParam )
    OnSize = 1

    If wParam = _SIZE_MINIMIZED Then
        Print "Minimized"
    End If
End Function

Sub demo.Close wnd$
    Close #demo
    Close #wmlib
    End
End Sub

Sub DoEvents
1   Scan
    CallDLL #kernel32, "Sleep", _
        100 As Long, r As Void
    GoTo 1
End Sub

Function SetWMHandler( hWnd, uMsg, lpfnCB, lSuccess )
    CallDLL #wmlib, "SetWMHandler", _
        hWnd As ULong, uMsg As ULong, _
        lpfnCB As ULong, lSuccess As Long, _
        SetWMHandler As Long
End Function

_________________
Brent
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Bay Six Software Forum Index -> WMLiberty DLL All times are GMT
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum



Lo-Fi Version
Powered by phpBB © 2001, 2005 phpBB Group