Posts: 1,031
Threads: 246
Joined: Jul 2022
Can add a function similar to the
Curtain function in QM? It would be very useful in certain situations.
Macro
Macro32
int w=Curtain
int w2
run "$system$\notepad.exe" "" "" "" 0xA00 win("" "Notepad") w2
paste "hello"
DestroyWindow w
5
clo w2
Posts: 1,031
Threads: 246
Joined: Jul 2022
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.
Posts: 12,073
Threads: 140
Joined: Dec 2002
04-07-2024, 01:57 PM
(This post was last modified: 04-07-2024, 01:59 PM by Gintaras.)
// 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);
});
}
}
Posts: 1,031
Threads: 246
Joined: Jul 2022