calldlgstart.f90

来自「Intel Visual Fortran 应用程序开发 周振红编著」· F90 代码 · 共 41 行

F90
41
字号
SUBROUTINE calldlgStart( dlg, id, callbacktype )
  use iflogm
  use ProgressBox
  implicit none
  ! Arguments
  type (dialog) dlg
  integer id, callbacktype
  ! Variables
  include 'resource.fd'
  type (PBContext) context
  integer iret
  logical lret
  integer progress
  logical bCancelled
  if (callbacktype == dlg_clicked) then
    ! Change the dialog message
    lret = DlgSet( dlg, IDC_MESSAGE, "执行..." )
    call DlgFlush( dlg )
    ! Create the progress dialog box
    ! We specify the main dialog as the parent window
    iret = DisplayProgressBox( context, dlg % hwnd,"DLL中的对话框", .TRUE.) 
    if ( iret == PBStatus_OK ) then
      bCancelled = .FALSE.
      progress = 0
      ! Perform the work, updating the progress bar as we go along...
      do while ( ( bCancelled == .FALSE. ) .and. ( progress < 101 ) )
        iret = SetProgress ( context, progress )
        if ( iret == PBStatus_Aborted ) then
          bCancelled = .TRUE.
        else
          call sleepqq(250)		! Wait .25 seconds, 100 times
        end if
        progress = progress + 1
      end do
      ! Destroy the progress box
      iret = DestroyProgressBox( context )
    end if
    ! Change the dialog message
    lret = DlgSet( dlg, IDC_MESSAGE, "点击'启动'按钮以执行任务" )
  endif
END SUBROUTINE calldlgStart

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?