This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
def main(): | |
WS_EX_TOPMOST = 0x40000 | |
windowTitle = "Python Windows Message Box Test" | |
message = "Hello, world! This Message box was created by calling the Windows API using the ctypes library." | |
# display a message box; execution will stop here until user acknowledges | |
ctypes.windll.user32.MessageBoxExW(None, message, windowTitle, WS_EX_TOPMOST) | |
print("User clicked OK.") | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This sample Python script will display a Windows API message box: