Jump to content
Sign in to follow this  
andy09

How to close a window within an windows app?

Recommended Posts

andy09

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

CODE
WinActivate("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?

Share this post


Link to post
Share on other sites
BrettF
andy09

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?

Share this post


Link to post
Share on other sites
andy09

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:

CODE
WinActivate("G2-La Doma 2 - GX IEC Developer - [apa.xls]")

WinClose("[CLASS:SPR32X60_SpreadSheet]", "")

Could you help me out?

Br

Andy

Share this post


Link to post
Share on other sites
Melba23

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
andy09

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

CODE
WinActivate("[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!!

Share this post


Link to post
Share on other sites
BrettF
andy09

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)

CODE
WinActivate("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?

Share this post


Link to post
Share on other sites
andy09

solved it by sending CTRL and F4 for closing the window.

Thansk for all the help

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.