Global Floating Windows does not work under Windows (v10) as intended

My application starts with a small window in which you click a radio button to control whether the “wdwMain” window or the “wdwMainOpt” window should be started after you have pressed a start button (the start window closes when you press the start button). “wdwMain” has set “Document” as the window type. “wdwMainOpt” is an exact copy of “wdwMain” but with the difference that “Global Floating Window” is set as the window type. Under macOS the app behaves as intended: depending on what is set in the radio button, one or the other window is displayed and you can work with it. In Windows (v10) only the “wdwMain” (Document) works. The “wdwMainOpt” (Global Floating Window) is only displayed for a fraction of a second (actually you only see a frame for a very short time) and then disappears. I have no idea what is going wrong and how to fix the obvious error.

[code]if rbtWindowType(0).value = true then
wdwMain.show // window type “Document”
else
wdwMainOpt.show // exact copy of wdwMain, but window type “Global Floating Window”
end if

wdwLaunch.close[/code]

Also setting “Implicit Instance” of the two windows to false and changing code to this does not work in Windows:

[code]if rbtWindowType(0).value = true then

dim wdwMain as new wdwMain
wdwMain.show

else

dim wdwMainOpt as new wdwMainOpt
wdwMainOpt.show

end if

wdwLaunch.close[/code]

Thanks,
Gerson Nerger

What happens if you do not close wdwLaunch?

[code]if rbtWindowType(0).value then
wdwMain.show
else
wdwMainOpt.show
end if

//wdwLaunch.close[/code]

At least, if the floating window does not disappear, one may assume that wdwLaunch was closing it.

If I don’t close wdwLaunch wdwMainOpt shows as it should. But why?

Since you say that under macOS it works all right, and since at present I don’t have a PC machine at hand to make a test, I cannot venture any answer.

Nevertheless, I’d check and see if by chance for #target windows the app.autoquit is turned on and wdwLaunch is set as the default window in App.

I hope somebody with more knowledge may pop up and give you a satisfactory answer.

Meantime you could try closing wdwLaunch from inside the global window (… if window(i) isa wdwLaunch then…).
Or, if possible, to change wdwLaunch.close into wdwLaunch.hide.

wdwLaunch was set as the default window. I switched it to none and also used wdwLaunch.hide. Now it works as wanted in Windows.

On Windows set App.AutoQuit = false if use API 1 in the App.Open event. It‘s App.AllowAutoQuit with API 2.