There is a Windows API function that will create a self-closing message box based on a timer - WTSSendMessageA function. Refer to the function's Timeout argument. You can obtain the session id of your own session by calling the ProcessIdToSessionId function.
Self-closing MessageBox
What would the code look like that displays a message that will close in 5 seconds?
I'm interested in Win32 functions, not the capabilities of programming languages (C#, C++, etc.).
Windows development | Windows API - Win32
4 answers
Sort by: Most helpful
-
Castorix31 91,866 Reputation points2024-09-09T13:27:50.5566667+00:00 There is an old MS sample in the KB (https://ftp.zx.net.nz/pub/Patches/ftp.microsoft.com/MISC/KB/en-us/181/934.HTM)
-
RLWA32 52,366 Reputation points2024-09-12T15:19:34.23+00:00 If you are willing to write some code a timed message box can also be implemented using the TaskDialogIndirect function to take advantage of its built-in timer and callback feature.
TDF_CALLBACK_TIMER Indicates that the task dialog's callback is to be called approximately every 200 milliseconds. -
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
1 deleted comment
Comments have been turned off. Learn more