473,587 Members | 2,483 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 2239
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******** ******@TK2MSFTN GP04.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)ButtonStyl e.BS_AUTOCHECKB OX)
.....
If (buttonStyle == (int)ButtonStyl e.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
6671
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
6970
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
1491
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 forcing the Unicode and ASCII versions. (According to the Win32 documentation, both functions have...
1
15020
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. Thanks in advance. ***************************** static extern uint SendInput(uint nInputs,...
1
2851
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
2000
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
26578
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 the user32.dll like this: static extern bool TranslateMessage( ref Message lpMsg);
2
12126
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). This control works fine in Windows XP, but it crashes under Win64 systems when trying to call the...
2
3303
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 the procedure entry point is DefWindowProMF. In Safe Mode I renamed user32.dll, then attempted to...
0
7924
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8219
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7978
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8221
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5395
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3845
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1455
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.