Sign in to follow this  
Followers 0
Kip

Mouse Pressed, Not Released

7 posts in this topic

#1 ·  Posted (edited)

Hello,

How can I make a script that can drag and drop a custom made window?

I thought that you can do that with something like this:

Case $msg = $Header
          While MouseDown("left")
                    $pos = MouseGetPos()
        WinMove($CMDLine[1], "", $pos[0], $pos[1])
          WEnd
          MouseUp("left")

($Header is the image where you need to click on to drop the window to somewhere else.)

But this doesn't work. Can someone help me?

(Yes, I'm a newbie)

Thnx

Edited by kip

Share this post


Link to post
Share on other sites

Look at MouseClickDrag in the help file.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

AutoIt doesn't have to click and drag. But I need to drag te window to an another place.

Edited by kip

Share this post


Link to post
Share on other sites

AutoIt doesn't have to click and drag. But I need to drag te window to an another place.

Click and drag the title bar of the window with MouseClickDrag() as BigDod suggested, or use WinMove() to do it without the mouse.

:shocked:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Hello,

How can I make a script that can drag and drop a custom made window?

I thought that you can do that with something like this:

Case $msg = $Header
          While MouseDown("left")
                    $pos = MouseGetPos()
        WinMove($CMDLine[1], "", $pos[0], $pos[1])
          WEnd
          MouseUp("left")

... or use a while loop, whatever you want. Just remember to #include <Misc.au3>

Hope this helps.


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

By the way, the MouseDown *performs* a MouseDown, in other words, simulates a button press. It does not return the pressed-or-not-pressed status of the mouse button. (That's what _IsPressed can be used for.)


Roses are FF0000, violets are 0000FF... All my base are belong to you.

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  
Followers 0