Visual C++ 2011-5-19

 

一.单选框分组

用CheckRadioButton函数将一组RadioButton设定为一组,ID为连续的

CheckRadioButton(IDC_RADIO1, IDC_RADIO3, IDC_RADIO2);

获取选中的RadioButton

int nID = GetCheckedRadioButton(IDC_RADIO1, IDC_RADIO3);

二.for循环

写法不习惯…

int i = 10;
for (; i>0; i--)
{
    Console.WriteLine(i);
}

三.ScrollWindow(Ex)

对于窗体增加ScrollBar功能

case WM_VSCROLL:
          // Get all the vertial scroll bar information

     si.cbSize = sizeof (si) ;
     si.fMask  = SIF_ALL ;
     GetScrollInfo (hwnd, SB_VERT, &si) ;

          // Save the position for comparison later on

     iVertPos = si.nPos ;

     switch (LOWORD (wParam))
     {
     case SB_TOP:
          si.nPos = si.nMin ;
          break ;
          
     case SB_BOTTOM:
          si.nPos = si.nMax ;
          break ;
          
     case SB_LINEUP:
          si.nPos -= 1 ;
          break ;
          
     case SB_LINEDOWN:
          si.nPos += 1 ;
          break ;
          
     case SB_PAGEUP:
          si.nPos -= si.nPage ;
          break ;
          
     case SB_PAGEDOWN:
          si.nPos += si.nPage ;
          break ;
          
     case SB_THUMBTRACK:
          si.nPos = si.nTrackPos ;
          break ;
          
     default:
          break ;         
     }
          // Set the position and then retrieve it.  Due to adjustments
          //   by Windows it may not be the same as the value set.

     si.fMask = SIF_POS ;
     SetScrollInfo (hwnd, SB_VERT, &si, TRUE) ;
     GetScrollInfo (hwnd, SB_VERT, &si) ;

          // If the position has changed, scroll the window and update it

     if (si.nPos != iVertPos)
     {                    
          ScrollWindow (hwnd, 0, cyChar * (iVertPos - si.nPos), 
                              NULL, NULL) ;
          UpdateWindow (hwnd) ;
     }
     return 0 ;

参考:Windows程序设计 第四章

四.关于IsDialogMessage

http://www.cnblogs.com/Greatest/archive/2009/08/25/1553623.html
http://www.cnblogs.com/lvpengms/archive/2010/02/05/1664721.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值