Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 7 Monaten, 3 Wochen
Letzter Beitrag:
vor 7 Monaten, 3 Wochen
Beteiligte Autoren:
Markus K., DannHCS, Arie, Al, Fabrice Harari, DW

[WD20] Is it possible to have the name of a NOT OPENED window??

Startbeitrag von DannHCS am 23.11.2017 15:40

I'd like to have the name of a window BEFORE opening it.

I tried with WIN_MyWindow..Name but it gives error.



Hello Dan,

If you use it in the initialization code of the opening window you use

MySelf..Name or MySelf..Alias


von DW - am 23.11.2017 15:52
You cant get the windows alias before it exists. Maybe WinStatus() helps you to check if the window is open or not. If opened then you can get the alias otherwise not.

von Markus K. - am 23.11.2017 17:07
Hi Marcus,

not as far as I know... you need to use "Win_MyWindow" when it's not open yet.

Best regards

von Fabrice Harari - am 23.11.2017 17:59
Hello Dann

Can you explain the circumstances as to why you need to know the name of the unopened window as that may help with a solution.


von Al - am 23.11.2017 18:14
@ Fabrice,
afaik the alias can only be allocated when you open the window. How else should the runtime "knows" how many windows are opened?
Have a look at the mdi tab: Open a tab and the internal window/the tab "gets" his alias. If you dont open the window the window doesnt get a place in the memory and so also no alias.


von Markus K. - am 24.11.2017 00:40
My intention is to manage a big menu with differents categories of windows, every category is included in a component.
Everytime you choose a category a Looper control of buttons is erased and filled by the buttons that will open the windows.
I manage all this stuff with a associative array of strings including the name of the windows.

My problem is that when i change the name of a window in one of my components, the menu doesn't give me a warning, because the name of that window is in a string ("WIN_MyWindow") and not retrieved by a property of the window (WIN_MyWindow..Name).

I'd like not to change the structure of the menu with associative array, I just want to know if it's possible to have the name of a window before that is opened.


von DannHCS - am 24.11.2017 08:06
When i understand you correctly, you have hardcoded the names of your windows into an array. Then you could use the directory in which the windows are located. At the start of your program check the validity of the window names in the array so you get informed when you forgot to rename a windows name.

von Markus K. - am 24.11.2017 09:18

it is possible to get the name even if the window is not open. But only the name as it has in the project, which is your name and may not be a user friendly name. Indeed while a window is not open you you cannot access it to get the Caption or Width or whatever property.

// Enumerate the windows of a project
WindowName is string = EnumElement(enumWindow)
// Browse all the windows
WHILE WindowName ""
// Go to the next window
WindowName = EnumElement()

When I think about this you could Open() all windows with the code above and when you "detect" in the opening-section of the window that it is opened in this special mode (i.e. setting a global boolean), you can Close() it right away. At that point there is no visible action to the end-user, but you have the ability to get some extra window-info before closing it!

von Arie - am 24.11.2017 09:44
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.