[python-win32] How to check a Checkbutton

Tim Roberts timr at probo.com
Thu Feb 4 19:29:59 CET 2010


Stefan George wrote:
>
>  
>
> It is me again and I hope you can help me again:
>
>  
>
> I have the handle of a checkbox and would like to get the state of the
> checkbox (true/false) and I want to check it/uncheck it.
>
> I have searched on the web but didn’t find any help.
>

How did you get the handle?

At the lowest level, you get the current state by sending a BM_GETCHECK
message to the window, and you set the state by sending a BM_SETCHECK
message.  MSDN describes the parameters you need to send.  If you're
doing raw API calls, you can use win32api.SendMessage to do it.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list