Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Able to fix the issue, thanks everyone!! Below code helped me to get offsets of all the properties including private members: begin rttiType:= Ctx.GetType(TypeInfo(TWinControl)); sFields := rttiType.Name + ' {'; fields := rttiType.GetFields; for i := low(fields) to high(fields) do begin Offset:=fields.Offset]; end;; end; Had to adjust offsets of our own structure members to match with the actual ones. Thanks, Jenifer
  2. Hope you won't be unhappy if I ask further questions 🙂
  3. I would like to mention few more info to make things clear: My actual library that our application uses to capture UI properties is what, written in C language It is bit legacy codebase where it uses its own structures of various Delphi UI controls like TControl,TWinControl,TPanel etc(Last updated Delphi version is of 2006) Currently working on to get Delphi 10.4 support as well. When I am trying to get text from control using WM_GETTEXT message, got stuck with access violation which is kind of memory allocation/offset related issue. To sort that out I am trying to find offset values for members, those are of base classes(TControl,TWinControl)from Delphi. There is no try to access private members of those based classes. We have our own way to retrieve Delphi version, so codebase has a knowledge about version as well. Thanks, Jenifer
  4. My bad,i should have mentioned public properties(Parent,WindowProc,Width etc).
  5. No,I didn't mean casting HWND to TControl*.It is the Delphi object we will retrieve from the application Window. Yes, of course am playing around the VCL unit code, had pasted those ones for reference.(So no public fields even from TControl :-)) Thanks
  6. Hopefully I had cleared the air with recent reply!!Let me rephrase my question probably. Assuming TControl,TWinControl have class members starting as below: {$IF DEFINED(CLR)} TControl = class(TComponent, IControl) {$ELSE} TControl = class(TComponent) {$ENDIF} public FParent: TWinControl; FWindowProc: TWndMethod; FLeft: Integer; FTop: Integer; FWidth: Integer; FHeight: Integer; FControlStyle: TControlStyle; FControlState: TControlState; FDesktopFont: Boolean; FVisible: Boolean; FEnabled: Boolean; {$IF DEFINED(CLR)} TWinControl = class(TControl, IWinControl) strict private class var FPendingParentWindow: HWND; {$ELSE} TWinControl = class(TControl) {$ENDIF} private class var RM_AsyncMessage: Cardinal; private FAlignControlList: TList; FAlignLevel: Word; FBevelEdges: TBevelEdges; FBevelInner: TBevelCut; FBevelOuter: TBevelCut; FBevelKind: TBevelKind; FBevelWidth: TBevelWidth; FBorderWidth: TBorderWidth; FPadding: TPadding; FBrush: TBrush; FDockClients: TList; How do we know the offset of each member in TControl/TWinControl class? For an example offset of FParent,FWidth like that. I had to dive into disassembly to figure out the offset values ,but i could find offsets of few members only not for all. Any suggestions? Thanks, Jenifer
  7. Pseudo might be like this: It is something like we would get Window(HWnd), object from an application. Cast that object to TControl*(which is own own structure in C),so that we can retrieve properties No issues till now but when i try to retrieve a text from control via WM_GETTEXT is what i am facing issue with. Thanks for your time, appreciate it!!
  8. @Remy Lebeau,Thanks for your reply. Yes, it is our own custom library that we had developed. From the window of Delphi application, I am trying to read Delphi object & its properties. We do maintain our own structures for TControl & TWinControl etc. Facing access violation issue on trying to read text from the UI control like panel via sending message. Just wondering it might be due to structural change in Delphi UI control classes after 2006(That was the last developed/modified one) Thanks, Jenifer
  9. We have framework to capture Delphi application control properties, it is that there are some issues related to 10.4 version. More related to memory offset, there came the question about size of basic Control classes like TControl/TWinControl.
  10. Hello all, I am trying to figure out a way to search for values in memory pane of RAD Studio. I had made Memory pane to display values as 'DWords',for an example I would like to search for "020F0106".In help the format suggested is: reversing the bytes such as 06010F02 which didn't work. Any suggestions?
  11. Thanks a lot for your detailed answer. The way we capture UI control properties is bit different via C programming, hence I doubt if I could go with DFM approach. My premier requirement here is finding basic control's memory offsets of various members, so that capture can go smooth.
  12. ,due to urgency I had posted there as well, based on responses will stick to one going further.
  13. Thanks @David Heffernan Yeah better let me put my use case first: I want to capture properties of delphi UI controls starting with base controls TControl,TWinControl. Have my own rough structures for TControl/TWinControl(in C programming), but those sizes aren't matching with controls of Delphi 10.4(3) versions. So wanted to check sizes of those in-built control classes, tried with InstanceSize() which doesn't seem to be returning actual size I got to know about TMemoryStream while searching for a solution Any efficient/working solution would be great!!!:-)
  14. Hello, I am trying to find size of built-in classes for an example TControl,TWinControl etc.Tried with InstanceSize() which in turn might not add size of few types considering them as references. Found an interesting stack-overflow thread talking about TMemoryStream to find out class size:https://stackoverflow.com/questions/8782518/getting-the-size-of-a-class-or-object-in-the-same-format-as-a-file-size.I couldn't get much info on how to use TMemoryStream to figure out class size,can i get assistance regarding this? Thanks, Jenifer