Notifications
Clear all
[Closed] closing duplicate .net windows
Feb 17, 2014 11:32 pm
I have a button that opens a dotnet material browser window. I’d like to know how to close it when I open another such window, as in ‘destroydialog’ in MXS…I’ve had look at howproperties and showevents but can’t seem to locate the right code…Is it form auto invalidate.?..Any help appreciated.
4 Replies
2 Replies
Feb 17, 2014 11:32 pm
I don’t want to have cluttered windows. I want to have one only at a time, as any more is untidy and messy, …that’s all. It’s just about user friendliness. I don’t want the user to have to manually close a lot of unnecessary windows, that’s all.
Feb 17, 2014 11:32 pm
I use this, which searches the open ui’s in max for a given window name.
fn getWindowHandleByWindowText windowText =(
local ret = #()
for i in (windows.getChildrenHWND 0P) do(
if windowText == (UIAccessor.GetWindowText i[1]) then(
append ret i[1]
)
)
return ret
),-- getWindowHandleByWindowText "Window Name"
fn closeWindowHandleByWindowText windowText =(
local allPtrs = this.getWindowHandleByWindowText windowText
for i in allPtrs do (
UIAccessor.CloseDialog i
)
),-- closeWindowHandleByWindowText "Window Name"
You need to name your dot net window/form.
Hope that helps.