Use Delphi TMsRdpClient9NotSafeForScripting minimizing remoteapp after more than 10 seconds, the session will automatically disconnect

163 views Asked by At

Use Delphi TMsRdpClient9NotSafeForScripting minimizing remoteapp after more than 10 seconds, the session will automatically disconnect

Environment: Client: Windows 10 Server: winserver 2008 R2

var
rdp: TMsRdpClient9NotSafeForScripting;
begin
rdp.AdvancedSettings9.RDPPort := 3389;
rdp.ControlInterface.UserName := 'username';
rdp.AdvancedSettings9.ClearTextPassword := 'password';
rdp.SecuredSettings2.KeyboardHookMode := 1;
rdp.DesktopWidth := Screen.Width;
rdp.DesktopHeight := Screen.Height;
rdp.RemoteProgram.RemoteProgramMode := True; //Enable the remoteapp mode
rdp.Connect;
end

//Connected Event start StartProgram
procedure rdpConnected(Sender: TObject);
begin
rdp.RemoteProgram.ServerStartProgram('D:\project1.exe','','D:\',False,'',False);
end;

Symptom: After minimizing (click the Minimize button or click the taskbar icon), the remote session is automatically disconnected more than 10 seconds after minimizing the program. I tried setting the session time limit to “never on ” the group policy on the server, which didn't solve the problem. The following related Settings are set. https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2008-R2-and-2008/cc753112(v=ws.10)?red irectedfrom=MSDN

and the client regedit has set RemoteDesktop_SuppressWhenMinimized Minimization will still break.

If anyone has the same problem as me?

client set regedit

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Wow6432Node\Microsoft\Terminal Server Client]
"RemoteDesktop_SuppressWhenMinimized"=dword:2

[HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client]
"RemoteDesktop_SuppressWhenMinimized"=dword:2


[HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client]
"RemoteDesktop_SuppressWhenMinimized"=dword:2


[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Terminal Server Client]
"RemoteDesktop_SuppressWhenMinimized"=dword:2


[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Terminal Server Client]
"RemoteDesktop_SuppressWhenMinimized"=dword:2


[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services]
"MaxIdleTime"=dword:00000000
"KeepAliveEnable"=dword:00000001
"KeepAliveInterval"=dword:00002710
"fResetBroken"=dword:00000000

Using sendkeys regularly after minimization also won't keep the connection

0

There are 0 answers