AutoHotkey Community

It is currently May 26th, 2012, 10:38 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Help for this problem
PostPosted: September 12th, 2009, 9:36 pm 
Offline

Joined: September 12th, 2009, 6:38 pm
Posts: 3
I could not figure out whats going wrong...as i have just indulge 4-5 hours with AHK stuffs.

I have running window ( minimized in Taskbar ) of my trading s/w ( say XYZ title ), without login to trading server. following shortcut keys perform action when XYZ is in Maximize state..

1) Ctrl + l ------ Login Window opens
2) Escape ------- Login Window escaped
3) Ctrl + x ------- XYZ exits and Close.

Now i wrote a ahk script for testing so that above 3 actions be carried out without maximizing XYZ as

Code:
WinGet, XYZID, ID , XYZ
WinActivate, XYZID,
Sleep, 100
Send, ^l
Sleep, 2000
Send, {Esc}
Sleep, 100
Send, ^x
Send, {Tab}
Send, {Enter}


Some Sleep is used for safety and Send, {Tab} is for Switching to "Yes" button from "No" when confirming to exit from XYZ.

Now problem is , i saved this script on desktop as XYZ.ahk and when try to run with clicking XYZ.ahk, nothing happens but notification icon ( Green H ) of AutoHotKey prompt/flash in taskbar indicating script is working, but desired final result , exiting from XYZ didnt happen. Strange thing is , when i run XYZ.ahk as " Open With...." and choosing AutoHotKey from list then exactly desired all action happend and XYZ exited. All this process went without XYZ getting maximized.
Please help where is flaw...why it didnt run from desktop directly. Before this i had successfully tested simple action of Maximizing/Minimizing of XYZ ( in that i didnt used to get ID, rather simply calling WinActivate with direct title.)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2009, 10:17 pm 
Offline

Joined: August 3rd, 2009, 4:44 pm
Posts: 69
Location: UK
when using id's with winactivate you need to use this method

Code:
WinActivate, ahk_id %XYZID%


that may change the programs behavour


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 13th, 2009, 8:04 am 
Offline

Joined: September 12th, 2009, 6:38 pm
Posts: 3
horntail wrote:
when using id's with winactivate you need to use this method

Code:
WinActivate, ahk_id %XYZID%


that may change the programs behavour


yes , i realised mistake in code and corrected.
But with WinActivate, now XYZ window get maximized rather previously with faulty code with exacution under AutoHotKey it remained minimized. I wanted to remain minimized it....Im trying to execute above action without XYZ getting maximize...trying with PostMessage...but still no luck.
Can any one suggest exact function/procedure which im unable to implement cause im very new to AHK.... :cry:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 13th, 2009, 12:02 pm 
Offline

Joined: September 12th, 2009, 6:38 pm
Posts: 3
Ok, much of my action is taken care by ControlSend.

Only i have problem in accessing Child Window under a parent Window...??
Here Login Window is child and XYZ Parent. Suppose I mannualy run XYZ with Login Window Opened inside, and then i minimized XYZ ( this also hide Login window ). Now i want to escape Login Window without getting noticed....??


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot], Miguel, rbrtryn, XstatyK and 63 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