Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29589 토론

Need the Interface for Win32 MessageBoxTimeout

MikeWinsteps
초보자
2,096 조회수

Hi Folks, this looks a simple challenge, but can't get it to work. Here is my effort for 64-bit IFORT, but it doesn't work. Any suggestions?

INTERFACE
FUNCTION MessageBoxTimeOut( &
hWnd, &
lpText, &
lpCaption, &
uType, &
wLanguageId, &
dwMilliseconds )
use ifwinty
integer(SINT) :: MessageBoxTimeOut ! int
!DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'MessageBoxTimeOutA' :: MessageBoxTimeOut
integer(8) hWnd ! HWND hWnd
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpText
character*(*) lpText ! LPCSTR lpText
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpCaption
character*(*) lpCaption ! LPCSTR lpCaption
integer(UINT) uType ! UINT uType
INTEGER*2 wLanguageId
INTEGER*4 dwMilliseconds
END FUNCTION
END INTERFACE

0 포인트
3 응답
GVautier
새로운 기여자 III
2,087 조회수

Hello

This is an undocumented function.

It is identical to the MessageBox API definition except it has two more parameters, wLanguageID and dmMilliseconds.

So copy the MessageBox function interface and add the two extra parameters.

https://community.embarcadero.com/article/technical-articles/149-tools/5792-undocumented-messageboxtimeout-function

 

0 포인트
mfinnis
새로운 기여자 III
2,068 조회수

The function name is MessageBoxTimeoutA (lower case o)

  interface
      function MessageBoxTimeout(hWnd,lpText,lpCaption,uType,wLanguageId,dwMilliseconds)
      use ifwinty
      integer(SINT) :: MessageBoxTimeOut
!DEC$ ATTRIBUTES DEFAULT, STDCALL, DECORATE, ALIAS:'MessageBoxTimeoutA' :: MessageBoxTimeout
      integer(HANDLE) :: hWnd
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpText
      character*(*) :: lpText
!DEC$ ATTRIBUTES REFERENCE, ALLOW_NULL :: lpCaption
      character*(*) :: lpCaption
      integer(UINT) :: uType
      integer(WORD) :: wLanguageId
      integer(DWORD) :: dwMilliseconds
      end function
  end interface
MikeWinsteps
초보자
2,031 조회수

Thanks - simple. Yes, that works at compile time

0 포인트
응답