Tray App no output

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 5 years and 2 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
apowershelluser
Posts: 194
Last visit: Mon Apr 15, 2024 3:21 pm
Answers: 2

Tray App no output

Post by apowershelluser »

  1. function LoadFile{
  2.     $global:File = test-path -path C:\Windows\Utilities\Sapien.zip
  3. }
  4. while ($true)
  5. {
  6.     LoadFile
  7.     if ($global:File -eq $false)
  8.     {
  9.         $Options = @(
  10.             "/E",
  11.             "/l"
  12.         )
  13.         $rclog = Robocopy "C:\users\tech\Documents\SAPIEN" \xxx $Options
  14.         $rclog | out-file C:\users\tech\Documents\SAPIEN\Filecount.txt
  15.         #Compress-Archive -Path C:\users\test\Documents\SAPIEN -DestinationPath C:\Windows\Utilities\Sapien.zip -CompressionLevel NoCompression -Update
  16.         Write-Host "Kompressor Completed..."
  17.     }
  18.     else {
  19.     }
  20.     Start-Sleep -Seconds 10
  21. }

I don't appear to be getting any toast notifications but I know they work as this example works just fine and my
https://www.addictivetips.com/windows-t ... indows-10/

and my .zip file is being created

I essentially want to zip my sapien folder to another directory and then have a toast notification stating it's complete.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Tray App no output

Post by jvierra »

Why would you need toast to tell you that when a folder can be compressed in a few seconds. It seems like overkill.
User avatar
apowershelluser
Posts: 194
Last visit: Mon Apr 15, 2024 3:21 pm
Answers: 2

Re: Tray App no output

Post by apowershelluser »

Regardless right?

The toast notification is not working for me :)
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Tray App no output

Post by jvierra »

Are you asking about "toast" or about "NotifyIcon"?
User avatar
apowershelluser
Posts: 194
Last visit: Mon Apr 15, 2024 3:21 pm
Answers: 2

Re: Tray App no output

Post by apowershelluser »

viewtopic.php?f=12&t=13048&p=69748&hili ... app#p69748

See the notifications that OlgaB produced? That’s what I want :)
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Tray App no output

Post by jvierra »

JohnTitor wrote: Tue Mar 26, 2019 2:52 pm viewtopic.php?f=12&t=13048&p=69748&hili ... app#p69748

See the notifications that OlgaB produced? That’s what I want :)
???? Olga B? She just posted the following:
""Hello,
I can't reproduce your issue. I created Tray app using your code. It works as expected.

Also it can be Windows issue. Try to re-start machine or re-logon
""
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Tray App no output

Post by jvierra »

If you posted the code used to open the notification it would be easier to understand what you are doing.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Tray App no output

Post by jvierra »

Here is an example of how to use NotifyIcon in a form:
Attachments
NotifyIcon Sample.psf
(59.63 KiB) Downloaded 121 times
User avatar
apowershelluser
Posts: 194
Last visit: Mon Apr 15, 2024 3:21 pm
Answers: 2

Re: Tray App no output

Post by apowershelluser »

jvierra wrote: Tue Mar 26, 2019 3:41 pm
JohnTitor wrote: Tue Mar 26, 2019 2:52 pm viewtopic.php?f=12&t=13048&p=69748&hili ... app#p69748

See the notifications that OlgaB produced? That’s what I want :)
???? Olga B? She just posted the following:
""Hello,
I can't reproduce your issue. I created Tray app using your code. It works as expected.

Also it can be Windows issue. Try to re-start machine or re-logon
""
I’m referring to the image she posted. Those are toast notifications correct?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Tray App no output

Post by jvierra »

Here is the documentation on the control: https://info.sapien.com/index.php/guis/ ... on-control.

Here is a full demo of how to use the control:
Attachments
NotifyIcon Sample.psf
(59.63 KiB) Downloaded 135 times
This topic is 5 years and 2 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked