winmain.f90

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

F90
45
字号
integer*4 function WinMain( hInstance, hPrevInstance, lpszCmdLine, nCmdShow )
!DEC$ IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_WinMain@16' :: WinMain
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'WinMain' :: WinMain
!DEC$ ENDIF
  use user32
  use kernel32
  use iflogm
  use calldlgGlobals
  implicit none
  integer*4 hInstance
  integer*4 hPrevInstance
  integer*4 lpszCmdLine
  integer*4 nCmdShow
  include 'resource.fd'
  external calldlgSub
  external calldlgStart
  ! Variables
  type (T_MSG)            mesg
  integer*4               ret
  logical*4               lret
  ghInstance = hInstance
  ghModule = GetModuleHandle(NULL)
  ghwndMain = NULL
  lret = DlgInit(IDD_CALLDLG_DIALOG, gdlg)
  if (lret == .FALSE.) goto 99999
  lret = DlgSetSub(gdlg, IDD_CALLDLG_DIALOG, calldlgSub)
  lret = DlgSetSub(gdlg, IDC_START, calldlgStart)
  lret = DlgModeless(gdlg, nCmdShow)
  if (lret == .FALSE.) goto 99999
  ! Read and process messsages
  do while( GetMessage (mesg, NULL, 0, 0) ) 
   if ( DlgIsDlgMessage(mesg) .EQV. .FALSE. ) then
     lret = TranslateMessage( mesg )
     ret  = DispatchMessage( mesg )
   end if
  end do
  call DlgUninit(gdlg)
  WinMain = mesg.wParam
  return
99999 &
  ret = MessageBox(ghwndMain, "Error initializing application calldlg"C,"Error"C, MB_OK)
  WinMain = 0
end function WinMain

⌨️ 快捷键说明

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