Skip to main content

A simple wrapper for Windows' MessageBoxW in Python

Project description

winmsgbox

A simple wrapper of Windows' MessageBoxW function written in Python to display message boxes.

Features

  • Display native Windows message boxes from Python
  • Choose button sets, icons, default buttons, modality, and more
  • Typed constants for easy configuration

Requirements

  • Windows OS
  • Python 3.x

Installation

Simply install using pip install winmsgbox

Usage

from winmsgbox import MessageBox, Buttons, Icon, DefaultButton, Modal, Flags, Response

result = MessageBox(
    title="Hello",
    text="This is a message box.",
    buttons=Buttons.OkCancel,
    icon=Icon.Information,
    defaultButton=DefaultButton.First,
    modal=Modal.ApplModal,
    flags=Flags.SetForeground
)

if result == Response.Ok:
    print("User clicked OK")
elif result == Response.Cancel:
    print("User clicked Cancel")

API Reference

MessageBox

MessageBox(
    title="",
    text="",
    buttons=Buttons.Ok,
    icon=Icon.Empty,
    defaultButton=DefaultButton.First,
    modal=Modal.ApplModal,
    flags=0x00000000,
    window=0
) -> int

Displays a Windows message box with the specified parameters. Returns an integer corresponding to the button clicked.

Constants

  • Buttons: Ok, OkCancel, AbortRetryIgnore, YesNoCancel, YesNo, RetryCancel, CancelTryContinue
  • Icon: Empty, Error, Question, Warning, Information
  • DefaultButton: First, Second, Third, Fourth
  • Modal: ApplModal, SystemModal, TaskModal
  • Flags: DefaultDesktopOnly, Right, RtlReading, SetForeground, TopMost, ServiceNotification
  • Response: Ok, Cancel, Abort, Retry, Ignore, Yes, No, TryAgain, Continue

License

GNU AGPL v3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

winmsgbox-1.0.0.tar.gz (36.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

winmsgbox-1.0.0-py3-none-any.whl (25.8 kB view details)

Uploaded Python 3

File details

Details for the file winmsgbox-1.0.0.tar.gz.

File metadata

  • Download URL: winmsgbox-1.0.0.tar.gz
  • Upload date:
  • Size: 36.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for winmsgbox-1.0.0.tar.gz
Algorithm Hash digest
SHA256 990dd4da0b2dc2e4640b796611ed9d3fbc13b1a96deab29654d4be3b5f72c8f9
MD5 8b9c1af07ffd80b5441aa9d3179aabe3
BLAKE2b-256 71e7fb151a93c741844e9d74302758681e0b59b5f1b73656cdf441d76df18f2c

See more details on using hashes here.

File details

Details for the file winmsgbox-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: winmsgbox-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 25.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for winmsgbox-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f855a77eb6ad49883d05e8390d45b54e0660190d78e06802668ce61854ccde80
MD5 9297300a45695b7e7a95f602558503ac
BLAKE2b-256 d8be57f8ee12022b637c198caecac932807323f1b23c21e4a55de7a8aff4093e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page