andy09 Posted February 3, 2009 Share Posted February 3, 2009 Hi, I've a windows softwarea running and I could like to close a window (file running within the software) WITHOUT CLOSING THE SOFTWARE. I've tried CODEWinActivate("G2-La Doma 2 - GX IEC Developer - [apa.xls]") ;Controlclick("G2-La Doma 2 - GX IEC Developer - [apa.xls]" , "", "[CLASS:ToolbarWindow32;INSTANCE:13]") WinClose ( "G2-La Doma 2 - GX IEC Developer - [apa.xls]" ,"Menu Bar" ) But WinClose closes the software as well, even though I use the option TEXT value "Menu Bar) to make sure it DOESN'T CLOSE the software. COuld you help me? Link to comment Share on other sites More sharing options...
BrettF Posted February 3, 2009 Share Posted February 3, 2009 Most likely you just need to use WinSetState () with the @SW_HIDE flag. Give it a try and see how it goes 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! Link to comment Share on other sites More sharing options...
andy09 Posted February 3, 2009 Author Share Posted February 3, 2009 THanks for your quick reply but IT doesn't work. It HIDES the HOLE SOFTWARE. What I want to do is to "close" a window WITHIN a windows software, not hide it. Is tehre another simple way to do this? Link to comment Share on other sites More sharing options...
andy09 Posted February 3, 2009 Author Share Posted February 3, 2009 HI again, With the autoit window info i got this info regarding the window I want to close within the Software. Advanced (Class): [CLASS:SPR32X60_SpreadSheet; INSTANCE:1] Therefor I've tried this code without any luck: CODEWinActivate("G2-La Doma 2 - GX IEC Developer - [apa.xls]") WinClose("[CLASS:SPR32X60_SpreadSheet]", "") Could you help me out? Br Andy Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 3, 2009 Moderators Share Posted February 3, 2009 andy09, Try using the value you get from "Class" from the "Window" tab rather than the "Advanced (Class) value from the "Control" tab. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
andy09 Posted February 3, 2009 Author Share Posted February 3, 2009 I've used this class that is the one for the top part of the window I want to close: CLASS:Afx:400000:8:10011:0:590609 CODEWinActivate("[CLASS:Afx:400000:8:10011:0:590609]", "") WinClose("[CLASS:Afx:400000:8:10011:0:590609]", "") This code closes down the correct window but 1 second later the hole applications shutsdown as well. The class used is not very useful since the "afx:......." number changes when I start ut the application again. What part of the window WITHIN the windows software should be used? I've tryed the "body" of that window was well as the class for the top part ofthe window containing the (X) button for closing the window without any luck. PLease help!! Link to comment Share on other sites More sharing options...
BrettF Posted February 3, 2009 Share Posted February 3, 2009 Whats the software? 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! Link to comment Share on other sites More sharing options...
andy09 Posted February 3, 2009 Author Share Posted February 3, 2009 Hi, It's called GX IEC Developer. PLC programming. I've found that the window I want to close within the software is called "Toolbarwindow32 instance 13" So I've tried this code: (first activate the software, then the internal window and then closing the internal window) CODEWinActivate("G2-La Doma 2 - GX IEC Developer - [apa.xls]") WinActivate("[CLASS:ToolbarWindow32;INSTANCE:13]", "") WinClose("[CLASS:ToolbarWindow32;INSTANCE:13]", "") Without any luck. Nothing happens except that the software is activated. What's wrong? Link to comment Share on other sites More sharing options...
andy09 Posted February 3, 2009 Author Share Posted February 3, 2009 solved it by sending CTRL and F4 for closing the window. Thansk for all the help Link to comment Share on other sites More sharing options...
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