Jump to content
Sign in to follow this  

Mouse Clicking - Check For Input

Recommended Posts


how would i check if the user clicks the (left) mouse button, i have this code to check if the mouse is over the right area

If MouseGetPos(0) >= $Host_Win[0] And MouseGetPos(0) <= $Host_Win[0] + $Host_Win[2] And MouseGetPos(1) >= $Host_Win[1] And MouseGetPos(1) <= $Host_Win[1] + $Host_Win[3] Then
;WinMove ("Form1", "", MouseGetPos(0) - 10, MouseGetPos(1) - 10)

the move part isnt very good, but i will make it automatic


is there an easier way to check if the user is in effect clicking and dragging my form with the mouse?


the titlebar on the window has been removed!

i would like the user to click the form to be able to move it



p.s. as always i have searced the help file and forums

Interpreters have great power!Although they live in the shadow of compiled programming languages an interpreter can do anything that a compiled language can do, you just have to code it right.

Share this post

Link to post
Share on other sites

Why not do it the easy way?? Either=

A. Use the style $GUI_WS_EX_PARENTDRAG on something like a label or whatever fits you or...

B. Use something like this (from the AlphaBlend.au3 in AutoIt3\Examples\GUI\Advanced folder)

Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
  if ($hWnd = $hGUI2) and ($iMsg = $WM_NCHITTEST) then Return $HTCAPTION
Edited by AdmiralAlkex

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.