473,513 Members | 3,569 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

user32.dll - messages

Hi,

i use visual studio 2005 with c#

i try to to locate windows and controls in the window.

when i use the function GetClassName (located in user32.dll) i get the
Class.
Button, ComboBox or Edit ...

But i have the problem with checkbox and radio buttons.
These are Buttons too.

How can i read the kind of button ?

When I use Spy++ i see the styles of the controls.
Maybe i could use the style to figure it out.

But how ?

How can i get the style of a control ?
The windows i read out are not build from my application !

thx a lot
Martin
Aug 21 '07 #1
2 2233
Hi again,

i tried to use GetWindowLong.

but with this function i get a parameter. (type - long)

but i don´t know what can i do with this parameter
Aug 21 '07 #2
"Martin Priebe" <ma***********@hermos.comwrote in message
news:On**************@TK2MSFTNGP04.phx.gbl...
>
Hi,

ok. i get the return value 8403211231 for example.
what does that means ?

i don´t understand the difference between int and style ?

when i get the return value 8403211231, how can i see that this style is
for a checkbox or for a pushbutton ?
There must be something wrong with your return value declaration, 8403211231
is not a valid int32 value.
Anyway, the return value need to be masked out to get the valid button
styles from it,

int BS_TYPEMASK = 0x0000000F;
int GWL_STYLE = -16;
enum ButtonStyle
{
BS_CHECKBOX 0x2;
BS_AUTOCHECKBOX = 0x3;
....
}

int buttonStyle = GetWindowLong (hwndControl, GWL_STYLE) & BS_TYPEMASK;
Use as follows:
If (buttonStyle == (int)ButtonStyle.BS_AUTOCHECKBOX)
.....
If (buttonStyle == (int)ButtonStyle.BS_CHECKBOX)
Please check the Platform sdk docs on MSDN for the other possible button
style BS_**

Willy.

Aug 22 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
6661
by: S. van Beek | last post by:
Drear reader, I can't find the library Lib "user32" in my VBA available references. What can be wrong or which library has to be selected to run API code properly.
1
6963
by: Richard A. Lowe | last post by:
I'm successfully using SendInput to emulate mouse events for a legacy app, delcared like so: public extern static int SendInput( int theCount, ref INPUT pInputs, int theSize ); From the MSDN docs, SendInput appears to take an array of inputs:
5
1484
by: Will Pittenger | last post by:
The constants.windowLongIndices type is an enum. That is there so I can ensure the appropriate values are always used. Since I had to replace the GWL macros with new values, I decided to prevent passing 7 -- or whatever the author of the caller felt like. I tried both ExactSpelling=true and setting the entry point manually. I also tried...
1
15000
by: Craig | last post by:
I'm trying to figure out the fastest/easiest way of sending text to another application. I've got the SendInput and keybd_event methods working well enough... is one better than the other? Is there something else I should try out? Is there a way to send text to another window without giving that window focus? Below is the code I'm using. ...
1
2845
by: TusharP | last post by:
Hi Friends, Is there any similar framework dlls for gdi32.dll, used32.dll. I want to use following functions 1) GetPixel 2)SetWindowRgn 3)CreateRectRgn 4)CombineRgn 5)SendMessage 6)ReleaseCapture 7)DeleteObject
1
1992
by: r | last post by:
Hi, Could someone please direct me in the right direction? I would like to p/invoke few functions from user32: DrawAnimatedRects FindWindow, FindWindowEx , GetWindowRect struct RECT how do you usually get the functions headers, how do you know how to
2
26568
by: Juan Martinez | last post by:
In a form i have a drawing control called VectorDraw and a textbox. The text box is disable, when i am using the drawing area i can write some text, what i want to do is that when i press any key that key show in the textbox, or if other control has the focus and i press other key also show in the textbox. I saw some info about this using...
2
12103
by: Dan | last post by:
Sorry if this post may sound a bit off-topic, but I could not find a specialized newsgroup. I have created a dotnet 2.0 library containing some user controls and written in C#. One of the controls (an extension of RichTextControl) needs to programmatically change the keyboard layout, so it imports some user32.dll API functions (see below)....
2
3297
by: =?Utf-8?B?U3RldmVTNjA=?= | last post by:
I apparently made an unknown error. Now when I attempt to install two software packages I receive error messages. One package results in the message "The procedure entry point CallWindowProMF could not be located in the dynamic link library user32.dll. Attempting to install the other package results in exactly the same error message, but...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7125
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5703
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4757
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3252
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3239
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
470
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.