Recent

Author Topic: How do I change the SysListView32 class name  (Read 1733 times)

yazigegeda

  • New Member
  • *
  • Posts: 29
How do I change the SysListView32 class name
« on: May 14, 2024, 10:09:18 am »
I tried to change it

..." \win32\win32int.pp"


What should I do if it still hasn't changed after compiling?


Code: Pascal  [Select][+][-]
  1.  
  2. const
  3.   BOOL_RESULT: array[Boolean] of String = ('False', 'True');
  4.   ClsName: array[0..6] of char = 'abc'#0;
  5.   ClsHintName: array[0..10] of char = 'def'#0;
  6.   EditClsName: array[0..4] of char = 'Edit'#0;
  7.   ButtonClsName: array[0..6] of char = 'Button'#0;
  8.   ComboboxClsName: array[0..8] of char = 'ComboBox'#0;
  9.   ListboxClsName: array[0..8] of char = 'LISTBOX'#0;
  10.   TabControlClsName: array[0..15] of char = 'yjt'#0;
  11.   ListViewClsName: array[0..13] of char = 'nvnv'#0;
  12.  
  13.   LCLComboboxClsName: array[0..27] of char = 'qwe'#0;
  14.   LCLListboxClsName: array[0..26] of char = 'bbd'#0;
  15.   LCLCheckListboxClsName: array[0..31] of char = 'sada'#0;
  16.   ClsNameW: array[0..3] of WideChar = ('a', 'b', 'c', #0);
  17.   ClsHintNameW: array[0..3] of WideChar = ('d', 'e', 'f', #0);
  18.  
  19.  
  20.  
  21.  



« Last Edit: May 14, 2024, 10:12:03 am by yazigegeda »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12142
  • FPC developer.
Re: How do I change the SysListView32 class name
« Reply #1 on: May 14, 2024, 10:51:32 am »
Compiling the application, or after recompiling lazarus?


yazigegeda

  • New Member
  • *
  • Posts: 29
Re: How do I change the SysListView32 class name
« Reply #2 on: May 14, 2024, 11:14:16 am »
Compiling the application, or after recompiling lazarus?

Do I need to compile lazarus source code to change SysListView32 class name? This is huge. I compile the application :-X

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2269
  • Fifty shades of code.
    • Delphi & FreePascal
Re: How do I change the SysListView32 class name
« Reply #3 on: May 14, 2024, 11:41:06 am »
I would assume that you will need to recompile not just Lazarus also the RTL that is based on those names with the final result that nothing works anymore.
But I keep watching this thread, good luck mate!
(you need to distinguish between LCL classnames, that can be easy changed without harm and the ones where the windows api rely onto)
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12142
  • FPC developer.
Re: How do I change the SysListView32 class name
« Reply #4 on: May 14, 2024, 12:12:25 pm »
win32int is LCL, not FPC. So no need to recompile FPC.

But it would be wise to recompile LCL, just in case it is compiled with -Ur and doesn't automatically.

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2269
  • Fifty shades of code.
    • Delphi & FreePascal
Re: How do I change the SysListView32 class name
« Reply #5 on: May 14, 2024, 12:19:41 pm »
But it would be wise to recompile LCL
This I was meaning, thank you for correcting!
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

yazigegeda

  • New Member
  • *
  • Posts: 29
Re: How do I change the SysListView32 class name
« Reply #6 on: May 14, 2024, 01:19:25 pm »
win32int is LCL, not FPC. So no need to recompile FPC.

But it would be wise to recompile LCL, just in case it is compiled with -Ur and doesn't automatically.



Is there a tutorial for compiling LCL? I want to try it! :'( :'(

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1500
    • Lebeau Software
Re: How do I change the SysListView32 class name
« Reply #7 on: May 14, 2024, 06:47:44 pm »
I tried to change it

..." \win32\win32int.pp"


What should I do if it still hasn't changed after compiling?

I don't understand what you are trying to accomplish.  Please explain.  TListView is an LCL class that wraps a Win32 API SysListView32 control.  You are looking at the properties of the actual Win32 control, you can't change its class name, as it is a component of the OS.
« Last Edit: May 14, 2024, 07:05:14 pm by Remy Lebeau »
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

Thaddy

  • Hero Member
  • *****
  • Posts: 16770
  • Ceterum censeo Trump esse delendam
Re: How do I change the SysListView32 class name
« Reply #8 on: May 14, 2024, 07:00:24 pm »
@Remy
He needs to recompile windows for that  :(
Changing servers. thaddy.com may be temporary unreachable but restored when the domain name transfer is done.

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1500
    • Lebeau Software
Re: How do I change the SysListView32 class name
« Reply #9 on: May 14, 2024, 07:05:25 pm »
I don't know how Lazarus' LCL works internally, but in Delphi's VCL, each TWinControl-derived component registers its own WNDCLASS with the Win32 API, using its own ClassName for the registered class name. If the component wraps a Win32 API control, like SysListView32 in the case of TListView, then the API control's original OS-provided WNDPROC is used in the WNDCLASS.  And then an HWND is created using the registered ClassName, and then subclassed to intercept messages for the HWND.

So, for example, this would allow a TListView object to have an HWND which shows up in Spy++ with a class name of 'TListView' instead of 'SysListView32', but it would still behave like a standard SysListView32 at runtime.
« Last Edit: May 14, 2024, 07:10:51 pm by Remy Lebeau »
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

yazigegeda

  • New Member
  • *
  • Posts: 29
Re: How do I change the SysListView32 class name
« Reply #10 on: May 15, 2024, 11:31:29 am »
I don't know how Lazarus' LCL works internally, but in Delphi's VCL, each TWinControl-derived component registers its own WNDCLASS with the Win32 API, using its own ClassName for the registered class name. If the component wraps a Win32 API control, like SysListView32 in the case of TListView, then the API control's original OS-provided WNDPROC is used in the WNDCLASS.  And then an HWND is created using the registered ClassName, and then subclassed to intercept messages for the HWND.

So, for example, this would allow a TListView object to have an HWND which shows up in Spy++ with a class name of 'TListView' instead of 'SysListView32', but it would still behave like a standard SysListView32 at runtime.


As long as other tools spy++ (ring3 runs the program) can not use the "SysListView32" class name to read the control handle on the line, I don't know how to do it? Can I inherit a TListView control and then change its class name? :'(

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2269
  • Fifty shades of code.
    • Delphi & FreePascal
Re: How do I change the SysListView32 class name
« Reply #11 on: May 15, 2024, 12:22:14 pm »
As long as other tools spy++ (ring3 runs the program) can not use the "SysListView32" class name to read the control handle on the line, I don't know how to do it?
Of curiosity, why? And again, no you can not change OS classnames for native controls like TListView (pascal control) -> SysListView32 (native control)
As Thaddy funny but true mentioned, you would need to patch the OS plus LCL with a result that just on the patched machine SysListView32 become "yazigegedaClass"
« Last Edit: Tomorrow at 31:76:97 xm by KodeZwerg »

yazigegeda

  • New Member
  • *
  • Posts: 29
Re: How do I change the SysListView32 class name
« Reply #12 on: May 15, 2024, 12:36:08 pm »
As long as other tools spy++ (ring3 runs the program) can not use the "SysListView32" class name to read the control handle on the line, I don't know how to do it?
Of curiosity, why? And again, no you can not change OS classnames for native controls like TListView (pascal control) -> SysListView32 (native control)
As Thaddy funny but true mentioned, you would need to patch the OS plus LCL with a result that just on the patched machine SysListView32 become "yazigegedaClass"

Alright, I understand now. :'(

440bx

  • Hero Member
  • *****
  • Posts: 5135
Re: How do I change the SysListView32 class name
« Reply #13 on: May 15, 2024, 12:43:56 pm »
As long as other tools spy++ (ring3 runs the program) can not use the "SysListView32" class name to read the control handle on the line, I don't know how to do it? Can I inherit a TListView control and then change its class name? :'(
It would be a lot easier to help you if you would state, at least somewhat clearly, what it is you are trying to accomplish.  Why do you want to change the class name ? and, presuming you could do it, what do you think that would accomplish ? what would be the benefit ?  How would it be useful to your program ?

The answer to one or two of the above questions would go a long way to provide plausible courses of action.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

 

TinyPortal © 2005-2018