Question Remove border on external application?

A300ZX

New member
Joined
Aug 30, 2010
Messages
3
Programming Experience
1-3
Hi, I am currently working on a program that needs to execute an outside program and then remove the border from the program (The border that includes the minimize, maximize, and close buttons) and then embed it into my form. I have everything working except for removing the border. Anyone have some code to do that? I am using vb.net in VS2008.

Thanks!
 
You can use Get/SetWindowLong functions with GWL_STYLE and remove WS_CAPTION and WS_THICKFRAME styles. (Get/SetWindowLongPtr for 64-bit Windows)
 
JohnH:

I have been trying to use that with out any luck, I think I am just not setting it up right. Any chance you can give me some code on how you would use it?

Thanks!!
 
I tested this earlier, but was then toggling with Xor, this should work to just turn off those styles:
VB.NET:
Dim styles = GetWindowLong(hwnd, GWL_STYLE)
styles = styles And Not (WS_CAPTION Or WS_THICKFRAME)
SetWindowLong(hwnd, GWL_STYLE, styles)
 
Thanks for the code, the problem now is that "GWL_STYLES","WS_CAPTION", and "WS_THICKFRAME" are saying that they are not declared. Do I need to add an Imports or reference for them to work properly?

Thanks again for the help!
 
Back
Top