Jump to content

Recommended Posts

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
Posted

Look at MouseClickDrag in the help file.


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

Posted

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
Posted

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.

Posted

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.

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
×
×
  • Create New...