Extended KotD #20: _NOTIFYPOPUP - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: Official Links (https://qb64phoenix.com/forum/forumdisplay.php?fid=16) +--- Forum: Learning Resources and Archives (https://qb64phoenix.com/forum/forumdisplay.php?fid=13) +---- Forum: Keyword of the Day! (https://qb64phoenix.com/forum/forumdisplay.php?fid=49) +---- Thread: Extended KotD #20: _NOTIFYPOPUP (/showthread.php?tid=2843) |
Extended KotD #20: _NOTIFYPOPUP - SMcNeill - 07-01-2024 Onwards and backwards, as we're now down to the new version 3.4+ keywords! To start with, let's just start at the top of the list and discuss _NotifyPopUp. Wiki entry: https://qb64phoenix.com/qb64wiki/index.php/NOTIFYPOPUP Syntax: _NOTIFYPOPUP [title$][, message$][, iconType$] Not at all like our last keyword (BACK! BACK, EVIL _UCHARPOS!! BACK, I SAY!!), this one is rather simple to make use of and understand. A simple SUB, this command will sent one of those annoying little pop-up notifications to your PC, that we all love to hate. You know the ones I'm talking about -- those little square boxes that usually pop up over in some corner of the screen saying junk like, "Your Firewall is Turned Off. Do you want to fix it now?". Or, "We've discovered an update for Spammy Spam-Spam! Would you like to enable it now?" Or, "Download finished at 1:13:47AM." Yeah... This creates THOSE annoying little notification pop-ups. Usage is simple enough that it's almost a waste to go over it. Call the command, supply it a few parameters. Presto -- done!! So what is the command and those parameters?? _NOTIFYPOPUP [title$][, message$][, iconType$] _NOTIFYPOPUP -- the name of the command! (Phew! That was hard to explain!) title$ -- the title that appears at the top of the notification. message$ -- the body of text that makes up the message for the notification. icontype$ -- "info", "error", ot "warning". Choose from one of those three so your notification will have the corresponding gpahiic stamped on it. Code: (Select All) _NOTIFYPOPUP "My Cool App", "Conversion complete!", "info" Run the above and it'll either do something.... or it won't. If you have notifications turned off, or "Do Not Disturb" turned on, then your system will simply ignore the command and not bother you. It's not that you did anything wrong, or that the command doesn't work -- it's just that you've disabled notifications and can't recieve them. (Think of it as turning off your phone and then someone trying to call you... Nothing happens on your end as the phone is off; but that doesn't mean the other person's phone isn't dialing out, or working as it's supposed to. You're just not responding to it.) If notifications are on, and "Do not disturb" is off, then you should see one of those annoying little pop-ups appear at the corner of your screen telling you that an imaginary conversion is now completed. And that's all there is to it, in a nutshell. RE: Extended Kotd #20: _NotifyPopUp - bplus - 07-01-2024 aH NOW I know why I didn't remember this keyword, MessageBox seems so much better if one was to bother to get essential info out to the user. RE: Extended Kotd #20: _NOTIFYPOPUP - OldMoses - 07-02-2024 I actually like this one and have used it a bit. If I'm saving something to a file, I'll use this as feedback to let me know that things went according to plan. RE: Extended KotD #20: _NOTIFYPOPUP - bplus - 07-02-2024 Yeah I do that too but I want to know my user (and myself) sees it. |