When I click on the default icon on the left of my taskbar, a little menu pops up. I think it's called the system menu. Is there a way to prevent the menu from appearing, but without removing the icon.
One method I tried just deleted the icon and the close button. I still want the close button functional.
I don't know, but perhaps you can do some perverted hack using GetSystemMenu() and ModifyMenu() :)
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:
static const int small_icon_wd=GetSystemMetrics(SM_CXSIZE);
static const int small_icon_ht=GetSystemMetrics(SM_CYCAPTION)+
if (mouse_x<=(rc.left+small_icon_wd) && mouse_y<=(rc.top+small_icon_ht))
Haven't been on in a while, but yeah that sounds about right.