Jump to content

PeterPanettone

Members
  • Content Count

    1233
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by PeterPanettone


  1. When I show a menu in Windows Notepad, this code gets me the handle of that menu window:

    MenuWnd := FindWindowEx(0, 0, MAKEINTATOM($8000), nil);

      (which allows me to make a screenshot from that menu), for example:

     

    image.png.02cea8d88c0e4992a422f7e39c94891c.png

     

    But when I show a menu in the Delphi Code Editor, MenuWnd is 0!

     

    Does anybody know how I can get the handle of the menu window from the Delphi code editor or in other similar cases?


  2. On 4/8/2024 at 1:11 AM, Brian Evans said:

    Looks fine: the top of the hint window is below line of text it is providing a hint for. 

    Broken: The bottom of hint the window is where it's top used to be. This causes it to appear on top of the line of text it is providing a hint for. 

     

    You could use a free screenshot tool - there are many available.


  3. 9 minutes ago, Brian Evans said:

    Tested with Delphi 11.3 and it looks fine there. Don't have Delphi 12 installed to test with, just Delphi 12.1 and is broken in that release. 

    Hi Brian, thanks for testing. Can you please be more specific?

     

    1. In Delphi 11.3, how does it "look fine"? Do you mean the caret is also hidden by the Hint in Delphi 11.3? Or do you mean the caret is not hidden by the Hint in Delphi 11.3?

     

    2. In Delphi 12.1, what do you mean by "is broken"?


  4. In the Code Editor, when typing 'if' followed by a space character, a Hint hides the caret position:

     

    image.png.2d8b25f80311866720d9045cf6cf4c56.png

     

    ...so I cannot see the caret anymore and cannot see what I am typing. I am forced to press the ESC key to hide the hint, which is a completely pointless waste of time.

     

    Can anyone confirm this?

     

    This has been bothering me for a while now.

     

    Isn't there a way to suppress this hint (or show it at a different position) when writing an 'if' statement?


  5. 2 minutes ago, PeterBelow said:

    Windows has a lot of these little inconsistencies that have accumulated over time by bolting more functionality on existing control classes.

    You are right - one should write a book about this topic.


  6. 23 hours ago, Lajos Juhász said:

    When WordWrap is true, text that is too wide for the control wraps at the right margin.

    This is not concisely logical, as it should word-wrap the Caption when the "text is too wide for the control" AND NOT PREVENT the word-wrap when it is already Multi-Line (if WordWrap = False).

     

    And, from a purely practical point of view, what sense would it make to explicitly truncate the text if it's too large for the control? Wouldn't it rather be more practical to automatically word-wrap the Caption when the text is too large for the control?


  7. When I try to get the list of all file extensions from the Registry associated with a specific application (double-clicking on the file opens the application), I encounter a complex, almost impenetrable maze of multiple, countless references and back-references that seems almost impossible to resolve.

     

    It would be helpful if there were a "magical" function like GetListOfAssociatedFileExtensions('notepad.exe', 'open');

     

    Is there a known solution to this problem?

     

    For a test, I've started by enumerating all file-extension subkeys in the Registry:
     

    function EnumerateFileExtensions: TStringList;
    var
      reg: TRegistry;
      subkeys: TStringList;
      i: Integer;
      key: string;
    begin
      Result := TStringList.Create;
      subkeys := TStringList.Create;
      reg := TRegistry.Create(KEY_READ);
      try
        reg.RootKey := HKEY_CLASSES_ROOT;
    
        // Open the key for reading
        if reg.OpenKeyReadOnly(key) then
        begin
          reg.GetKeyNames(subkeys);
          reg.CloseKey;
    
          // Log the retrieved subkeys
          CodeSite.Send('Subkeys:', subkeys.Text);
    
          // Iterate through subkeys and filter those starting with a dot
          for i := 0 to subkeys.Count - 1 do
          begin
            if Subkeys[i][1] = '.' then
            begin
              // Add the subkey to the result list
              Result.Add(subkeys[i]);
            end;
          end;
        end;
      finally
        reg.Free;
        subkeys.Free;
      end;
    end;

     


  8. As a developer who deals a lot with design, I find Delphi's lack of layout options a thorn in my mind. The layout features in Delphi are one-dimensional (e.g., property Align).

     

    Delphi lacks a layout component like TdxLayoutControl from DevExpress for a professional design: 

     

     

    In practice, the lack of professional layout capabilities results in many bumbling-looking applications, with controls that sometimes overlap when run on a device with display settings different from those of the original application developer. This shortcoming has given Delphi the unjustified reputation of being an unprofessional amateur developer tool.

     

    That's why my greatest wish for the Delphi community would be a native layout control from Embarcadero. Or even better, Embarcadero should buy the TdxLayoutControl component from DevExpress and integrate it into the Professional version. This would give Delphi the professionalism it deserves due to its other capabilities.

    • Like 1
×