AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

A variable from a file name.

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
lukemeyer2000



Joined: 16 Feb 2010
Posts: 29

PostPosted: Tue Mar 16, 2010 10:58 pm    Post subject: A variable from a file name. Reply with quote

I am not sure if variable is the correct term, but I need a way to when I double click a file extension it remembers that files name.
Example if I double click test.doc it needs to remember the test so I can use it in later parts of the program. Is this possible? If so how would one code this?
Back to top
View user's profile Send private message
jethrow



Joined: 24 May 2009
Posts: 1907
Location: Iowa, USA

PostPosted: Tue Mar 16, 2010 11:25 pm    Post subject: Reply with quote

I'll let you figure out the double click part, but here's an example that will get you the file name when you click on it:
Code:
~LButton::
MouseGetPos, , , win, control
ControlGet, hwnd, hwnd, , %control%, ahk_id %win%
Acc := COM_AccessibleObjectFromWindow( hwnd )
itemNum := Acc.accSelection
fileName := Acc.accName( itemNum )
MsgBox, %fileName%

**NOTE** - this example uses AHKL & COM_L
_________________
Very Happy - in case I forgot to smile
Basic Webpage Controls
COM Object Reference
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group