Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Safe screen
#3
Code:
Copy      Help
// script "Curtain.cs"
wnd w;
using (new Curtain()) {
    1.s();
    w = wnd.runAndFind(() => { run.it(@"notepad.exe"); }, 30, "*Notepad", "Notepad");
    mouse.click(wnd.active);
    1.s();
}

2.s();
w.Close();

/// <summary>
///
Shows a mouse-transparent window that covers all screens.
/// The window is on top of other windows, except those shown on top of it afterwards (eg menus).
/// The window disappears when disposing the object or when the input desktop changed (Ctrl+Alt+Delete, Win+L, etc, but not UAC).
/// </summary>
sealed class Curtain : osdRect {
    public Curtain() {
        Rect = screen.virtualScreen;
        Opacity = 1;
        Color = 0xc0e0a0;
        
        run.thread(() => {
            base.Show();
            
            using var _1 = new WinEventHook(EEvent.SYSTEM_DESKTOPSWITCH, 0, k => {
                if (miscInfo.isInputDesktop()) return;
                if (process.exists("consent.exe", ofThisSession: true)) return; //UAC
                k.hook.Dispose();
                Close();
            });

            
            wait.doEventsUntil(0, () => !IsHandleCreated);
        });
    }
}


Messages In This Thread
Safe screen - by Davider - 04-07-2024, 10:57 AM
RE: Safe screen - by Davider - 04-07-2024, 12:12 PM
RE: Safe screen - by Gintaras - 04-07-2024, 01:57 PM
RE: Safe screen - by Davider - 04-08-2024, 01:30 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)