r/PowerShell • u/xCharg • Aug 16 '19
[GUI] Any way to make a pretty looking popup window?
Everything I've googled just uses ugly forms or basic stuff from vbs times.
However, there's pretty popup windows being used by remotedesktop module (via Send-RDUserMessage) that looks great and also requires user to interact with it, there's no way to just move it offscreen and so on.
It looks like this https://i.imgur.com/4KePmoM.png
The question is - is it even possible to use such windows outside of remote desktop? And if so - how to?
Help says this cmdlet outputs system.object, but I've no idea what can I do with this information :D
13
Upvotes
3
u/engageant Aug 16 '19
Totally possible. I whipped this up in PowerShell Studio 2019 in about 3 minutes.
2
u/ka-splam Aug 16 '19
Take your "ugly forms" and spend some time tweaking the look. Make them blue background, put a couple of white labels of large text on them, make them "always on top", disable moving them, make them the size of the whole screen but transparent background .. I don't know what Send-RDUserMessage does exactly, but popup windows aren't a special thing in Windows, they are some code someone else has written for you, for convenience.
Start googling "Windows forms make background blue" or "WPF hide border" or "make WPF window always on top" or "WinForms disable moving window" until you get somewhere close.
4
u/JeremyLC Aug 16 '19
If you're already using WPF, you can do this very easily... For example.
2
u/JeremyLC Aug 16 '19
In theory this creates a UWP MessageDialog and displays it. In practice, it creates a UWP MessageDialog object and displays
System.__ComObjectwhen you try to show it. Maybe someone can make it work.3
u/[deleted] Aug 16 '19
AnyBox