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

Need the Interface for Win32 MessageBoxTimeout

MikeWinsteps
Novice
1,183 Views

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 Kudos
3 Replies
GVautier
New Contributor II
1,174 Views

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 Kudos
mfinnis
New Contributor II
1,155 Views

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
Novice
1,118 Views

Thanks - simple. Yes, that works at compile time

0 Kudos
Reply