当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: 1. 如何改变窗口的图标? 向窗口发送 WM_SECTION消息。
 

 

 ·vc快捷键:    »显示摘要«
    摘要: f1: 帮助 ctrl+o :openctrl+p :printctrl+n :newctrl+shift+f2 :清除所有书签f2 :上一个书签shift+f2 :上一个书签alt+f2 :编辑书签ctrl+f2 :添加/删除一个书签f12 :goto definitionshift+f12 :goto referencectrl+num+ :displays the next symbol ......
    摘要: candidate lists a candidate list is a candidatelist structure consisting of an array of strings that specifies the characters or character strings that the user may choose from. you can retrieve the......


VC常见入门问题总结(三)

1. 如何改变窗口的图标?

  example: 【程序编程相关:VC调试技术小技巧(2)

   向窗口发送 wm_section消息. 【推荐阅读:VC调试技术小技巧(5)

   assert(hicon); 【扩展信息:如何编写一个文件捆绑工具

   hicon hicon=afxgetapp() ->loadicon(idi_icon);

   afxgetmainwnd() ->sendmessage(wm_section,true,(lparam) hicon);

2. 如何改变窗口的缺省风格?

   重载 cwnd:: precreatewindow 并修改createstruct结构来指定窗口风格与其他创建信息.

   example: delete "max" button and set original windows position andsize

   bool cmainframe:: precreatewindow (createstruct &cs)

   {

   cs.style &=~ws_maxinizemox;

   cs.x=cs.y=0;

   cs.cx=getsystemmetrics(sm_cxscreen/2);

   cs.cy=getsystemmetrics(sm_cyscreen/2);

    return cmdiframewnd ::precreatewindow(cs);

   }

3. 如何将窗口居中显示?

    call function cwnd:: center windows

     example(1): center window( ); //relative to its parent

     // relative to screen

     example(2): center window(cwnd:: getdesktopwindow( ));

     //relative to applications mainwindow

     afxgetmainwnd( ) -> center window( );

4. 如何让窗口与 mdi窗口一启动就最大化与最小化?

   先说窗口.

   在 initstance 函数中设定 m_ncmdshow的 取值.

     m_ncmdshow=sw_showmaxmized ; //最大化

     m_ncmdshow=sw_showminmized ; //最小化

     m_ncmdshow=sw_shownormal ; //正常方式

     mdi窗口:


...   下一页
 ·vc下的ado编程入门(1)    »显示摘要«
    摘要: vc下的ado编程入门 n 新建一基于对话框的应用程序zjy,在对话框上添加一个列表框和一个按钮,用classwizard给列表框添加一个变量m_list n 在stdafx.h头文件的所有include语句下面添加如下一条语句 #import "c:\program files\common files\system\ado\msado15.dll" no_namespace ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE