Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Safe screen
#1
Can add a function similar to the Curtain function in QM? It would be very useful in certain situations.


Macro Macro32
Code:
Copy      Help
int w=Curtain

int w2
run "$system$\notepad.exe" "" "" "" 0xA00 win("" "Notepad") w2
paste "hello"

DestroyWindow w

5

clo w2
#2
Thanks for your help!
It seems more appropriate to add this method to the Screen class(Screen.Curtain), along with some additional details: screen index, forced exit hotkey?
Currently, using Ctrl+Alt+Del does not bring up the task manager to end the process.
#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);
        });
    }
}
#4
thank you so much!


Forum Jump:


Users browsing this thread: 1 Guest(s)