[quote=189572:@Lennox Jacob]Thanks Michel,
I haven’t tried it as yet, but reading the code it appears that the window will always be topmost. I will try that code and see what happens…
What I was hoping for was that if the window is behind another window, e.g. I have myAppWindow in front then I open another app e.g. Internet Explorer, then Internet Explorer will open a window in front of myAppWindow.
I now forgot that I have myAppWindow opened, but it is in the background, completely hidden by Internet Explorer, and I now try to open myApp.
I already have a mutex to prevent myApp from creating a new window, so the message indicating same is show.
When I dismiss that msgbox, I would like myAppWindow to now be topmost.
Kem’s code above does that on Mac.
That code does not make the window global floating, it just brings it to front when you run it. If any other app is run afterward or another window is displayed by the app, it works as usual.
Place the code in the place where you need it to bring the window to front. In what you describe, that would be after the MsgBox.
I placed it in a 10 seconds timer Action, it does bring the window to the front from behind. It does not activate it, though. You may need some additional code for that.
[code] dim l,t,h,w as int32
l = self.left
Declare Function SetWindowPos Lib “user32” (ByVal hwnd As Int32, ByVal hWndInsertAfter As Int32, ByVal x As Int32, ByVal y As Int32, ByVal cx As Int32, ByVal cy As Int32, ByVal uFlags As Int32) As Int32
const HWND_BOTTOM = 1
const HWND_NOTOPMOST = -2
const HWND_TOP = 0
const HWND_TOPMOST = -1
call SetWindowPos(Self.Handle, HWND_TOPMOST, l, t,w,h,0)[/code]