VC雕虫小技集(五)[1]

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 he_zhidan 的 blog

 

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);

}

 

本文关键:VC 雕虫小技集
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top