Getting HWND of Console (.net 2.0)

M

Michael D. Ober

I need to get the HWND of a console application so I can use the Windows API
functions to control window position. The console class doesn't provide
full control over a window's position and whether or not it's minimized,
restored, or maximized.

Mike Ober.
 
A

AlexS

You can use Win32 API

[DllImport("kernel32")]

internal static extern IntPtr GetConsoleWindow();

for this



HTH

Alex
 
M

Michael D. Ober

Thanks - I wasn't sure how to reference the API call itself.

Mike.

AlexS said:
You can use Win32 API

[DllImport("kernel32")]

internal static extern IntPtr GetConsoleWindow();

for this



HTH

Alex

Michael D. Ober said:
I need to get the HWND of a console application so I can use the Windows
API
functions to control window position. The console class doesn't provide
full control over a window's position and whether or not it's minimized,
restored, or maximized.

Mike Ober.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top