A few (maybe several) months ago I introduced WPF Message Boxes for QB64 as either a forum post or a post to the QB64 Github. I think it is lost to the wind, now. Since then, I've made many changes to it and have gotten it to the point now where it can be a beautiful little replacer for the standard error messages that QB64 gives for invalid handle and whatnot (see attached screenshot).
I've updated my code to handle all the defined errors listed on
https://www.qb64.org/wiki/ERROR_Codes and show a "fake BSOD" message like the attached with the error code, details, and the website to see more info. Pressing Yes will allow the program to attempt to continue just like the old messages did. Pressing No currently calls SYSTEM to shut the program down rather than using END. (I'm not a fan of using END. I like SYSTEM better.)
The below code is used in the main module of your program near the top. Any defined error should call the message box function that I made and show you a pretty, always-on-top message box.
Download all the attached files and '$INCLUDE WPFMessageBox.BI at the top and WPFMessageBox.BM at the bottom of your programs. New-WPFMessageBox.ps1.bin.bas is a file already '$INCLUDEd in WPFMessageBox.BI and creates the New-WPFMessageBox.ps1 at runtime if it doesn't already exist. My Github page for this project is located at
https://github.com/SpriggsySpriggs/WPFMessageBoxQB64 and I update it as frequently as I can.