【发布时间】:2015-01-31 03:33:20
【问题描述】:
因此,我正在寻找一种仅使用本机库在 Python 中创建简单消息框的方法,并遇到了几篇文章,但即 this one,利用 ctypes 导入 win32.dll 并调用其 MessageboxA 函数。
import ctypes # An included library with Python install.
ctypes.windll.user32.MessageBoxA(0, "Your text", "Your title", 1)
我觉得很酷的东西。
--- 但是---
当我查看documentation for MessageboxA on Microsoft's site 时,发现这个MessageboxA 函数可以做更多的事情。我只是不知道如何正确传递参数。
我正在尝试找出提升带有图标的消息框的标准方法,例如消息旁边的 systemhand 或警告图标。 Microsoft 的文档表明应该将其输入到 uType 参数中,这是最后一个参数,但除了更改消息框的按钮之外,我无法在此处取得任何进展。
【问题讨论】:
标签: python dll ctypes messagebox