MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey-v1.0 / ScriptBlockInput

Method ScriptBlockInput

Source/script.cpp:11608–11623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11606
11607
11608ResultType Line::ScriptBlockInput(bool aEnable)
11609// Adapted from the AutoIt3 source.
11610// Always returns OK for caller convenience.
11611{
11612 // Must be running Win98/2000+ for this function to be successful.
11613 // We must dynamically load the function to retain compatibility with Win95 (program won't launch
11614 // at all otherwise).
11615 typedef void (CALLBACK *BlockInput)(BOOL);
11616 static BlockInput lpfnDLLProc = (BlockInput)GetProcAddress(GetModuleHandle("User32.dll"), "BlockInput");
11617 // Always turn input ON/OFF even if g_BlockInput says its already in the right state. This is because
11618 // BlockInput can be externally and undetectibly disabled, e.g. if the user presses Ctrl-Alt-Del:
11619 if (lpfnDLLProc)
11620 (*lpfnDLLProc)(aEnable ? TRUE : FALSE);
11621 g_BlockInput = aEnable;
11622 return OK; // By design, it never returns FAIL.
11623}
11624
11625
11626

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected