AutoHotkey Community

It is currently May 27th, 2012, 12:54 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: December 28th, 2009, 5:13 pm 
I would really appreciate if someone could help me with this one. I want to basically create a GUI window where I would like to place a icon, which can be dragged over say another window, and based on which window I drag the icon to, it would perform certain action.

Example:
A small utility that I have seen is a password unmask, where if we drag a crosseye icon to the field which is a password, it would reveal the password for us. I hope you understand what I mean.

Another example:
For those who have used Winspector, I have just happened to install and just see what it is, not really worked extensively with this software, however in this software there is a small cross icon which can be clicked-dragged over another application/software window and it would detect various properties of that window etc.

Well basically I want to do something like that, I want to create a GUI which will have a small icon/image, which I will click and drag on an embedded flash element on a website & it would detect the html code and xpos, ypos, width, height of the embedded flash element.

Please someone help, or at least give me a clue how to begin with. I dont want the code how to get the html code or the coordinates of the flash but I want the click-drag icon/image feature and upon drop of the image over the target window it should detect it.

Thanks in advance.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 28th, 2009, 6:30 pm 
Offline

Joined: June 8th, 2006, 9:38 pm
Posts: 307
Something like this I imagine:

Code:
#NoEnv
#SingleInstance force

Gui, -caption +0x800000
Gui, Margin, 5, 5
Gui, Add, Pic, vpic gpicClicked icon110, shell32.dll
Gui, 2: +toolwindow +lastfound
Gui, 2: Margin, 0, 0
WinSet, Transparent, 230
Gui, 2:-caption +0x800000
Gui, 2: Add, Pic, icon110, shell32.dll
Gui, Show
return

picClicked:
Gui, 1:+lastfound
WinGetPos, x, y
Gui, 2:Show, % "x" x+5 "y" y+5
Gui, 2:+lastfound
; see http://www.autohotkey.com/forum/viewtopic.php?p=64185#64185
PostMessage, 0xA1, 2
KeyWait, LButton, Up
Gui, 2:hide
return

GuiClose:
exitApp


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 28th, 2009, 7:50 pm 
Offline
User avatar

Joined: April 4th, 2009, 8:19 pm
Posts: 1143
Location: Croatia
Roland's example is excellent, but if you want something that looks better, study GDI+


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2009, 3:39 am 
Thank you Roland & Learning one for the code as well as the tutorial link, however what I am looking for is a normal GUI which has a small image / icon with other normal gui controls like button, text etc. But when I click on the image / icon and drag it on to another window say notepad, it should show me the details of the notepad window such as the window title, height and width of the window etc.

This is just an example for understanding, though this is not my real purpose.

My real purpose is to make such a program and drag the icon on a flash game on internet after which the program can give me the information about height, width, top, bottom coordinates of that embedded flash on the website.

Thanks in advance.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 29th, 2009, 3:56 pm 
Offline

Joined: June 8th, 2006, 9:38 pm
Posts: 307
My script is just an example, you'll need to modify it. I used a GUI without titlebar and borders so the code to calculate the offset would be simple.

What you do when the user "drops" the icon is up to you (you probably want to start by getting the window under the mouse with MouseGetPos).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 30th, 2009, 7:59 am 
Thanks Roland, I have now been able to perform the task with your help. Hats off to you.


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot], Google [Bot], Google Feedfetcher, WillTroll, XstatyK and 25 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group