Current Window Name?

Is there a function to get the name of the current window similar to the CurrentMethodName function?

Would save me quite a bit of code changing when I log actions.

You can get a reference to any open windows using the Window method. Window(0) is the front-most window. Then you can grab the .title of the Window.

E.g. Window(0).title

https://documentation.xojo.com/index.php/Window_Method

Use introspection:

[code]Public Function getWindowName(Extends theWindow as Window) as String

'returns the name of a Window

Dim theTypeInfo as Introspection.TypeInfo = Introspection.GetType(theWindow)
Return theTypeInfo.Name

End Function[/code]

Thanks Beatrix… This is EXACTLY what I was looking for.

The app I’m working on stores the last window visited by the used in the database so that when the same user reopens the app, it goes to the window he was last using. This prevents me from having to change the code in the open of every window, the same line of code works.

thanks again

make one window subclass, and only fill one open event, that’s what oop is for ?