[SOLVED] Window foreground but not foreground?

Just starting out? Need help? Post your questions and find answers here.
Randy Walker
Addict
Addict
Posts: 1059
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

[SOLVED] Window foreground but not foreground?

Post by Randy Walker »

Anybody know if/how a Window could be made to be in foreground on top of window that is actually the foreground? Not looking for transparency. Just want to make one app window overlay on top of the app window that is truly operating as the foreground window without it taking focus away from that foreground window. Hope that makes sense.
Last edited by Randy Walker on Sat Jun 14, 2025 3:07 am, edited 1 time in total.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
BarryG
Addict
Addict
Posts: 4168
Joined: Thu Apr 18, 2019 8:17 am

Re: Window foreground but not foreground?

Post by BarryG »

Your app's own windows? It's the StickyWindow() command.
Randy Walker
Addict
Addict
Posts: 1059
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: Window foreground but not foreground?

Post by Randy Walker »

BarryG wrote: Fri Jun 13, 2025 8:37 am Your app's own windows? It's the StickyWindow() command.
WOW!! Fast reply. But these are two separate PB apps. Is that still possible?
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
BarryG
Addict
Addict
Posts: 4168
Joined: Thu Apr 18, 2019 8:17 am

Re: Window foreground but not foreground?

Post by BarryG »

For Windows:

Code: Select all

SetWindowPos_(hWnd,#HWND_TOPMOST,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE)
hWnd = Handle of the external window, obtained with things like FindWindow_() or GetForegroundWindow_().
Randy Walker
Addict
Addict
Posts: 1059
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: Window foreground but not foreground?

Post by Randy Walker »

Randy Walker wrote: Fri Jun 13, 2025 8:46 am
BarryG wrote: Fri Jun 13, 2025 8:37 am Your app's own windows? It's the StickyWindow() command.
WOW!! Fast reply. But these are two separate PB apps. Is that still possible?
Yes it looks like it should do the trick. Will mark this [Solved] if it does work out for me.
BIG THANKS!!! BarryG
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Randy Walker
Addict
Addict
Posts: 1059
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: Window foreground but not foreground?

Post by Randy Walker »

BarryG wrote: Fri Jun 13, 2025 8:37 am Your app's own windows? It's the StickyWindow() command.
Yes both apps are my own PB apps/windows.
StickyWindow() was the perfect solution.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Randy Walker
Addict
Addict
Posts: 1059
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: Window foreground but not foreground?

Post by Randy Walker »

BarryG wrote: Fri Jun 13, 2025 8:50 am For Windows:

Code: Select all

SetWindowPos_(hWnd,#HWND_TOPMOST,0,0,0,0,#SWP_NOMOVE|#SWP_NOSIZE)
hWnd = Handle of the external window, obtained with things like FindWindow_() or GetForegroundWindow_().
Not applicable in my case but it's a good post. Thanks, anyway. You always go above and beyond.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Post Reply