EVC 之进度条使用

来源:互联网 发布:淘宝客推广术语 编辑:程序博客网 时间:2024/04/27 18:00

作者:wogoyixikexie@gliet

    ————————————————————————————————

   我已经实现在wince下实现更新NK的flash驱动和EVC程序,但是这个EVC程序界面比较差劲,想加一些进度条给它,现在开始尝试。汪兵的书里面有些介绍,在这里先看看吧。

=======================================================================

现在再来看看EVC的帮助文档

——————————————

Setting the Range and Current Position

The range of a progress bar represents the entire duration of the operation, and the current position represents the progress that the application has made toward completing the operation. The window procedure uses the range and the current position of the progress bar to determine the percentage of the progress bar to fill with the highlight color, as well as to determine what text, if any, to display within the progress bar.

If you do not set the range values, the system sets the minimum value to zero and the maximum value to 100. You can adjust the range to convenient integers by using the PBM_SETRANGE message.

A progress bar provides several messages that you can use to set the current position. The PBM_SETPOS message sets the position to a specified value. The PBM_DELTAPOS message advances the position by adding a specified value to the current position. The PBM_SETSTEP message enables you to specify a step increment for a progress bar. Subsequently, when you send the PBM_STEPIT message to the progress bar, the current position advances by the specified increment. The default step increment is 10.

Note   The range values in a progress bar are considered signed integers. Any number that is greater than 0x7FFFFFFF is interpreted as a negative number

 

 

This method creates the progress bar control attached to this CProgressCtrl object.

To construct a CProgressCtrl object, call the constructor, which creates the CProgressCtrl object; then call Create.

BOOL Create( DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID ); 

Return Value

TRUE if the CProgressCtrl object is successfully created; otherwise, it is FALSE.

Parameters

dwStyle
Specifies the style of the progress bar control. Apply any combination of window styles described in CreateWindow, in addition to the following progress bar control styles, to the control:
  • PBS_VERTICAL   Displays progress information vertically, top to bottom. Without this flag, the progress bar control displays horizontally, left to right.
  • PBS_SMOOTH   Displays gradual, smooth filling in the progress bar control. Without this flag, the control will fill with blocks.
rect
Specifies the size and position of the progress bar control. It can be either a CRect object or a RECT structure. Because the control must be a child window, the specified coordinates are relative to the client area of the pParentWnd.
pParentWnd
Specifies the parent window of the progress bar control, usually a CDialog. It must not be NULL.
nID
Specifies the progress bar control ID.

Example

CProgressCtrl myCtrl;// Create a smooth child progress control.myCtrl.Create(WS_CHILD|WS_VISIBLE|PBS_SMOOTH, CRect(10,10,200,30),   pParentWnd, 1);

Requirements

  Windows CE versions: 1.0 and later  
  Header file: Declared in Afxcmn.h

 

遇到问题:在论坛发了帖子,解决了。http://topic.csdn.net/u/20081225/11/83c3d669-dd33-4510-a7db-c614054a92cf.html

原创粉丝点击