Handle the WM_NCHITTEST message and return HTCAPTION(if you want to still be able to move/drag the window by that part of the caption) or HTNOWHERE if you don't want any action for the area covered by the small icon. You should check the existing window styles so you can accurately calculate the exact dimensions of the corner of the window occupied by the small icon. Something like:
Code:
case WM_NCHITTEST:
{
RECT rc;
GetWindowRect(hwnd,&rc);
int mouse_x=LOWORD(lParam);
int mouse_y=HIWORD(lParam);
static const int small_icon_wd=GetSystemMetrics(SM_CXSIZE);
static const int small_icon_ht=GetSystemMetrics(SM_CYCAPTION)+
GetSystemMetrics(SM_CYEDGE);
if (mouse_x<=(rc.left+small_icon_wd) && mouse_y<=(rc.top+small_icon_ht))
{
return HTCAPTION;
}
return DefWindowProc(hwnd,uMsg,wParam,lParam);
}