Jump to content

Ian Branch

Members
  • Content Count

    1274
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Ian Branch

  1. Ian Branch

    PopMenu two levels down..

    Hi Uwe, VCL, Win 32. I'll see about a small demo. Ian
  2. Ian Branch

    PopMenu two levels down..

    Hi Attila, That's one interpretation. Or, it could mean that it is the only environment I am working in and have experienced the problem and that I can make the issue happen at will in my working environment. ;-) Ian
  3. Hi Team, I need to detect if my delphi (10.3.2) app is running in a remote RDP session. I want to do the detection in the Project file so I can disable the Theme. e.g. Application.Initialize; Application.MainFormOnTaskbar := True; if not IsRemoteSession then TStyleManager.TrySetStyle('Iceberg Classico'); Thoughts/suggestions appreciated. Regards & TIA, Ian
  4. Ian Branch

    Detect if running in a remote session..

    All, Thank you for your input. Much appreciated. It is now working as desired. Regards & Tks again. Ian
  5. Ian Branch

    Detect if running in a remote session..

    Hi Anders, Thank you for your suggestion. So, this is my implementation.. program LogViewer; uses Vcl.Controls, Vcl.Forms, Vcl.Themes, Vcl.Styles, System.SysUtils, MainFrm in 'MainFrm.pas' {MainForm}; {$R *.res} function DetectRemoteSession: boolean; const SM_REMOTECONTROL = $2001; // This system metric is used in a Terminal // Services environment. Its value is nonzero // if the current session is remotely // controlled; otherwise, 0. SM_REMOTESESSION = $1000; // This system metric is used in a Terminal // Services environment. If the calling process // is associated with a Terminal Services // client session, the return value is nonzero. // If the calling process is associated with // the Terminal Server console session, the // return value is 0. The console session is // not necessarily the physical console. var Mode: string; begin Result := (GetSystemMetrics(SM_REMOTESESSION) <> 0) or (GetSystemMetrics(SM_REMOTECONTROL) <> 0); // Test for emulated local/remote mode if (FindCmdLineSwitchEx('Session', Mode, ['-','\','/'], True)) then begin if (SameText(Mode, 'Remote')) then Result := True else if (SameText(Mode, 'Local')) then Result := False; end; end; begin // Application.Initialize; Application.MainFormOnTaskbar := True; if not DetectRemoteSession then TStyleManager.TrySetStyle('Iceberg Classico'); Application.CreateForm(TMainForm, MainForm); Application.Run; // end. Unfortunately, despite having vcl.controls in the uses, getsystemmetrics is still not recognised. :-( Nor does it know anything about FindCmdLineSwitchEx Thoughts/Suggestions? Regards, Ian
  6. Ian Branch

    Detect if running in a remote session..

    Hi Fred, Thanks for your suggestion.. Yes I have seen that and have tried a couple of things but none seem to work from the project file for one reason or another. Ian
  7. Ian Branch

    Check what Patches I have installed, or not?

    Darian, It was that list that prompted the question. I am sure I have installed at least 3 of them but I am not sure and I probably didn't install them if they seemed to be specific to C++, however I note in David's article that they should be installed anyway. Is it safe to reinstall them again from the start even if they have already been installed? I infer from David's article that it may not. Ian
  8. Ian Branch

    TJvLoginDialog usage??

    Hi Guys, in particular JVCL Gurus, I am playing with the JvLoginDialog. It runs immediately the App is started and seemingly before the application's Form is created. I want to use it to verify the log in details of a user from a database table. Unfortunately the database bits are on the Form, engine, session, connection, table, and as a result they are not seen when the component's OnCheckUser event fires. :-( Naturally I can't find any documented Help for the component. Can anybody advise how to achieve what I am trying to do or can't I? Regards & TIA, Ian
  9. Ian Branch

    TJvLoginDialog usage??

    Hi RVK, Ahh. I see. And I have determined that setting 'AllowLogin' in the CheckUser procedure to false is what to manage the count. I think I have all that I need now. Tks. Regards, Ian
  10. Ian Branch

    TJvLoginDialog usage??

    Ahh Excellent. Tks RVK. Is there a mechanism to use the AttemptNumber is it just a place holder? Regards & Tks, Ian
  11. Hi Team, Given the following call - TCurrentCustJobsForm.Create(Nil).ShowModal; Can this be made to return a value? e.g. iRecord := TCurrentCustJobsForm.Create(Nil).ShowModal; I figure if it will work I will have to set & return it somehow in the CurrentCustJobsForm. Just hoping. Regards, Ian
  12. Ian Branch

    Call to create a form to return a value?

    "The Tool Wiz" eh? K. I have downloaded it and will review. Thank you. Regards, Ian
  13. Ian Branch

    GExperts Replace Components..

    So, is it a bug or their re-design and that is the way it is? I for one would really appreciate an alternative as I am constantly trying different components to get the best result. Regards, Ian
  14. Ian Branch

    Call to create a form to return a value?

    Hi David, Interesting. I would have a look at your session but the web page says "We're just moving in. Please visit us again soon" Ian
  15. Ian Branch

    GExperts Replace Components..

    Ahh. Apologies. Didn't think to look at/for the Blog post. :-( I have voted for it but with only two votes att I don't see it getting much traction/attention. :-( I also posed the question about disabling the option. I later realised that it is still valid for many other components. Apologies for any inconvenience, Ian
  16. Ian Branch

    GExperts 1.3.14 released

    Nope. Not to worry. Not critical att. :-) FYI - This is the first set of errors. D:\GExperts\source\Utils\GX_IdeUtils.pas(579): error E2003: Undeclared identifier: 'TContainedAction' [D:\GExperts\Projects\DelphiXx103\GExpertsRS103.dproj] D:\GExperts\source\Utils\GX_IdeUtils.pas(581): error E2033: Types of actual and formal var parameters must be identical [D:\GExperts\Projects\DelphiXx103\GExpertsRS103.dproj] D:\GExperts\source\Utils\GX_IdeUtils.pas(582): error E2015: Operator not applicable to this operand type [D:\GExperts\Projects\DelphiXx103\GExpertsRS103.dproj] D:\GExperts\source\Utils\GX_IdeUtils.pas(583): error E2015: Operator not applicable to this operand type [D:\GExperts\Projects\DelphiXx103\GExpertsRS103.dproj] D:\GExperts\source\Utils\GX_IdeUtils.pas(584): error E2015: Operator not applicable to this operand type [D:\GExperts\Projects\DelphiXx103\GExpertsRS103.dproj] D:\GExperts\source\Utils\GX_IdeUtils.pas(584): error E2035: Not enough actual parameters [D:\GExperts\Projects\DelphiXx103\GExpertsRS103.dproj] D:\GExperts\source\Utils\GX_IdeUtils.pas(590): error E2003: Undeclared identifier: 'TContainedAction' [D:\GExperts\Projects\DelphiXx103\GExpertsRS103.dproj] D:\GExperts\source\Utils\GX_IdeUtils.pas(597): error E2033: Types of actual and formal var parameters must be identical [D:\GExperts\Projects\DelphiXx103\GExpertsRS103.dproj] D:\GExperts\source\Utils\GX_IdeUtils.pas(598): error E2066: Missing operator or semicolon [D:\GExperts\Projects\DelphiXx103\GExpertsRS103.dproj] D:\GExperts\source\Utils\GX_IdeUtils.pas(598): error E2035: Not enough actual parameters [D:\GExperts\Projects\DelphiXx103\GExpertsRS103.dproj] D:\GExperts\source\framework\GX_EditorFormServices.pas(270): error F2063: Could not compile used unit 'GX_IdeUtils.pas' [D:\GExperts\Projects\DelphiXx103\GExpertsRS103.dproj] Done Building Project "D:\GExperts\Projects\DelphiXx103\GExpertsRS103.dproj" (rebuild target(s)) -- FAILED. Ian
  17. Ian Branch

    GExperts 1.3.14 released

    FYI - I use D2007 & D10.3.2. Periodically I download via svn the latest trunk for GExperts. The current download will not build for D10.3.2. No biggie. Just FYI. Ian
  18. Ian Branch

    Call to create a form to return a value?

    Hi Schokohase, Ahhh. I see what you have done. It is in fact where I started before opening this thread and looking for an alternative for the return of a variable. I use this technique a lot. Thank you for your input. Hi Dany, Yes you are quite correct and I do read and play around a hell of a lot but sometimes my patience wears thin. ;-) Regards to both, Ian
  19. Ian Branch

    Call to create a form to return a value?

    OK. I sorta follow the theory but I don't see how I can make Form11 see the TCustomer from Form10.
  20. Ian Branch

    Call to create a form to return a value?

    Hi Schokohase, Here you go.. unit Unit10; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TForm10 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; type TCustomer = record name: string[30]; age: byte; end; var Form10: TForm10; customer: TCustomer; implementation uses Unit11; {$R *.dfm} procedure TForm10.Button1Click(Sender: TObject); begin if TForm11.Execute(customer) then begin MessageDlg('customer.Name = ' + customer.name, mtInformation, [mbOK], 0); MessageDlg('customer.Age = ' + IntToStr(customer.age), mtInformation, [mbOK], 0); end; end; end. unit Unit11; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TCustomer = record name: string[30]; age: byte; end; //var // customer: TCustomer; type TForm11 = class(TForm) Button1: TButton; Edit1: TEdit; Edit2: TEdit; private { Private declarations } public { Public declarations } class function Execute(out Value: TCustomer): Boolean; end; var Form11: TForm11; implementation {$R *.dfm} class function TForm11.Execute(out Value: TCustomer): Boolean; var F: TForm11; begin F := TForm11.Create(nil); try Result := IsPositiveResult(F.ShowModal); if Result then begin Value.name := F.Edit1.Text; Value.age := StrToInt(F.Edit2.Text); end; finally F.Free; end; end; end. Unit10 calls unit11. Ian
  21. Ian Branch

    Call to create a form to return a value?

    Hi Alexander, Appreciate your patience here. So, even though I had the var customer: TCustomer; in the called form, F.customer still wasn't recognised. OK. So be it. OK. So now I have the individual values being set per above, the compiler likes the called unit but the called unit bombs out compiling if TForm11.Execute(customer) then saying var parameters must be identical. My first thought was that I needed to change it to if TForm11.Execute(Tcustomer) then but this bombs with '(' expected but ')' found. I am happy to pursue this but I don't want to tie up your time. Ian
  22. Ian Branch

    Call to create a form to return a value?

    Hi Alexander, Well. That cleared the function error, but now it doesn't like F.customer. Undeclared identifier. Ian
  23. Ian Branch

    Call to create a form to return a value?

    Hi Schokohase, In my ignorance of what can and can't be done in in this area - No.
  24. Ian Branch

    Call to create a form to return a value?

    So. I thought I would be sneaky and pass a record so I could retrieve several values. Well that didn't work. 😞 In the donor form when I try to compile it I get the error.. [dcc32 Error] Unit11.pas(19): E2029 Identifier expected but 'RECORD' found here.. { Private declarations } public { Public declarations } class function Execute(out Value: record): Boolean; <<<< Error here. end; type TCustomer = record name: string[30]; age: byte; end; var Form11: TForm11; customer: TCustomer; implementation {$R *.dfm} class function TForm11.Execute(out Value: record): Boolean; var F: TForm11; begin F := TForm11.Create(nil); try Result := IsPositiveResult(F.ShowModal); if Result then Value := F.customer; finally F.Free; end; end; Being called from the caller form by.. type TCustomer = record name: string[30]; age: byte; end; var Form10: TForm10; customer: TCustomer; implementation uses Unit11; {$R *.dfm} procedure TForm10.Button1Click(Sender: TObject); begin if TForm11.Execute(customer) then begin MessageDlg('customer.Name = ' + customer.name, mtInformation, [mbOK], 0); MessageDlg('customer.Age = ' + IntToStr(customer.age), mtInformation, [mbOK], 0); end; end; Oh well, it was worth a try. 🙂 Ian
  25. Ian Branch

    Call to create a form to return a value?

    Duly noted and amended. Tks again Alexander. Ian
×