How to programmatically close all previously opened windows?

This forum is for eXpress++ general support.
Message
Author
User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

Re: How to programmatically close all previously opened wind

#21 Post by Auge_Ohr »

hi,
Eugene Lutsenko wrote:I am trying to force close previously opened from menu (given above in this topic) windows when launching from it new windows.
again the Question : are those Windows in Tasklist so you can stop it :?:

if Yes you got some Sample how to do it.
if not than they are Xbase++ Windows so you need to modify your Code to stop it from Main.
greetings by OHR
Jimmy

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to programmatically close all previously opened wind

#22 Post by Eugene Lutsenko »

These are the Windows in which the system modes are executed, completely written in Alaska and Express. These modes are in the source text of the Eidos system. They are not external executable modules.

Victorio
Posts: 620
Joined: Sun Jan 18, 2015 11:43 am
Location: Slovakia

Re: How to programmatically close all previously opened wind

#23 Post by Victorio »

See you this opened window on bottom taskbar as several links?

User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

Re: How to programmatically close all previously opened wind

#24 Post by Auge_Ohr »

so the Solution is redesign your Code to be able to close Windows.

Code: Select all

PostAppEvent(xbeP_Close,,, oWindow)
1.) you must have Access to Object oWindow (e.g. save it)
2.) your oWindow must have filled o:Close Callback Slot (with Codeblock) to close Window


ad 1.) i do not like PUBLIC / PRIVATE so i use a Function

Code: Select all

FUNCTION ActiveWin(oWin)
STATIC oActive := NIL
   IF PCOUNT() > 0
      oActive := oWin
   ENDIF
RETURN oActive
ad 2.) i think Express++ have o:Close but i do not know Syntax

---

p.s. why do your Express++ do not close when finish :roll:
greetings by OHR
Jimmy

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to programmatically close all previously opened wind

#25 Post by Eugene Lutsenko »

Victorio wrote:See you this opened window on bottom taskbar as several links?
Yes

User avatar
Auge_Ohr
Posts: 1405
Joined: Wed Feb 24, 2010 3:44 pm

Re: How to programmatically close all previously opened wind

#26 Post by Auge_Ohr »

Eugene Lutsenko wrote:
Victorio wrote:See you this opened window on bottom taskbar as several links?
Yes
so they are all "free" Windows (AppDesktop() as Parent ) :?:
who is the Owner ... :?:
greetings by OHR
Jimmy

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to programmatically close all previously opened wind

#27 Post by Eugene Lutsenko »

I will make and send a small compiled example and once again describe the problem that I want to solve cardinally, i.e. programmatically (so as not to ask the user to solve it)

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to programmatically close all previously opened wind

#28 Post by Eugene Lutsenko »

Here is a small program with references to different tables in different Windows from the menu. In the implementation of this program there are shortcomings, but they do not play a special role now. For example, the tables do not have focus and they are not updated (refresh) at the time of the first show. This happens later, if you move the slider. Something like this represents my system. Only Windows and tables in the system are much larger and they are calculated by different algorithms. But for our purposes, this program is enough. What I want? I would like to make it so that when a new table is called from the menu for viewing (and editing), the table that was previously opened from the same menu is closed. To close the database that is viewed in a previously opened window and close the previously opened window. At the bottom of the taskbar, when you put the mouse cursor on the icon of the program, in the tray all the time there should be only two Windows: 1-e - window of the main menu, and 2-e - window mode selected from the menu. Now I catch the situation when the user tries to open a new window without closing the previous ones and just ask him to close the previously opened Windows before opening new ones.

When you open a new window from the menu, previously opened windows and databases should be automatically closed. How to do it?
Attachments
2.zip
(59.14 KiB) Downloaded 689 times

User avatar
rdonnay
Site Admin
Posts: 4722
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: How to programmatically close all previously opened wind

#29 Post by rdonnay »

I made some changes to your code.
Attachments
menu.zip
(2.72 KiB) Downloaded 697 times
The eXpress train is coming - and it has more cars.

User avatar
Eugene Lutsenko
Posts: 1649
Joined: Sat Feb 04, 2012 2:23 am
Location: Russia, Southern federal district, city of Krasnodar
Contact:

Re: How to programmatically close all previously opened wind

#30 Post by Eugene Lutsenko »

Thank You, Roger!

But I knew how to do that. I would just have to close the previous window when opening a new one, bat not lock the menu until the old window is open

Post Reply