Brent Site Admin
Joined: 01 Jul 2005 Posts: 790
|
Posted: Oct 10th, 2007, 9:15am Post subject: Re: minimizing to icon |
|
|
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 |
|