//WindowProc函数中.if(message == WM_SYSCOMMAND )
{
switch(wParam)
{
case SC_MAXIMIZE:
{
//最大化,
}
case SC_RESTORE:
{
//还原
}
case SC_MINIMIZE:
{
//最小化
}
}
{
switch(wParam)
{
case SC_MAXIMIZE:
{
//最大化,
}
case SC_RESTORE:
{
//还原
}
case SC_MINIMIZE:
{
//最小化
}
}
加入代码:
switch(nType)
{
case SIZE_MAXIMIZED:
{
//最大化,
}
break;
case SIZE_MINIMIZED:
{
//最小化
}
}2、重载PreTranslateMessage(MSG* pMsg);
加入代码:
if(pMsg->message == WM_SIZE )switch(pMsg->wParam)
{
case SIZE_MAXIMIZED:
{
//最大化,
}
break;
case SIZE_MINIMIZED:
{
//最小化
}
}两个方法用一个就可以了。“还原”应处理WM_SYSCOMMAND消息,你已实现了,不再赘述。
重载PreTranslateMessage(MSG* pMsg);
继续加入代码:
if(pMsg->message==WM_SYSCOMMAND&&pMsg->wParam==SC_RESTORE)
{
//最大化,
}
请问点击任务栏上的程序图标的时候,在vc中,相应的是什么消息?
激活 WM_ACTIVE