Is there a hidden method and/or something on the shared GIT stuff which would allow a uniface component to send a message to the windows notification tray.
We did write a VB dll to access the NotifyIcon class, but access to this has stopped working and my VB expert is on maternity leave.
If there were a standard method, that would be lovely.
Regards,
Iain
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
We did write a VB dll to access the NotifyIcon class, but access to this has stopped working and my VB expert is on maternity leave.
If there were a standard method, that would be lovely.
Regards,
Iain
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
Page 1 / 1
Is there a hidden method and/or something on the shared GIT stuff which would allow a uniface component to send a message to the windows notification tray.
We did write a VB dll to access the NotifyIcon class, but access to this has stopped working and my VB expert is on maternity leave.
If there were a standard method, that would be lovely.
Regards,
Iain
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
We did write a VB dll to access the NotifyIcon class, but access to this has stopped working and my VB expert is on maternity leave.
If there were a standard method, that would be lovely.
Regards,
Iain
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
------------------------------
Jean-Marc Salis
Mp Services
Montauban Cedex FR
------------------------------
Well, I don't know at all if this will work in an Uniface HTML widget, and there's a good chance I'm gonna make a fool of myself, but what about using the javascript notification API ?
------------------------------
Jean-Marc Salis
Mp Services
Montauban Cedex FR
------------------------------
------------------------------
Jean-Marc Salis
Mp Services
Montauban Cedex FR
------------------------------
I'm looking for something which could be used to alert the user to look at the Uniface app even if they are not currently, and which doesn't require clicking on to move on with the uniface code (so, exactly like the 'new mail' popup in the bottom right of the windows screen (task bar "NotifyIcon" functionality).
If there's javascript which can trigger this popup, my google fu is inadequate to the task of finding it.
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
I looked at that, but I think that puts a notification up over the HTML displayed widget, and if the application is out of focus behind something else, or minimised then it won't show. (Assuming we mean 'alert').
I'm looking for something which could be used to alert the user to look at the Uniface app even if they are not currently, and which doesn't require clicking on to move on with the uniface code (so, exactly like the 'new mail' popup in the bottom right of the windows screen (task bar "NotifyIcon" functionality).
If there's javascript which can trigger this popup, my google fu is inadequate to the task of finding it.
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
I'm looking for something which could be used to alert the user to look at the Uniface app even if they are not currently, and which doesn't require clicking on to move on with the uniface code (so, exactly like the 'new mail' popup in the bottom right of the windows screen (task bar "NotifyIcon" functionality).
If there's javascript which can trigger this popup, my google fu is inadequate to the task of finding it.
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
https://www.javascripttutorial.net/web-apis/javascript-notification/
With it, in a browser (and with the authorization) you can trigger OS notifications (tried it on Debian/GNOME and Windows). Depending on the possibilities of the browser/widget, you can also add an icon.
But it will be very dependant on the widget, and I'm not even sure it's possible :-)
(My Uniface HTML widget fu are very low)
------------------------------
Jean-Marc Salis
Mp Services
Montauban Cedex FR
------------------------------
Is there a hidden method and/or something on the shared GIT stuff which would allow a uniface component to send a message to the windows notification tray.
We did write a VB dll to access the NotifyIcon class, but access to this has stopped working and my VB expert is on maternity leave.
If there were a standard method, that would be lovely.
Regards,
Iain
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
We did write a VB dll to access the NotifyIcon class, but access to this has stopped working and my VB expert is on maternity leave.
If there were a standard method, that would be lovely.
Regards,
Iain
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
VB script can be replaced by powershell command, and you can find on google many examples like :
powershell -Command "Add-Type -AssemblyName System.Windows.Forms ; $global:balloon = New-Object System.Windows.Forms.NotifyIcon ;$path = (Get-Process -id $pid).Path;$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) ;$balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Warning ;$balloon.BalloonTipText = 'What do you think of this balloon tip?';$balloon.BalloonTipTitle = \\"Attention $Env:USERNAME\\" ;$balloon.Visible = $true ;$balloon.ShowBalloonTip(5000)"
You can run this by spawn or oscommand ... it's a bit longer but it works...ATTENTION : Do not use powershell script, it's block by Windows security...
Gilles .
------------------------------
Hortion Gilles
Agfa-Gevaert NV
------------------------------
Hi,
VB script can be replaced by powershell command, and you can find on google many examples like :
ATTENTION : Do not use powershell script, it's block by Windows security...
Gilles .
------------------------------
Hortion Gilles
Agfa-Gevaert NV
------------------------------
VB script can be replaced by powershell command, and you can find on google many examples like :
powershell -Command "Add-Type -AssemblyName System.Windows.Forms ; $global:balloon = New-Object System.Windows.Forms.NotifyIcon ;$path = (Get-Process -id $pid).Path;$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) ;$balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Warning ;$balloon.BalloonTipText = 'What do you think of this balloon tip?';$balloon.BalloonTipTitle = \\"Attention $Env:USERNAME\\" ;$balloon.Visible = $true ;$balloon.ShowBalloonTip(5000)"
You can run this by spawn or oscommand ... it's a bit longer but it works...ATTENTION : Do not use powershell script, it's block by Windows security...
Gilles .
------------------------------
Hortion Gilles
Agfa-Gevaert NV
------------------------------
trigger detail
variables
string v_sql, v_line
endvariables
debug
v_sql = "powershell -Command %%"Add-Type -AssemblyName System.Windows.Forms ;"
v_sql = $concat(v_sql," $global:balloon = New-Object System.Windows.Forms.NotifyIcon ;")
v_sql = $concat(v_sql," $path = (Get-Process -id $pid).Path;")
v_sql = $concat(v_sql,"$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) ;")
v_sql = $concat(v_sql,"$balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Warning ;")
v_sql = $concat(v_sql,"$balloon.BalloonTipText = 'What do you think of this balloon tip?';")
v_sql = $concat(v_sql,"$balloon.BalloonTipTitle = 'Attention $Env:USERNAME' ;")
v_sql = $concat(v_sql,"$balloon.Visible = $true ;")
v_sql = $concat(v_sql,"$balloon.ShowBalloonTip(5000)%%"")
activate "SYS_OSCOMMAND".COMMANDOUT(v_sql, v_line)
Which sets v_sql =
powershell -Command "Add-Type -AssemblyName System.Windows.Forms ; $global:balloon = New-Object System.Windows.Forms.NotifyIcon ; $path = (Get-Process -id $pid).Path;$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) ;$balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Warning ;$balloon.BalloonTipText = 'What do you think of this balloon tip?';$balloon.BalloonTipTitle = 'Attention $Env:USERNAME' ;$balloon.Visible = $true ;$balloon.ShowBalloonTip(5000)"
Running this from the command prompt does the popup. Running it from the OSCOMMAND signature, does nothing, and returns $status=0 and nothing in v_line)
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
Hmm, I put this in the following code into my test form (single command button).
Which sets v_sql =
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
trigger detail
variables
string v_sql, v_line
endvariables
debug
v_sql = "powershell -Command %%"Add-Type -AssemblyName System.Windows.Forms ;"
v_sql = $concat(v_sql," $global:balloon = New-Object System.Windows.Forms.NotifyIcon ;")
v_sql = $concat(v_sql," $path = (Get-Process -id $pid).Path;")
v_sql = $concat(v_sql,"$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) ;")
v_sql = $concat(v_sql,"$balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Warning ;")
v_sql = $concat(v_sql,"$balloon.BalloonTipText = 'What do you think of this balloon tip?';")
v_sql = $concat(v_sql,"$balloon.BalloonTipTitle = 'Attention $Env:USERNAME' ;")
v_sql = $concat(v_sql,"$balloon.Visible = $true ;")
v_sql = $concat(v_sql,"$balloon.ShowBalloonTip(5000)%%"")
activate "SYS_OSCOMMAND".COMMANDOUT(v_sql, v_line)
Which sets v_sql =
powershell -Command "Add-Type -AssemblyName System.Windows.Forms ; $global:balloon = New-Object System.Windows.Forms.NotifyIcon ; $path = (Get-Process -id $pid).Path;$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) ;$balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Warning ;$balloon.BalloonTipText = 'What do you think of this balloon tip?';$balloon.BalloonTipTitle = 'Attention $Env:USERNAME' ;$balloon.Visible = $true ;$balloon.ShowBalloonTip(5000)"
Running this from the command prompt does the popup. Running it from the OSCOMMAND signature, does nothing, and returns $status=0 and nothing in v_line)
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
spawn "powershell -Command %%"Add-Type -AssemblyName System.Windows.Forms ; $global:balloon = New-Object System.Windows.Forms.NotifyIcon ;$path = (Get-Process -id $pid).Path;$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) ;$balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Warning ;$balloon.BalloonTipText = 'What do you think of this balloon tip?';$balloon.BalloonTipTitle = \\%%"Attention $Env:USERNAME\\%%" ;$balloon.Visible = $true ;$balloon.ShowBalloonTip(5000)%%""
Work also with oscommand by adding cmd /c :
activate "OSCOMMAND".command("cmd /c powershell -Command %%"Add-Type -AssemblyName System.Windows.Forms ; $global:balloon = New-Object System.Windows.Forms.NotifyIcon ;$path = (Get-Process -id $pid).Path;$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) ;$balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Warning ;$balloon.BalloonTipText = 'What do you think of this balloon tip?';$balloon.BalloonTipTitle = \\%%"Attention $Env:USERNAME\\%%" ;$balloon.Visible = $true ;$balloon.ShowBalloonTip(5000)%%"")
------------------------------
Hortion Gilles
Agfa-Gevaert NV
------------------------------
Hi,
------------------------------
Hortion Gilles
Agfa-Gevaert NV
------------------------------
spawn "powershell -Command %%"Add-Type -AssemblyName System.Windows.Forms ; $global:balloon = New-Object System.Windows.Forms.NotifyIcon ;$path = (Get-Process -id $pid).Path;$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) ;$balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Warning ;$balloon.BalloonTipText = 'What do you think of this balloon tip?';$balloon.BalloonTipTitle = \\%%"Attention $Env:USERNAME\\%%" ;$balloon.Visible = $true ;$balloon.ShowBalloonTip(5000)%%""
Work also with oscommand by adding cmd /c :
activate "OSCOMMAND".command("cmd /c powershell -Command %%"Add-Type -AssemblyName System.Windows.Forms ; $global:balloon = New-Object System.Windows.Forms.NotifyIcon ;$path = (Get-Process -id $pid).Path;$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) ;$balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Warning ;$balloon.BalloonTipText = 'What do you think of this balloon tip?';$balloon.BalloonTipTitle = \\%%"Attention $Env:USERNAME\\%%" ;$balloon.Visible = $true ;$balloon.ShowBalloonTip(5000)%%"")
------------------------------
Hortion Gilles
Agfa-Gevaert NV
------------------------------
Haven't tried the javascript above yet though (more complex setup).
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
Yup, they are working, but they both show big black windows due to the cmd. I've tried /q but I can't see a cmd switch which prevents the window.
Haven't tried the javascript above yet though (more complex setup).
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
Haven't tried the javascript above yet though (more complex setup).
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
create a notification.bat :
powershell -windowstyle hidden -Command "Add-Type -AssemblyName System.Windows.Forms ; $global:balloon = New-Object System.Windows.Forms.NotifyIcon ;$path = (Get-Process -id $pid).Path;$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) ;$balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Warning ;$balloon.BalloonTipText = 'What do you think of this balloon tip?';$balloon.BalloonTipTitle = \\"Attention $Env:USERNAME\\" ;$balloon.Visible = $true ;$balloon.ShowBalloonTip(5000)"
create a notification.vbs file that calls the notification.bat file:
Set WinScriptHost = CreateObject("WScript.Shell")
WinScriptHost.Run Chr(34) & "notification.bat" & Chr(34), 0
Set WinScriptHost = Nothing
then call notification.vbs:
spawn "notification.vbs"
------------------------------
Hortion Gilles
Agfa-Gevaert NV
------------------------------
I was more thinking of something like that :
https://www.javascripttutorial.net/web-apis/javascript-notification/
With it, in a browser (and with the authorization) you can trigger OS notifications (tried it on Debian/GNOME and Windows). Depending on the possibilities of the browser/widget, you can also add an icon.
But it will be very dependant on the widget, and I'm not even sure it's possible :-)
(My Uniface HTML widget fu are very low)
------------------------------
Jean-Marc Salis
Mp Services
Montauban Cedex FR
------------------------------
https://www.javascripttutorial.net/web-apis/javascript-notification/
With it, in a browser (and with the authorization) you can trigger OS notifications (tried it on Debian/GNOME and Windows). Depending on the possibilities of the browser/widget, you can also add an icon.
But it will be very dependant on the widget, and I'm not even sure it's possible :-)
(My Uniface HTML widget fu are very low)
------------------------------
Jean-Marc Salis
Mp Services
Montauban Cedex FR
------------------------------
https://www.javascripttutorial.net/sample/webapis/notification/
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
well,
create a notification.bat :
------------------------------
Hortion Gilles
Agfa-Gevaert NV
------------------------------
create a notification.bat :
powershell -windowstyle hidden -Command "Add-Type -AssemblyName System.Windows.Forms ; $global:balloon = New-Object System.Windows.Forms.NotifyIcon ;$path = (Get-Process -id $pid).Path;$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) ;$balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Warning ;$balloon.BalloonTipText = 'What do you think of this balloon tip?';$balloon.BalloonTipTitle = \\"Attention $Env:USERNAME\\" ;$balloon.Visible = $true ;$balloon.ShowBalloonTip(5000)"
create a notification.vbs file that calls the notification.bat file:
Set WinScriptHost = CreateObject("WScript.Shell")
WinScriptHost.Run Chr(34) & "notification.bat" & Chr(34), 0
Set WinScriptHost = Nothing
then call notification.vbs:
spawn "notification.vbs"
------------------------------
Hortion Gilles
Agfa-Gevaert NV
------------------------------
So I did some playing around, and there are a couple of things I thought would be useful to add to the code above.
params
numeric p_delay : IN
string p_heading : IN
string p_message : IN
string p_icon : IN
endparams
variables
string v_sql, v_line
numeric v_status
handle v_shell
endvariables
if(p_delay = "" | p_delay = 0)
p_delay = 5000
else
p_delay = p_delay*1000
endif
v_sql = "powershell -windowstyle hidden -Command %%"Add-Type -AssemblyName System.Windows.Forms ;"
v_sql = $concat(v_sql," $global:balloon = New-Object System.Windows.Forms.NotifyIcon ;")
v_sql = $concat(v_sql," $path = (Get-Process -id $pid).Path;")
v_sql = $concat(v_sql," $balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) ;")
v_sql = $concat(v_sql," $balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::None ;")
v_sql = $concat(v_sql," $balloon.BalloonTipText = '",$replace(p_message,1,"'","\\'",-1),"';")
v_sql = $concat(v_sql," $balloon.BalloonTipTitle = '",p_heading,"' ;")
v_sql = $concat(v_sql," $balloon.Visible = $true ;")
v_sql = $concat(v_sql," $balloon.ShowBalloonTip(",p_delay,");")
v_sql = $concat(v_sql," Start-Sleep -Milliseconds ",p_delay,";")
v_sql = $concat(v_sql," $global:balloon.Dispose();%%"")
newinstance "WSH_WSHSHELL",v_shell
v_shell->run(v_status,v_sql,0,0)
deleteinstance v_shell
Notes:-
- It seems the variable delay for notifications is deprecated, and now based on system accessibility settings. So all the p_delay in here is (basically) pointless.
- The code above left an icon in the system tray, which vanished on mouse over, but it was stacking icons up if left to run several times. So I instituted the $global:balloon.Dispose() to clear it. However, this seems to get rid of the resources before it can display the icon for the application, so I put in the Sleep command to keep the NotifyIcon around long enough to display the tooltip properly.
- Finally, I remembered we'd implemented the shell dll as a signature I could use the Wshell.run command rather than using files.
- This was to cope with the fact that I wanted to remove the files after use, and couldn't get it to delete itself, and/or get the timing right on deleting them from the app.
This is now working, as required, thank you.
Iain
------------------------------
Iain Sharp
Head of Technical Services
Pci Systems Ltd
Sheffield GB
------------------------------
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.