AutoHotkey Community

It is currently May 25th, 2012, 4:08 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 15 posts ] 
Author Message
PostPosted: February 15th, 2005, 2:30 pm 
I´m using an application that activates its debugging mode when a text file with some magic words in it is being dropped on its window. As I would like to use this function with a simple hotkey, I´ve worked on SendMessage/Winspector and ControlSend for a while - with very limited success. The application does not react at all :( .
So, how can I "drop" (the contents of) a file without actually dropping it?

The application in question is SAP GUI, the magic words are as follows:
Code:
[FUNCTION]
Command=/H
Title=Debugger
Type=SystemCommand


Thanks for your help!

Best regards,
Frank


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 15th, 2005, 3:20 pm 
Online

Joined: March 28th, 2004, 3:53 pm
Posts: 1869
maybe i don't fully understand the problem but..

you want:

Hotkey -> (ahk thinks) file dropped -> debug mode


so why not:

Hotkey -> debug mode

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
PostPosted: February 15th, 2005, 3:35 pm 
The point is that the application has no button to activate debugging mode, but it reacts on dropping a file with the given text on it. So, what I actually want to do is sending whatever message is needed to let the application believe someone has dropped such a file.

At the end of the day "hotkey -> debug mode" is exactly what I want - the question is how this can be done.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 16th, 2005, 12:33 am 
Online

Joined: March 28th, 2004, 3:53 pm
Posts: 1869
ok i understand the problem now... but i'm sorry i can't think of any solution at the moment... but i'll surely get back in case i think of something.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 16th, 2005, 1:34 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
You could try monitoring the app to see if there is a particular message you could send to it. Try Rajat's SendMessage Tutorial.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 16th, 2005, 7:45 pm 
Offline

Joined: February 15th, 2005, 3:36 pm
Posts: 3
I already followed the tutorial and found a couple of WM_COMMAND messages that are being sent when I activate debugging mode. However, sending them with ahk does not seem to work. Besides WM_COMMANDs I also noticed some messages recorded called "SAP_READ (Registered messages)". Does anyone know what this might be?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 16th, 2005, 10:09 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
I should have read the whole topic. :oops:

Anyway, you've probably already thought of this already, but as a last resort, simulate a drag and drop operation with something like:

WinActivate, X
MouseClick, left, 500, 100,,, D ; Hold down the mouse button on the object.
WinActivate, Y
MouseMove, 50, 50
MouseClick, left,,,,, U ; Release the mouse button to drop the object.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 17th, 2005, 2:08 pm 
Offline

Joined: February 15th, 2005, 3:36 pm
Posts: 3
With MouseClick/MouseMove I would need an explorer window at a constant position, right? I guess this wouldn´t be very comfortable.

As soon as my schedule allows it, I will continue working on the SendMessage approach. There must be a way...


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 17th, 2005, 3:00 pm 
Quote:
With MouseClick/MouseMove I would need an explorer window at a constant position, right?
No. Not necessarily. Check AHK's CoordMode command.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 17th, 2005, 7:00 pm 
Offline

Joined: February 15th, 2005, 3:36 pm
Posts: 3
I´ve checked out the following code:

Code:
Run, H:\Daten\Programmvorlagen\Debugger\, , UseErrorLevel
WinActivate, H:\Daten\Programmvorlagen\Debugger\
CoordMode, Mouse, Relative
MouseClick, Left, 60, 120, , , D   
WinActivate, ahk_class SAP_FRONTEND_SESSION
MouseMove, 160,160,10
MouseClick, Left, , , , , U


Please, no comments on the code. This is just a proof of concept... :wink:
However, this doesn´t work. The file I want to drag is highlighted and even moved within the explorer window if I ommit the second WinActivate. But the drag&drop does not seem to work over the border of an application. After running the script the file to drag&drop is selected, the target window is active and the mouse pointer is located within the target window. But no drop occured...

Any ideas?

Best regards,
Frank


Report this post
Top
 Profile  
Reply with quote  
 Post subject: BoBo
PostPosted: February 17th, 2005, 9:20 pm 
Offline

Joined: April 15th, 2004, 5:33 pm
Posts: 181
Code:
But the drag&drop does not seem to work over the border of an application


WinGetActiveStats of source window
ControlFocus at source window (rel. coords)
WinGetActiveStats of destination window
ControlFocus at destination window (rel. coords)
MouseMove to source window (screen coords)
MouseMove within source window (rel. coords)
MouseClickDrag from source- to destination window (screen coords)

Eh, braindump overdoze ... :shock:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 18th, 2005, 12:43 am 
Online

Joined: March 28th, 2004, 3:53 pm
Posts: 1869
Quote:
Post subject: BoBo

ooops!!!
:lol:

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 18th, 2005, 12:44 am 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
:lol:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 18th, 2005, 7:36 am 
Offline

Joined: April 15th, 2004, 5:33 pm
Posts: 181
Quote:
Post subject: BoBo
:shock:
Should have been @ BoBo blablabla ...
Had another thread open in parallel. So I've mixed up both by mistake. That yerk (just kidding :wink: ) seems to be everywhere around here. First evidence of a BoBoMania :lol:

@ BoBo
Sorry pal :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 22nd, 2006, 6:04 pm 
The following was working on my PC
Code:
coordmode mouse,screen
^1::
mouseclick,     L,1 ,75,,,D
WinActivate, ahk_class SAP_FRONTEND_SESSION
mousemove         300 ,0,,R
mouseclick      L,,   ,,,U
return

As you will see from the coordinates, I placed the explorer at the upper left corner, moved it to the left (past the left corner of the desktop), so that it will practical not consume any space on the desktop. In the directory (of the explorer) exists only one file.
Now you can even by means of AHK arbitrarely replace the Command line by other commands, for example
Code:
Command=/nsa38
The line
Code:
Title= ...
has no function, hence can be omitted.
Command=/h is perhaps the most important case, because in some cases it can not be executed using the control Edit1 of the SAP_FRONTEND_SESSION


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, BrandonHotkey, Hodofca, ogrish, Pulover, rbrtryn, sks, vsub, Yahoo [Bot] and 19 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:
cron
Powered by phpBB® Forum Software © phpBB Group