Jump to content

PeterPanettone

Members
  • Content Count

    1233
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by PeterPanettone


  1. On 2/26/2024 at 2:32 AM, Remy Lebeau said:

    However, there can only be 1 menu active at a time, so you should be able to use FindWindow/Ex() to find the HWND of the active menu whose window class name is "#32768"/MAKEINTATOM(0x8000),

     

    Once you have the menu's HWND, you should be able to use GetWindowRect() to get its position and size.

    Thank you very much; I am now able to find the menu rectangle:

    function PAGetDisplayedMenuRectangle: TRect;
    var
      MenuWnd: HWND;
    begin
      // Initialize the result rectangle to zero
      FillChar(Result, SizeOf(Result), 0);
    
      // Find the window handle of the active menu
      MenuWnd := FindWindowEx(0, 0, MAKEINTATOM($8000), nil);
      if MenuWnd <> 0 then
      begin
        // If the menu window is found, get its rectangle
        if not GetWindowRect(MenuWnd, Result) then
        begin
          // If GetWindowRect fails, reset the result to zero
          FillChar(Result, SizeOf(Result), 0);
        end;
      end;
    end;

     


  2. I am trying to encapsulate the TaskDialog properties, its execution, and its result in a single unit:

    unit MyTaskDialogDNSAExpandable;
    
    interface
    
    uses
      Vcl.Dialogs, Winapi.Windows, Vcl.Controls;
    
    type
      TDialogResultWithDNSA = record
        ModalResult: Integer;
        DoNotShowAgain: Boolean;
      end;
    
    function ShowTaskDialogWithDNSAAndInfoText(const ATitle, AContent, ADNSACaption, AInfoText: string): TDialogResultWithDNSA;
    
    implementation
    
    function ShowTaskDialogWithDNSAAndInfoText(const ATitle, AContent, ADNSACaption, AInfoText: string): TDialogResultWithDNSA;
    var
      TaskDialog: TTaskDialog;
    begin
      TaskDialog := TTaskDialog.Create(nil);
      try
        TaskDialog.Caption := ATitle;
        TaskDialog.Text := AContent;
        TaskDialog.CommonButtons := [tcbOk, tcbCancel];
        TaskDialog.VerificationText := ADNSACaption;
        TaskDialog.ExpandedText := AInfoText;
        TaskDialog.Flags := [tfUseCommandLinks, tfAllowDialogCancellation, tfExpandFooterArea];
    
        // Execute the task dialog
        if TaskDialog.Execute then
        begin
          Result.ModalResult := TaskDialog.ModalResult;
          Result.DoNotShowAgain := ??? // how can I get the DoNotShowAgain state of the TaskDialog
        end
        else
        begin
          Result.ModalResult := mrCancel;
          Result.DoNotShowAgain := False;
        end;
      finally
        TaskDialog.Free;
      end;
    end;
    
    end.

     

    But how can I get the DoNotShowAgain state of the TaskDialog in Delphi 12?


  3. 7 hours ago, dummzeuch said:

    I have some experience with the "quality" of AI generated code as well as answers to some basic queries. I certainly don't want it to mess with my code without close supervision.

    And no, I don't believe what we currently have deserves the name artificial intelligence.

    Low-quality AI answers often are the result of poor prompts. However, I agree with the last statement.


  4. 14 minutes ago, Fred Ahrens said:

    e.g. refactoring

    The best refactoring feature for Delphi I have found so far is in MMX

     

    But new refactoring tools could certainly implement even better and smarter refactoring features, e.g.:


    1. Search the entire project for identical or similar code fragments and automatically replace them with a common procedure.


    2. Automatically insert selected code into a (new) class.


    Etc.


  5. 22 minutes ago, FredS said:

     

    I always use RegEdit, check out: HKEY_CURRENT_USER\SOFTWARE\Embarcadero\BDS\23.0\Experts

    Yes, it could be done in RegEdit. However, I find it more comfortable to do it in one of the tools mentioned by Thomas: GExperts expert manager or Expert and Package Manager for multiple RAD Studio IDEs from David Hoyle.

     

    This is the entry in the Registry:

     

    image.thumb.png.3fcad9836e1967d30a273efa8a4ab1ef.png 


  6. David Hoyle has made a 3rd Party IDE Help Delphi plugin:

     

    https://github.com/DGH2112/3rd-Party-IDE-Help

     

    The Readme says: "This is a RAD Studio wizard/expert/plug-in that allows you to easily configure 3rd-party HTML files for use with the IDE to get context-sensitive help for 3rd party code. It also provides quick access to these files."

     

    The ReadMe also says: "To configure the 3rd party help, open the IDE's Options dialogue and look under the 3rd Party node for an options page entitled "3rd Party Help"."

     

    I have compiled the project in Delphi 12, and it created TPIDEHelpRS120.dll. I copied TPIDEHelpRS120.dll to C:\Program Files (x86)\Embarcadero\Studio\23.0\bin\ and restarted the Delphi 12 IDE.

    However, this 3rd Party node cannot be found in the Delphi 12 IDE Options:

     

    image.png.aa1c5993783cc123a3d46d3bd4a8e4b6.png 

     

    How do you install this plugin in Delphi 12?


  7. 9 minutes ago, DelphiUdIT said:

    To me all is working right, and the image that you send is the same for me.

     

    I don't know if patch 1 is needed to use the "new" getit (I use it with patch 1 installed and all works fine).

     

    I, too, have tried the GetIt installation with Patch 1. Same error as before.

×