473,396 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Handle to a window

JJ
Hi All,

How can I get the handle to a window in c#? I did notice that for a
form in C# there is a hwnd property, is this one and the same?

Thanks,

JJ
Nov 13 '05 #1
3 11759
Can you explain is to doing what.
You question is too large for possible answer!

"JJ" <jm***@bellatlantic.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi All,

How can I get the handle to a window in c#? I did notice that for a
form in C# there is a hwnd property, is this one and the same?

Thanks,

JJ

Nov 13 '05 #2
JJ, you can use the Handle property which is inherited from the Control
class, it is a windows handle. What hwnd property are you referring to?

--
Greg Ewing [MVP]
http://www.claritycon.com/
"JJ" <jm***@bellatlantic.net> wrote in message
news:#S**************@TK2MSFTNGP12.phx.gbl...
Hi All,

How can I get the handle to a window in c#? I did notice that for a
form in C# there is a hwnd property, is this one and the same?

Thanks,

JJ

Nov 13 '05 #3
JJ
Ok so if I have a user control and I need its handle I would refer to in the
following manner:

uint hWnd = usercontrolName.Handle();

Correct?

An article mentioned that you can't get a handle to a window outside your
app but have to use IntPtr instead.

See I am trying to get a handle to a usercontrol and pass it into an API
call.

JJ

"Greg Ewing [MVP]" <gewing@_NO_SPAM_claritycon.com> wrote in message
news:Ov**************@TK2MSFTNGP12.phx.gbl...
JJ, you can use the Handle property which is inherited from the Control
class, it is a windows handle. What hwnd property are you referring to?

--
Greg Ewing [MVP]
http://www.claritycon.com/
"JJ" <jm***@bellatlantic.net> wrote in message
news:#S**************@TK2MSFTNGP12.phx.gbl...
Hi All,

How can I get the handle to a window in c#? I did notice that for a
form in C# there is a hwnd property, is this one and the same?

Thanks,

JJ


Nov 13 '05 #4

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

Similar topics

4
by: Altramagnus | last post by:
I have 30 - 40 type of different window. For each type I need about 20 instances of the window. When I try to create them, I get "Error creating window handle" My guess is there is a maximum...
3
by: Fred Hebert | last post by:
I am trying to use a 3rd party DLL that requires the main window handle as a parameter. e.g. MyFunc(WHND MyHandle); The example looks something like this: Result = MyFunc(Handle); Where...
4
by: Brad Jones | last post by:
<Previously posted in microsoft.public.dotnet.framework.windowsforms> Hi all. Any suggestions here would be appreciated. Thanks for reading. I'm primarly a C++ developer but I've been trying to...
3
by: NeverLift | last post by:
But, if it's not open, I don't want to open it . . . using window.open will open it if it doesn't exist, even if the url in that open is null (the window is then empty -- but it's open). The...
11
by: objectref | last post by:
Hi to all, is there a way to get the window handle of the main window of an application or process ? For example, if someone opens Microsoft Word, he gets a window so he/she can write text....
3
by: TC | last post by:
Hey Folks, I am using the following 4 Win32 APIs with a C# AddIn: FindWindow SetWindowLong SetForegroundWindow EnableWindow Within the AddIn, there are some winforms. I use these APIs to...
7
by: lkr | last post by:
hi is there is anyway to capture the document events of a MSWord?eg:I have to handle the event awhen WM_KEYUP or anyother events will occur. give me a solution............ thanks in advance lkr
2
by: David A. Osborn | last post by:
I'm having problems getting the caption on the active window handle. The active window handle seems to always come back as zero and the caption blank. Private Declare Function GetActiveWindow...
13
by: Abhishek | last post by:
Hi, how do I pass the handle of a control to the win32 api mouse_event. so that it will create the click event on that application only even if there is any other window in front of it. I dont...
2
by: Jonathan Boivin | last post by:
Hi people, Let me introduce to how I get this error. I have a form which load all my bills representation depending upon filters which each bill is a usercontrol of my own having some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...

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.