Pelles C forum

C language => Expert questions => Topic started by: Grincheux on April 29, 2021, 01:49:52 PM

Title: Is the window Subclassed
Post by: Grincheux on April 29, 2021, 01:49:52 PM
How to know if a window is subclassed?
I compare the HINSTANCE of the wndclass structure with the one got with GetWindowLongPtrA.
The result is that no window is subclassed on my pc!


For my program, when I look at its results, I have many windows but I create only one!
If you have any idea.
Title: Re: Is the window Subclassed
Post by: John Z on April 29, 2021, 03:36:39 PM
Well I'm no expert - never found a need to subclass a window.  To do it you need to intentionally make changes, overriding the original so it is not done by itself, or accidentally, as far as I know.  Other than looking at code I don't know if there is a flag or property that indicates a subclassed window or control.

When I run your mGimp program which became Cfe, I count 6 windows before I even try to apply a filter.

John Z

Title: Re: Is the window Subclassed
Post by: Grincheux on April 29, 2021, 03:40:25 PM
Yes but with the last program it shows more...
This is the reason of my question.
Have a look you will be surprised.
Title: Re: Is the window Subclassed
Post by: John Z on April 29, 2021, 04:00:36 PM
OK you are talking about WiW not Cfe.  Running it now. So WiW looking at entries for WiW I see 39 'entries', using Pelles Process Viewer I see WiW using 36 DLL's doesn't seem unreasonable.

Every control is a window.  When I run Cfe then start WiW, WiW doesn't show the Cfe files in the Filename column.

I think I'm just lost here.   :(  No help to you on this.

John Z
Title: Re: Is the window Subclassed
Post by: Grincheux on April 29, 2021, 04:02:54 PM
John this is the part of my problem. I will add the possibility to list all the children and to hook the windows too. To be able to know what is behind.
Title: Re: Is the window Subclassed
Post by: John Z on April 29, 2021, 04:23:06 PM
Is this helpful? "Determining if One Object’s Class Is a Subclass of Another"

https://www.oreilly.com/library/view/c-cookbook/0596007612/ch08s08.html


John Z

Your post on MASM32 Form will probably get a good answer.  :)
Title: Re: Is the window Subclassed
Post by: Grincheux on April 29, 2021, 05:14:25 PM
Thank You John, but it is C++ and I don't understand. But it seems this not the solution. I have read many posts on it, they all compare the hInstance like I do. I continue to dig...
Title: Re: Is the window Subclassed
Post by: frankie on April 30, 2021, 09:31:09 AM
Try comparing the address of your subclassing procedure with the window stored address.
Title: Re: Is the window Subclassed
Post by: Grincheux on April 30, 2021, 12:58:22 PM
I have made this too