tags:

views:

85

answers:

2

I'm trying to do some P/Invoke stuff and need the handle of the current window.

I found this thread here

But it appears that only works in WPF. Is there a winForms equivalent?

+5  A: 

Control.Handle

An IntPtr that contains the window handle (HWND) of the control.

dtb
+1  A: 

Try this in your form:

IntPtr myHandle = this.Handle;

It will return the handle of the form.

ZokiManas