By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,330 Members | 1,365 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,330 IT Pros & Developers. It's quick & easy.

Handle to a window

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.