as the subject says I'm trying to connect to the server using this code in delphi
procedure TmainF.Button1Click(Sender: TObject); var rdp1 : TMsRdpClient7NotSafeForScripting ; begin rdp1 := TMsRdpClient7NotSafeForScripting.Create(self); rdp1.Parent := mainF; rdp1.Server:=server_name; rdp1.UserName := user.Text; rdp1.AdvancedSettings7.ClearTextPassword := password.Text; rdp1.ConnectingText := 'connecting'; rdp1.DisconnectedText := 'disconnected'; rdp1.AdvancedSettings7.AuthenticationLevel:=0; rdp1.AdvancedSettings7.EnableCredSspSupport:=true; rdp1.Connect; end;
the code works fine, but if the user entered an incorrect username or password
the rdp object displays a remote desktop prompt for re-entering a username or password, such as an image

I want to check the username and password before connecting or deny this field and show the user message from my application
I tried using OnLogonError (), but it did not run any code
and I read this Question , but the code is C # and I got confused with .getocx () and I can not find (PromptForCredentials) in (MSTSCLib_TLB.pas)
any help :( ??
Sorry for my bad english.
source share