vc雕虫小技集(五)
1,vc中右键点击一个类或宏,可以察看他的定义,但如何返回初始地方呢?
install visual assist, and use alt+left arrow
按菜单中的 后退 (<- 转45度)按钮
好像是又打开了一个文档,关闭它就行了
2,怎样获取系统菜单,并且弹出系统菜单?
void ctestsysmenudlg::onok()
{
// click the ok button to show system menu(masterz)
point curpos;
getcursorpos(&curpos);
setforegroundwindow();
cmenu* pmenu=getsystemmenu(false);
int nselection=pmenu->trackpopupmenu(tpm_leftbutton | tpm_leftalign |
tpm_bottomalign|tpm_nonotify|tpm_returncmd, curpos.x, curpos.y, this);
dword dwpos= curpos.x + ((curpos.y<<16)&0xffff0000);
sendmessage(wm_syscommand,nselection,dwpos);
cstring msg;
msg.format("x:%d,y:%d; cursor.x=%d,cursor.y=%d",loword(dwpos),hiword(dwpos),curpos.x,curpos.y);
outputdebugstring(msg);
}