Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / June 2006

Tip: Looking for answers? Try searching our database.

How can I tell if a WindowsForms10.BUTTON.... is a checkbox or radiobutton

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Aberro-Bill - 01 Jun 2006 21:48 GMT
I am spying on another process and I can tell that the window I am looking
at is a WindowsForms10.BUTTON....  but I don't see how to tell if this is a
regular button, checkbox or radiobutton.  I looked at the window style but
this does not seem to use the styles BS_RADIOBUTTON, BS_CHECKBOX, etc.  I
need to similarly differentiate controls that show up as
WindowsForms10.Window... such as picture box, group box
Thanks,
Bill
Mattias Sjögren - 01 Jun 2006 23:22 GMT
>I looked at the window style but
>this does not seem to use the styles BS_RADIOBUTTON, BS_CHECKBOX, etc.

Did you use a tool such as Spy++ to check the window styles or some
other way? The BS_ bit flags should be set, but Spy++ will not
recognize them as such when the window class name isn't "Button". So
you have to look at the numeric value and not just the name.

Mattias

Signature

Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Aberro-Bill - 02 Jun 2006 02:38 GMT
Hi Mattias,

Yes, I used Spy++

Style Word results for .NET 2 controls using Spy++
Control            StyleWord
Button             0x56012F00
Checkbox        0x56012D25 or 0x56012D05 or 0x5601000B or 0x5601022B
Radiobutton     0x56012D04 or 0x5601000B

Notice that both Checkbox and RadioButton can return a style word of
0x5601000B - so the style word can't be used to tell the type

I rechecked many times on different apps to make sure I am not making
errors.

Thanks,
Bill

>>I looked at the window style but
>>this does not seem to use the styles BS_RADIOBUTTON, BS_CHECKBOX, etc.
[quoted text clipped - 5 lines]
>
> Mattias
"Jeffrey Tan[MSFT]" - 02 Jun 2006 04:22 GMT
Hi Bill,

Thanks for your post!

For managed .Net winform application, in order to get more detailed
information of the controls, you may give the following "managed Spy++" a
look:
"Managed Spy--Deliver The Power Of Spy++ To Windows Forms With Our New Tool"
http://msdn.microsoft.com/msdnmag/issues/06/04/ManagedSpy/

This tool is developed by one of the .Net winform developer. This article
has the tool source code followed with it.

Hope this helps!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.