WinSetAlwaysOnTop not working
Issue #23
closed
Working AHK code:
MyGui := Gui(, "KEYSHARP TESTS")
WinSetAlwaysOnTop(1, MyGui)
MyEdit := MyGui.Add("Edit", "w400 h400")
MyGui.Show()
Truncated error message from Keysharp:
Uncaught exception:
Message: Unable to cast object of type 'Keysharp.Core.Gui' to type 'System.IConvertible'.
Stack: at System.Convert.ToInt32(Object value)
Comments (6)
-
reporter -
reporter Working code, thanks for the tip. This is another difference between AHK and Keysharp, please mark resolved and close.
A_DetectHiddenWindows := True ; Necessary in Keysharp MyGui := Gui(, "KEYSHARP TESTS") WinSetAlwaysOnTop(1, MyGui) MyEdit := MyGui.Add("Edit", "w400 h400") MyGui.Show()
-
reporter To avoid having to use A_DetectHiddenWindows := True, code like that shown below works.
MyGui := Gui(, "KEYSHARP TESTS") MyGui.Opt("+AlwaysOnTop") MyEdit := MyGui.Add("Edit", "w400 h400") MyGui.Show()
-
reporter Please mark as resolved and closed, unless you feel the remaining minor issue needs addressing. Thanks!
-
repo owner - changed status to resolved
-
repo owner - changed status to closed
- Log in to comment
Workaround using DllCall:
This sets the GUI always on top.