471,354 Members | 1,190 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Obtaining hWnd from a form - how ?

I need to pass the handle of my window (WinForm in C#) to a C library.
The WinForm does not apear to expose this property - how may I access it ?

MTIA

Dec 14 '05 #1
2 4034

"Susan Baker" <sb****@no.spam.net> wrote in message
news:dn**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
I need to pass the handle of my window (WinForm in C#) to a C library. The
WinForm does not apear to expose this property - how may I access it ?

MTIA


What about the Handle property?

Willy.
Dec 14 '05 #2
try this:

[DllImport]
static public extern void myCFunction(IntPtr hWnd);
......
myCFunction(myForm.Handle);

-----
Mark
http://www.redbugtech.com/blogs/mark.php

Willy Denoyette [MVP] wrote:
"Susan Baker" <sb****@no.spam.net> wrote in message
news:dn**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
I need to pass the handle of my window (WinForm in C#) to a C library. The
WinForm does not apear to expose this property - how may I access it ?

MTIA

What about the Handle property?

Willy.

Dec 14 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by WayneD | last post: by
1 post views Thread by Tamir Khason | last post: by
1 post views Thread by Alison Kakoschke | last post: by
3 posts views Thread by Andrew Moore | last post: by
1 post views Thread by MultiMarine | last post: by
11 posts views Thread by =?ISO-8859-15?Q?Kolja_M=E4rtens?= | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.