This code is part of «VDF GUIdance»
Visit us @ http://www.vdf-guidance.com
e-Mail us @ info@vdf-guidance.com
Prevent Status Panels losing the focus
Author: Geoff Furlong
Ever wondered how to make VDF panels "stay on top"?
Try the following code in you panel/dialog/etc Activating procedures
// To make the status_panel stay-on-top, we first find it's window handle ...
Move (FindWindow("DFDialogClass", Caption_Text(Self))) To hWnd#
// ... then we add the extended style WS_EX_TOPMOST to the window, but we use
SetWindowPos
// to make sure the change takes effect immediately.
Move (SetWindowPos(hWnd#, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE ior SWP_NOSIZE)) To swp#
I've used this to make the BPO status panel stay where it should and not disappear if the VDF app loses the focus.
With a little change to the above the status panel will also support special
characters. This way it will also work in programs that are written for non-english
languages.
replace the line
Move (FindWindow("DFDialogClass", Caption_Text(Self))) To hWnd#
with
Move (FindWindow("DFDialogClass",ToAnsi(Caption_Text(Self)))) to hWnd#