Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to remove the caption and border of a window?

Status
Not open for further replies.

rlev

Programmer
Feb 13, 2010
8
US
I spawned an external app. using Createprocess API I want to remove the border of its window.

I have search the net and I found some examples using SetWindowLong and GetWindowLong but so far I have not success.

Can somebody help?

Here is my snippet:

childHwnd is the window handle of the spawned process.

long lStyle = GetWindowLong(childHwnd, GWL_STYLE);
lStyle &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU);



SetWindowLong(childHwnd, GWL_STYLE, lStyle);

long lExStyle = GetWindowLong(childHwnd, GWL_EXSTYLE);
lExStyle &= ~(WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE);

SetWindowLong(childHwnd, GWL_EXSTYLE, lExStyle);
SetWindowPos(childHwnd, NULL, 0,0,0,0
, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);


Also I read online some examples using SetWindowRgn but I can't figure out how they work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top