Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than user32, prefix the name with the module name and a period.
Byval hWnd as IntPtr, _
<MarshalAs(UnmanagedType.LPStr)> ByVal lpText as StringBuilder, _
<MarshalAs(UnmanagedType.LPStr)> ByVal lpCaption as StringBuilder, _
<MarshalAs(UnmanagedType.U4)> ByVal uType as UInteger, _
<MarshalAs(UnmanagedType.U2)> ByVal wLanguage as Int16, _
<MarshalAs(UnmanagedType.U4)> ByVal dwMilliseconds as Int32, _
) as <MarshalAs(UnmanagedType.U4)> UInteger
End Function
VBA Signature:
Private Declare Function MessageBoxTimeOut _
Lib "user32.dll" Alias "MessageBoxTimeoutA" _
( _
Byval prmlngWindowHandle as Long, _
Byval prmstrMessage as String, _
Byval prmstrCaption as string, _
Byval prmlngType as long, _
Byval prmwLanguage as Integer, _
Byval prmdwMiliseconds as Long _
) as Integer
User-Defined Types:
use MessageBoxButtons.* enumeration for type argument, cast as integer.
Use enumeration for type aruments, cast as uint with Flags
Alternative Managed API:
Do you know one? Please contribute it!
Notes:
Returns 32000 if the messagebox timed out.
Tips & Tricks:
wLanguageID
The language for the text displayed in the message box button(s). Specifying a value of zero (0) indicates to display the button text in the default system language. If this parameter is MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), the current language associated with the calling thread is used.
private Shared Function DisplayMessageBox( _
ByVal hWnd as IntPtr, _
ByVal Message as string, _
ByVal Caption as string, _
ByVal MessageOptions as UInteger, _
Byval TimeOutMilliSeconds as Int32 _
) as Uinteger
return MessageBoxTimeOut(hWnd, New StringBuilder(Message), New StringBuilder(Caption), MessageBoxOptions,0, TimeOutMilliSeconds)
End Function
VBA Example
Public Function DisplayMessageBox( _
ByVal hWnd As Long, _
ByVal Message As String, _
ByVal Caption As String, _
ByVal MessageBoxOptions As Long, _
ByVal TimeOutMilliseconds As Long _
) As Integer
For reasons unknown, Microsoft has never documented the MessageBoxTimeout API located in user32.dll
12/23/2019 9:39:08 AM - -192.119.219.120
TODO - a short description
3/16/2007 7:31:57 AM - anfortas.geo@yahoo.com-216.204.61.86
Click to read this page
4/6/2008 7:23:14 AM - anonymous
Click to read this page
4/6/2008 7:23:14 AM - anonymous
TODO - a short description
12/7/2018 9:37:01 PM - -2.71.2.14
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).