FaT3oYCG Posted June 17, 2008 Posted June 17, 2008 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) EndIf the move part isnt very good, but i will make it automatic or is there an easier way to check if the user is in effect clicking and dragging my form with the mouse? note: the titlebar on the window has been removed! i would like the user to click the form to be able to move it Thanks F@T3oYCG 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.
AdmiralAlkex Posted June 17, 2008 Posted June 17, 2008 (edited) 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) GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST") Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam) if ($hWnd = $hGUI2) and ($iMsg = $WM_NCHITTEST) then Return $HTCAPTION EndFunc Edited June 17, 2008 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now