Mucho Posted May 8, 2009 Posted May 8, 2009 When I launch my charting program, some chart windows are automatically opened up and I would like to close them. The chart windows have different titles according to the name of the stock and being intra day charts, some have 60 mins, 120 mins, etc next to the title. My two methods of solving my problem does not work. 1) This is what I got when I use the script writer. WinWait("ST ENGG.SG [120 Min]"," Processing data. Pl") If Not WinActive("ST ENGG.SG [120 Min]"," Processing data. Pl") Then WinActivate("ST ENGG.SG [120 Min]"," Processing data. Pl") WinWaitActive("ST ENGG.SG [120 Min]"," Processing data. Pl") But the code below does not work. Opt("WinTitleMatchMode", 2) WinWait(""," Processing data. Pl", 8) If WinActive(""," Processing data. Pl") Then WinSetState(""," Processing data. Pl", @SW_MINIMIZE) Endif 2) If I set Winsetontop the program on top of all the charts it opened, the chart windows become invisible even after resetting winsetontop with '0'. Minimising the program cannot reveal the charts. Here are some more window info: >>>> Window <<<< Title: Class: Shell_TrayWnd Position: -2, 737 Size: 1028, 33 Style: 0x96840000 ExStyle: 0x00000188 Handle: 0x00030044
BrettF Posted May 8, 2009 Posted May 8, 2009 Hello. Does something like so work? Opt ("WinTitleMatchMode", 2) ; 1 = Match the title from the start (default) ; 2 = Match any substring in the title ; 3 = Exact title match ; 4 = Advanced mode, see Window Titles & Text (Advanced) $aList = WinList("ST ENGG.SG") For $a = 1 to UBound ($aList) - 1 WinSetState ($aList[$a][1], "", @SW_MINIMIZE) Next Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Mucho Posted May 8, 2009 Author Posted May 8, 2009 Brett, "ST ENGG.SG" is the code name of just a stock which means it varies depending on the stock. So instead of "ST ENGG.SG", it could be "ASL.SG" OR "NOL.SG", etc. But " Processing data. Pl"is the constant. Do you think substituting it will work? " Processing data. Pl" is not the title. Thanks. Thomas
BrettF Posted May 8, 2009 Posted May 8, 2009 #include <Array.au3> Opt ("WinTitleMatchMode", 2) $aList = WinList ("", "Processing data") _ArrayDisplay ($aList) Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Mucho Posted May 8, 2009 Author Posted May 8, 2009 Thanks, Brett. I will try it out when I get back to work on Monday. Thomas #include <Array.au3> Opt ("WinTitleMatchMode", 2) $aList = WinList ("", "Processing data") _ArrayDisplay ($aList) Cheers, Brett
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now