Jump to content
Sign in to follow this  
Dampe

WM_NCHITTEST

Recommended Posts

Dampe

Is there anyway to constantly call this function

Func WM_NCHITTEST($hWnd, $Msg, $wParam, $lParam)
        Local $iProc
        
        $iProc = DllCall("user32.dll", "int", "DefWindowProc", "hwnd", $hWnd, "int", $Msg, "wparam", $wParam, "lparam", $lParam)
        $iProc = $iProc[0]
        
        If $iProc = $HTCLIENT Then Return $HTCAPTION
            
   
        Return $GUI_RUNDEFMSG
EndFunc

Without using GuiRegisterMsg, so that my window will always be dragged while my application is running?

Just like my mouse is always clicked on the gui window.

I don't want to use controlclick or mouse clicks.


Share this post


Link to post
Share on other sites
martin

Is there anyway to constantly call this function

Func WM_NCHITTEST($hWnd, $Msg, $wParam, $lParam)
        Local $iProc
        
        $iProc = DllCall("user32.dll", "int", "DefWindowProc", "hwnd", $hWnd, "int", $Msg, "wparam", $wParam, "lparam", $lParam)
        $iProc = $iProc[0]
        
        If $iProc = $HTCLIENT Then Return $HTCAPTION
            
   
        Return $GUI_RUNDEFMSG
EndFunc

Without using GuiRegisterMsg, so that my window will always be dragged while my application is running?

Just like my mouse is always clicked on the gui window.

I don't want to use controlclick or mouse clicks.

What are the circumstances when it doesn't work if you use GuiRegisterMsg?

When you say "Just like my mouse is always clicked on the gui window" do you mean you want the gui to move with the mouse cursor even if the button is not down?

Without knowing exactly what you want and what problems you have with using GuiRegusterMsg I would suggest that you could use Timer_SetTimer to call a function repeatedly and in the function use GUIGetCursorInfo to decide how to move the gui.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
Dampe

Yeah, I want the window to follow my mouse without me having the button pressed down.

If you could give me a heads up on doing so that'd be pro.

Edited by Dampe

Share this post


Link to post
Share on other sites
monoceres

Maybe this suits your need:

Opt("GUIOnEventMode",1)
$hwnd=GUICreate("Hello",300,300)
GUISetOnEvent(-3,"close")
GUISetState()

$user32=DllOpen("user32.dll")
While 1
    $mpos=MouseGetPos()
    DllCall($user32,"int","SetWindowPos","hwnd",$hwnd,"hwnd",0,"int",$mpos[0]-150,"int",$mpos[1]-150,"int",300,"int",300,"uint",0)
    Sleep(20)
WEnd



Func close()
    Exit
EndFunc

;)


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites
martin

Yeah, I want the window to follow my mouse without me having the button pressed down.

If you could give me a heads up on doing so that'd be pro.

Does that mean my suggestion with Timer_SetTimer and GuiGetCursorInfo doesn't help you?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×