Re: WM_NCHITTEST affects on GUI title area/Menu/Resize edges etc
"valery_vi" <[email protected]> Fri, 27 Jul 2007 07:15:18 -0000
| Newsgroups | gmane.comp.windows.autoit.user |
|---|---|
| Message-ID | <[email protected]> |
MsCreator from AutoItSctipt forum wrote:
http://www.autoitscript.com/forum/index.php?showtopic=50223
"..
if i want to close the gui or use Menus in my Gui or even resize the
gui - thats not working
...
I know that i can solve this problem using the registr func like this:
"
However, this solution doesn't allow to resize window.
This is my example to do it.
#include <GuiConstants.au3>
Global Const $WM_NCHITTEST = 0x0084
Global $GUI = GuiCreate("Drag using any place on GUI - Demo", 200,
300, 0, 0, $WS_OVERLAPPEDWINDOW)
Opt('MouseCoordMode',2)
$Menu = GUICtrlCreateMenu("Test Menu")
GUICtrlCreateMenuItem("Item", $Menu)
GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
GUISetState()
While 1
$Msg = GUIGetMsg()
Switch $Msg
Case -3
Exit
Case Else
EndSwitch
WEnd
Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
If $iMsg = $WM_NCHITTEST And $hWnd = $GUI then
Local $XPos = MouseGetPos(0)
Local $YPos = MouseGetPos(1)
Local $WinPos = WinGetClientSize ($hWnd)
if $YPos > 0 and $YPos < $WinPos[1] and $XPos > 0 and $XPos <
$WinPos[0] Then Return 2
endif
EndFunc
Valery