GUI: Drag N' Drop to get WinTitle

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
scriptor2016
Posts: 849
Joined: 21 Dec 2015, 02:34

GUI: Drag N' Drop to get WinTitle

22 Jul 2017, 02:39

Hi :)

I'm looking to find a way that when you drop *any* window on top of the GUI, a messagebox will indicate the WinTitle of the dropped window. Much like this:

Code: Select all

Gui, Show, w200 h200
Return

GuiDropFiles:
	MsgBox, %A_GuiEvent%
Return
But instead of "A_GuiEvent", it would be something like "A_WinTitle". the function title might need to be "GuiDropWintitle:" or something similar.

I have some code that will work, but it monitors the active window that is being dragged and dropped, and then checks the window it was dropped on before it continues (this is kind of reverse of what I'm looking to do- I don't want to actively monitor the window which is being dragged and dropped, instead I want the window underneath in which another window is being dropped upon to do the montoring). I was hoping to find a way for the master GUI (the w200 h200 one as seen in the script above), to recognize when any window has been dropped on it, and then get the dropped window's WinTitle.

Can this be done?
User avatar
divanebaba
Posts: 805
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: GUI: Drag N' Drop to get WinTitle

22 Jul 2017, 12:48

Hi.
A way to recognize a dropped window is till now unknown for me.
A similar way I use is to right click a window, I want to recognize.
I'm clicking on a button to start my recognizing label, called CatchWinTitle, ant then I right click the destinated window.
It is not what you want, but maybe it will help until you have found your desired code.

Code: Select all

CatchWinTitle:
keywait, RButton, D
MouseGetPos, , , id, control
WinGetTitle, WinTitle, ahk_id %id%
MsgBox %WinTitle%
return
Einfach nur ein toller Typ. :mrgreen:

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 254 guests