Jump to content

WM_NCHITTEST


Dampe
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...