1.SetWindowPos(&wndTopMost,GetSystemMetrics(SM_CXSCREEN)*4/5,GetSystemMetrics(SM_CYSCREEN)/10,GetSystemMetrics(SM_CXSCREEN)/5,GetSystemMetrics(SM_CYSCREEN)*8/10, SWP_SHOWWINDOW);//在初始化函数里加上这句,使窗口在屏幕右方,比例自己控制
2.窗口的隐藏
HWND m_hwnd =::FindWindow(NULL,(CString)"窗口名字");
ShowWindow(m_hwnd,SW_SHOW);
//1,2结合可以做出窗口在屏幕右端悬挂的效果,鼠标靠近窗口出现,离开窗口就消失
3.点击按钮发送虚拟消息
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);模拟一次单击
keybd_event(16,0,0,0);
keybd_event(17,0,0,0);
keybd_event('E',0,0,0);
keybd_event(16,0,KEYEVENTF_KEYUP,0);
keybd_event(17,0,KEYEVENTF_KEYUP,0);
keybd_event('E',0,KEYEVENTF_KEYUP,0);//模拟按住ctrl,shift,w一次
给指定窗口发:
在3步骤前需要获得窗口句柄
HWND m_hwnd =::FindWindow(NULL,"窗口名字");
SetForegroundWindow(m_hwnd);
ShowWindow(m_hwnd,SW_RESTORE);