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 

How do I show a menu at current text cursor position?

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



Joined: 08 Dec 2005
Posts: 9

PostPosted: Wed Jan 25, 2006 3:39 pm    Post subject: How do I show a menu at current text cursor position? Reply with quote

How do I show a menu at current text cursor position if e.g. the cursor is in an edit box in a form of the web browser?

I tried this, but doesn't work...

Code:
ControlGetFocus c
ControlGetPos, X, Y, , , c
Menu menuname, Show, X+50, Y+50


Thanks for all help,

Oliver
_________________
Oliver Kötter
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Wed Jan 25, 2006 3:45 pm    Post subject: Reply with quote

Please try your code with %% around c on the ControlGetPos command, and with this "Menu menuname, Show, % X+50, % Y+50 "
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
owilsky



Joined: 08 Dec 2005
Posts: 9

PostPosted: Wed Jan 25, 2006 3:49 pm    Post subject: Reply with quote

Thanks, but I already tried this:
Code:
ControlGetFocus c
MsgBox %c%
ControlGetPos, X, Y, , , %c%
MsgBox %X%,%Y% 
Menu menuname, Show, %X%, %Y%


But the msgboxes don't display anything.
_________________
Oliver Kötter
Back to top
View user's profile Send private message
toralf



Joined: 31 Jan 2005
Posts: 3841
Location: Bremen, Germany

PostPosted: Wed Jan 25, 2006 3:56 pm    Post subject: Reply with quote

I guess it is due to the web browser, since I remember that these commands only work on GUIs not on web pages. Maybe you could use a javascript to get the position, but I don't know that for sure.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
PhiLho



Joined: 27 Dec 2005
Posts: 6721
Location: France (near Paris)

PostPosted: Wed Jan 25, 2006 4:16 pm    Post subject: Reply with quote

I didn't understood your question because you were talking about the cursor (following the mouse position) and not the caret (marking the current position in the text area).

toralf is right, I think that in most browsers, Web pages are just surfaces where the browser draws. In other words, they don't use classical Windows controls but emulate them, so window spies see only one big control, not the form controls.

Some tester programs (robots to test Web applications) can control such forms, but I think they actually use the browser API to do so at low level.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   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