[cvsnt] cvsagent: Always stay on top - persistent?

Tony Hoyle tony.hoyle at march-hare.com
Tue Mar 21 12:51:05 GMT 2006


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


Bo Berglund wrote:
> This is code snippets we needed to add to our program (Visual Basic, I
> have the Delphi version as well) when MS decided that pop-up is bad.
> We needed our dialogs to come out on top so the user could see them...
> 
> It is a user level system setting so each user needs to set the value.
> Basically the timeout set determines the time from last keyboard entry
> until it is OK to pop a window on top.

Hmm interesting.  Apparently it also works to set that value to 0, 
display the popup and change it back again.

I also found this which sounds cleaner than changing a global parameter:

function ForceForegroundWindow(hWnd: THandle): BOOL;
var
   hCurWnd: THandle;
begin
   hCurWnd := GetForegroundWindow;
   AttachThreadInput(
     GetWindowThreadProcessId(hCurWnd, nil),
     GetCurrentThreadId, True);
   Result := SetForegroundWindow(hWnd);
   AttachThreadInput(
     GetWindowThreadProcessId(hCurWnd, nil),
     GetCurrentThreadId, False);
end;

None of this is tested of course..

Tony



More information about the cvsnt mailing list
Download the latest CVSNT, TortosieCVS, WinCVS etc. for Windows 8 etc.
@CVSNT on Twitter   CVSNT on Facebook