Is it possible to send stayontop to another program using FindWindow and that?
It's a game, and I play it in windowed mode and I dont like when it gets minimized when clicking outside of the window.
It has no -stayontop parameter or anything like that.
I don't think that you can set another application to permanently stay on top (someone correct me if I am wrong).
You can set a window to be the top most window by using SetForegroundWindow. What you need to do is find the Handle of the Window then use SetForegroundWindow to make this window on top again.
Code:
procedure FocusWindow(WindowName : String)
var
hWnd: DWORD;
begin
hWnd := FindWindow(nil, PChar(WindowName));
if hWnd <> 0 then
begin
ShowWindow(hwnd, 1);
SetForegroundWindow(hWnd);
SetFocus(hWnd);
end;
end;
Oh nice!
This will work great.
Just hoping a 1ms timer wont overload my system. Hehe
Oh, and SetFocus(hWnd); must be changed to just SetFocus;
or else it complains about too many actual parameters
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.