I’m working on a windows application where the notification are to be displayed and they can be positioned as per user preference.
I have tried following approaches but they didn’t fit:
- Using Toast Notification but the limitation its position is static (lower right corner).
- Powershell notify Icon module but that also had same position behavior.
- Powershell Popup but it executing the script which looked like a good option but it created a new app in taskbar which is not required.
- VBS MsgBox approach but that also had similar taskbar app behavior as Pt 3.
Does one of the approach I tried needs some change to make it work or there is something other I can try?
Thanks in Advance!
2
Answers
To get your option 3 to work without the new window icon showing up in the taskbar, try this:
Here’s a custom notification HTA that can be sized and positioned from the command line. The HTML and CSS can be modified to change the look as desired. This example has no OK button, but that can be easily added. The code is JScript. It could also be written in VBScript, but since Microsoft is planning to remove VBScript some day, JScript is a better choice.
Usage:
msg.hta /x,y,width,height,message
msg.hta /500,500,300,150,"Hello world"
Explicit:
mshta.exe "C:Testmsg.hta" /500,500,320,150,"Hello world"
Msg.hta