tags:

views:

417

answers:

3

I am embedding a 3rd party app into a panel on a c# windows form (using SetParent from user32.dll). I need to then turn off the title bar windows style (WS_CAPTION) so that it looks like a part of the hosting application.

How do I change a window's style to accomplish this?

For sake of example, say _hWnd is the handle of the application to embed.

+2  A: 

If memory serves, you might be able to do a GetWindowLong on the style, |= ~ WS_CAPTION on that value, and then SetWindowLong. See those APIs in MSDN.

Also see: http://www.codeguru.com/forum/showthread.php?t=352963

John Lockwood
Filip Navara
+1  A: 

SetWindowLong(_hWnd, GWL_STYLE, GetWindowLong(_hWnd, GWL_STYLE) & ~WS_CAPTION);

Filip Navara
+1  A: 

Take look at WindowInterceptor

adatapost