Noitidart
Noitidart

Reputation: 37298

Removing/hiding min/max/close buttons after runtime

I have a window, well my friend does and I'm trying to help him.

He wants to make the min/max/close buttons draggable. So he made his buttons and now wants to hide the native ones.

So we used this code:

int style;
 style = GetWindowLong(GetSafeHwnd(), GWL_STYLE); 
 style &= ~WS_MAXIMIZEBOX; 
 SetWindowLong(GetSafeHwnd(), GWL_STYLE, style);

This hides the min and max. Any ideas on how to hide the close?

Upvotes: 0

Views: 191

Answers (1)

William Chan
William Chan

Reputation: 307

Remove the WS_SYSMENU flag to hide the close button.

Upvotes: 1

Related Questions