1. Sivaprakash BKR
  2. PowerBuilder
  3. Thursday, 17 June 2021 07:11 AM UTC

Hello,

I want to display a toast notification from Powerbuilder desktop applications.  Is there any free tool or code snippet available ?

I saw PowerToast and PB Toolbox, which are very costly for this one component [ they offer a lot of other useful tools, but I'm interested in this tool only now ].

Happiness Always
BKR Sivaprakash

 

Roland Smith Accepted Answer Pending Moderation
  1. Monday, 21 June 2021 13:37 PM UTC
  2. PowerBuilder
  3. # 1

Chris:

I found that with Shell_NotifyIcon the window has to be hidden. When I hide the window, call Shell_NotifyIcon, then immediately show the window, the notification appears but the top says 'Microsoft.Explorer.Notification.{guid}'.

If I put a Sleep command before the show, the top part displays the Product Name property.

 

How do you get around this issue? I looked at your code and can't tell. Do you support toast notification when the window is visible?

I wonder if having a dummy hidden window just for this purpose would work?

 

Comment
  1. Chris Pollach @Appeon
  2. Monday, 21 June 2021 19:03 PM UTC
Hi Roland;

I found that this only worked for me when I ran this is as a separate App already in System Tray. I had this working in my framework a long time ago. Then just tweaked it a tad when I accidentally found that it appeared in the W10 notification area. Hence the W10 notification App was born (which also works on W8, W2016, 2019, etc as well BTW).

Let me know if you need help with my framework code on this to unravel the mystery. I wrote it a long time ago and would need to look at the code again to refreash my brain cells for an accurate answer. for you.

Regards ... Chris
  1. Helpful
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Friday, 18 June 2021 13:11 PM UTC
  2. PowerBuilder
  3. # 2

If you wish to use the Toast Notifications feature in Windows, then you'll need to be running Windows 8 or higher. Otherwise, you'll have to build/simulate your own.

https://docs.microsoft.com/en-us/windows/win32/shell/quickstart-sending-desktop-toast

Please note the prerequisites listed at the start of this documentation topic.

Best regards,
John

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 17 June 2021 17:59 PM UTC
  2. PowerBuilder
  3. # 3
Comment
  1. Sivaprakash BKR
  2. Friday, 18 June 2021 05:34 AM UTC
Thanks Roland,



I already thought about this, but could not understand how this utility will help me to display toast messages from a running desktop application(s) ?



  1. Helpful
  1. Sivaprakash BKR
  2. Friday, 18 June 2021 07:48 AM UTC
1. Copied n_icontray to my project

2. Declared n_icontray as io_icontray

3. Called io_tray.of_balloon_tip ( w_main, "Elifa", "Data Saved", Information!) from one of the events

Nothing gets displayed. w_main being my main MDI window.



Am I missing something ?

  1. Helpful
  1. Roland Smith
  2. Friday, 18 June 2021 13:03 PM UTC
The balloon tip only works when the window icon is in the tray. This works:



// add window icon to tray

in_tray.of_add_icon(Parent)



// create balloon tip

in_tray.of_balloon_tip(Parent, "PB Icontray", &

"Isn't this just the coolest?", Information!)



// remove window icon from tray

in_tray.of_delete_icon(Parent, True)



The of_add_icon function hides the window and then of_delete_icon shows it. I'll have to add an argument to of_add_icon to control the hide function.

  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 17 June 2021 17:02 PM UTC
  2. PowerBuilder
  3. # 4

Hi BKR;

  What about using the W10 "Notification" area? I have a free App for that build from the STD Framework, as follows: FYI: http://chrispollach.blogspot.com/2020/08/notification.html

You can see examples of W10 Notifications working here in these various demo applications ...

http://chrispollach.blogspot.com/2021/05/2021r2apps.html

HTH

Regards ... Chris

Comment
  1. Sivaprakash BKR
  2. Friday, 18 June 2021 05:34 AM UTC
Thanks Chris,



Going through this tool. It seems it works only with Win 10 .. most of our customers are still using Win 7.

  1. Helpful
  1. Chris Pollach @Appeon
  2. Friday, 18 June 2021 13:35 PM UTC
Oh dear .. MS EOL'ed that O/S a few years ago. Even the newer PB 's do not support W7 any more.
  1. Helpful
  1. Roland Smith
  2. Friday, 18 June 2021 14:38 PM UTC
Using Shell_NotifyIcon like my example and in Chris' example will work in older O/S. The window must be hidden when calling it in order for it to work.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.