{"id":20208271,"url":"https://github.com/cubiclesoft/messagebox-windows","last_synced_at":"2025-04-10T12:55:38.101Z","repository":{"id":145129330,"uuid":"146141825","full_name":"cubiclesoft/messagebox-windows","owner":"cubiclesoft","description":"A complete, robust command-line utility to construct calls to the MessageBox() and MessageBeep() Windows APIs.  Released under a MIT or LGPL license.","archived":false,"fork":false,"pushed_at":"2021-05-17T13:30:16.000Z","size":200,"stargazers_count":25,"open_issues_count":1,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T11:44:41.573Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cubiclesoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-26T01:25:52.000Z","updated_at":"2024-09-07T11:04:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"7fdbe1b0-2298-41e5-943b-12a4310c3729","html_url":"https://github.com/cubiclesoft/messagebox-windows","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Fmessagebox-windows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Fmessagebox-windows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Fmessagebox-windows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cubiclesoft%2Fmessagebox-windows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cubiclesoft","download_url":"https://codeload.github.com/cubiclesoft/messagebox-windows/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248221989,"owners_count":21067681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T05:34:52.363Z","updated_at":"2025-04-10T12:55:38.089Z","avatar_url":"https://github.com/cubiclesoft.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"MessageBox()/MessageBeep() Windows API Command-Line Utility\n===========================================================\n\nA complete, robust command-line utility to construct highly customized calls to the MessageBox() and MessageBeep() Windows APIs.  Released under a MIT or LGPL license.\n\nThis project is intended primarily for use from batch files (.bat) and other scripts to display a modal message dialog.  If it can be done with MessageBox(), it can be done with this command-line program.\n\nWhy would you need this?  To easily display native Windows message boxes from command-line scripts that also returns the user's response (i.e. which button was pressed).  Useful for handling critical application/script failures.\n\n[![Donate](https://cubiclesoft.com/res/donate-shield.png)](https://cubiclesoft.com/donate/) [![Discord](https://img.shields.io/discord/777282089980526602?label=chat\u0026logo=discord)](https://cubiclesoft.com/product-support/github/)\n\nFeatures\n--------\n\n* Command-line action!\n* Verbose mode tells you exactly how MessageBox() or MessageBeep() will be called.  No more guessing!\n* Pre-built binaries using Visual Studio (statically linked C++ runtime, minimal file size of ~85K, direct Win32 API calls).\n* Windows subsystem variant.\n* Unicode support.\n* Offers almost everything MessageBox() and MessageBeep() offers.\n* Has a liberal open source license.  MIT or LGPL, your choice.\n* Sits on GitHub for all of that pull request and issue tracker goodness to easily submit changes and ideas respectively.\n\nUseful Information\n------------------\n\nRunning the command with the `/?` option will display the options:\n\n```\n(C) 2021 CubicleSoft.  All Rights Reserved.\n\nSyntax:  messagebox.exe [options] [Text [Caption/Title]]\n\nOptions:\n        /v\n        Verbose mode.\n\n        /p\n        Parse Text for special escape sequences.\n        Only '\\n' and '\\\\' are supported.\n\n        /f=Buttons\n        Sets the buttons of the message box.\n        The 'Buttons' can be one of:\n        MB_ABORTRETRYIGNORE\n        MB_CANCELTRYCONTINUE\n        MB_OK (Default)\n        MB_OKCANCEL\n        MB_RETRYCANCEL\n        MB_YESNO\n        MB_YESNOCANCEL\n\n        /f=Icon\n        Sets the icon of the message box.\n        The 'Icon' can be one of:\n        MB_ICONERROR\n        MB_ICONWARNING\n        MB_ICONINFORMATION\n        MB_ICONQUESTION\n\n        /f=DefaultButton\n        Sets the default button for the message box.\n        The 'DefaultButton' can be one of:\n        MB_DEFBUTTON1 (Default)\n        MB_DEFBUTTON2\n        MB_DEFBUTTON3\n        MB_DEFBUTTON4\n\n        /f=Modality\n        Sets the modality for the message box.\n        The 'Modality' can be one of:\n        MB_APPLMODAL (Default)\n        MB_SYSTEMMODAL\n        MB_TASKMODAL\n\n        /f=MiscFlag\n        Sets the miscellaneous flags for the message box.\n        Multiple /f options can be specified.\n        Each 'MiscFlag' can be one of:\n        MB_SIMPLEBEEP (Only when Title is not used)\n        MB_HELP (Probably won't work)\n        MB_DEFAULT_DESKTOP_ONLY\n        MB_RIGHT\n        MB_RTLREADING\n        MB_SETFOREGROUND\n        MB_TOPMOST\n        MB_SERVICE_NOTIFICATION\n\n        /w=Milliseconds\n        The amount of time, in milliseconds, to wait.\n        The default behavior is to wait indefinitely.\n        This feature relies on an undocumented Windows API.\n```\n\nExample with verbose output:\n\n```\nC:\\\u003emessagebox.exe /v /f=MB_OKCANCEL /f=MB_ICONWARNING \"The application crashed.  See the log file for details.  Press OK to continue or Cancel to exit now.\" \"Oh Dear!\"\nArguments:\n        argv[0] = messagebox.exe\n        argv[1] = /v\n        argv[2] = /f=MB_OKCANCEL\n        argv[3] = /f=MB_ICONWARNING\n        argv[4] = The application crashed.  See the log file for details.  Press OK to continue or Cancel to exit now.\n        argv[5] = Oh Dear!\n\nMessageBox(\n        hWnd = 0x008F0D4A,\n        lpText = The application crashed.  See the log file for details.  Press OK to continue or Cancel to exit now.,\n        lpCaption = Oh Dear!,\n        uType = MB_OKCANCEL | MB_ICONWARNING | MB_DEFBUTTON1 | MB_APPLMODAL\n);\n```\n\nWhich waits for the message box to be closed and returns the return code of the selected button.\n\nWindows Subsystem Variant\n-------------------------\n\nWhile `messagebox.exe` is intended for use with console apps, `messagebox-win.exe` is intended for detached console and GUI applications.  Starting `messagebox.exe` in certain situations will briefly flash a console window before displaying the error message.  Calling `messagebox-win.exe` instead will no longer show the console window.\n\nWhy not just use `messagebox-win.exe`?  Since `messagebox-win.exe` starts as a Windows GUI application, there is the tendency for it to be run in the background and the message box that displays may not behave as a modal dialog.  The software is a little bit trickier to work with as a result.  It's also a few KB larger than `messagebox.exe`.\n\nThere is one additional option specifically for `messagebox-win.exe` called `/attach` which attempts to attach to the console of the parent process (if any).\n\nSources\n-------\n\nThe MessageBox() and MessageBeep() APIs on MSDN Library have the intimate details on each option:\n\n* https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-messagebox\n* https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-messagebeep\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcubiclesoft%2Fmessagebox-windows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcubiclesoft%2Fmessagebox-windows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcubiclesoft%2Fmessagebox-windows/lists"}