Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to disable a button on a dialog, but I can't seem to retrieve the button handle no matter what I try (Spy++ can see the control and get its ID).

What I have tried:

I can find the dialog handle, and thus get its CWnd. I test changing the dialog title, just to confirm that it isn't protected somehow. I have the control ID from Spy++.

I tried GetDlgItem, FindWindow, FindWndowEx and EnumChildWindows, but just cannot get the button window handle.

Interestingly, EnumChildWindows doesn't find all the children - so what is Spy++ doing that I'm not?
Posted
Updated 20-Nov-17 16:55pm

1 solution

As usual, as soon as I ask, I figure it out!

It looks like the controls are added dynamically - I just need to wait for them to show up!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900