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 

Help for this problem

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



Joined: 12 Sep 2009
Posts: 3

PostPosted: Sat Sep 12, 2009 8:36 pm    Post subject: Help for this problem Reply with quote

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.)
Back to top
View user's profile Send private message
horntail



Joined: 03 Aug 2009
Posts: 69
Location: UK

PostPosted: Sat Sep 12, 2009 9:17 pm    Post subject: Reply with quote

when using id's with winactivate you need to use this method

Code:
WinActivate, ahk_id %XYZID%


that may change the programs behavour
Back to top
View user's profile Send private message
devdas



Joined: 12 Sep 2009
Posts: 3

PostPosted: Sun Sep 13, 2009 7:04 am    Post subject: Reply with quote

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.... Crying or Very sad
Back to top
View user's profile Send private message
devdas



Joined: 12 Sep 2009
Posts: 3

PostPosted: Sun Sep 13, 2009 11:02 am    Post subject: Reply with quote

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....??
Back to top
View user's profile Send private message
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