Second that response in the OS is possible in two ways, both with disabilities:
var f = new Form();
f.BackColor = Color.White;
f.FormBorderStyle = FormBorderStyle.None;
f.Bounds = Screen.PrimaryScreen.Bounds;
f.TopMost = true;
f.TransparencyKey = Color.White;
It is easy for the user to leave their application and not even notice with ALT+TAB, out of it won’t work. In other words, it’s a beautiful gambiarra.
Or you might not use one Form
. A code would simply be like this (it can be better written):
[DllImport("User32.dll")]
public static extern IntPtr GetDC(IntPtr hwnd);
[DllImport("User32.dll")]
public static extern void ReleaseDC(IntPtr hwnd, IntPtr dc);
...
IntPtr desktopPtr = GetDC(IntPtr.Zero);
Graphics g = Graphics.FromHdc(desktopPtr);
var b = new SolidBrush(Color.White);
g.FillRectangle(b, new Rectangle(0, 0, 1920, 1080)); //o algoritmo seria mais sofisticado
g.Dispose();
ReleaseDC(IntPtr.Zero, desktopPtr);
I put in the Github for future reference.
If the screen is updated, the drawing will disappear, you can go redesigning it.
In practice the solution is something much more sophisticated.
If I find any other method, I update here.
Did the answer solve what you were looking to know? Do you think you can accept it now? If not, you need something else to be improved?
– Maniero