Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 01/24/19 in all areas

  1. We made some changes to the low-level method call ABI in 10.3, which affects both Delphi and C++. This is likely to be invisible to you unless you do something very low-level. It's more visible to you if you use C++, because now an entire class of bugs has been fixed in one go. IMO, whether you use C++ or not, it's very interesting! Info here: https://community.idera.com/developer-tools/b/blog/posts/abi-changes-in-rad-studio-10-3
  2. Ian Branch

    Single Instance of Dephi IDE?

    Suggestion submitted to QP. RSP23412 https://quality.embarcadero.com/browse/RSP-23412
  3. Stefan Glienke

    Include unused class and its RTTI in the executable

    I don't see the Delphi compiler performing any control flow analysis and eliminate code in any possible future. C++ might do that though (see https://stackoverflow.com/questions/6664471/observable-behaviour-and-compiler-freedom-to-eliminate-transform-pieces-c-co) However I requested adding a way to specifically force linking of types into the binary some while ago - see https://quality.embarcadero.com/browse/RSP-18389
  4. Tommi Prami

    How to get position of Top-level TMenuItem of Main menu

    type {$A8} // default quadword-alignment PSTMenuBarInfo = ^TSTMenuBarInfo; tagSTMENUBARINFO = record cbSize: DWORD; rcBar: TRect; hMenu: HMENU; hwndMenu: HWND; { fBarFocused:1: BOOL;} { bar, popup has the focus } { fFocused:1: BOOL; } { item has the focus } FocusedBits: BYTE; end; TSTMenuBarInfo = tagSTMENUBARINFO; function STGetMenuBarInfo(hend: HWND; idObject, idItem: Longint; var pmbi: TSTMenuBarInfo): BOOL; stdcall; external user32 name 'GetMenuBarInfo'; function GetWindowMenuItemRect(const AHandle: THandle; const AIndex: Integer): TRect; var LMenuBarInfo: TSTMenuBarInfo; begin FillChar(LMenuBarInfo, SizeOf(TSTMenuBarInfo), 0); LMenuBarInfo.cbSize := SizeOf(TSTMenuBarInfo); {$RANGECHECKS OFF} {$OVERFLOWCHECKS OFF} {$WARN SYMBOL_PLATFORM OFF} Win32Check(STGetMenuBarInfo(AHandle, Longint($FFFFFFFD), AIndex, LMenuBarInfo)); {$WARN SYMBOL_PLATFORM ON} {$OVERFLOWCHECKS ON} {$RANGECHECKS ON} Result := LMenuBarInfo.rcBar; end; Changed types and method name to make sure it uses different types, added some far fetched compiler defines. Same code works using rest of your code. But failed on app that woulöd actually need to use it :). Have an idea tough... Gives me System Error. Code: 1400. Invalid window handle LEt me see... btw... Thanks for help!
  5. Cristian Peța

    Single Instance of Dephi IDE?

    After I run for the first time an app I often use I pin it to the taskbar (Windows 10) and then I click only on this icon. Left click will open it, if it's closed, and switch to if it's open. Middle click will open every time a new instance.
  6. Ondrej Kelle

    How to get position of Top-level TMenuItem of Main menu

    Sorry, I've been vague. Here's the full code which works in Delphi XE, I hope it helps: GetWindowMenuItemRect example Cheers!
  7. jeroenp

    Single Instance of Dephi IDE?

    You can write an IDE plugin for this that switches to the existing instance, then quits the new one. But first you have to define "single instance", and how to set instances apart. For instance, I know many Delphi developers that run Delphi with various registry tree starting points. Or run one with admin privileges and the other without. Or run one as user A and another as user B. Are those different instances? A much simpler trick might be to look at the windows task bar: is there already a Delphi icon on it? Click on it and see which instances are running.
  8. David Heffernan

    Maintaining For loop(s)

    The fundamental problem sounds like you have duplication of code. Attack that and the problem you describe simply disappears.
×