Skip to main content

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

Metadata

Release files for winmsgbox 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for winmsgbox 1.0.1
File Size Uploaded
winmsgbox-1.0.1.tar.gz 36.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for winmsgbox 1.0.1
File Interpreter ABI Platform
winmsgbox-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 62.5 kB

Release files / winmsgbox-1.0.1.tar.gz

Download URL winmsgbox-1.0.1.tar.gz
Size 36.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e17b9a4a0e6fccc71f7e1f2a3112cf2a30fc9d5b0256c679c4a7bddd665a33b9
BLAKE2b-256 checksum
How to use checksums
be776d7f8c69a8640d1bc9ae643fe975eb12112da34ec8fc27f374631920e2eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / winmsgbox-1.0.1-py3-none-any.whl

Download URL winmsgbox-1.0.1-py3-none-any.whl
Size 25.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9af7704016104b443102e8285136c3f81d2444b7d35301c84aa843e68beae543
BLAKE2b-256 checksum
How to use checksums
15847ffa0b301e8a71480205996174ef23945c0fec7bbc1f299c521f52c17d14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page