在OnCreate函數中加入
if (CWnd::OnCreate(lpCreateStruct) == -1)return -1ModifyStyleEx(WS_EX_APPWINDOW, WS_EX_TOOLWINDOW);//加入這句