From 81ac7b7f2848718da07b139385d11d7807d15832 Mon Sep 17 00:00:00 2001 From: myfreeer Date: Fri, 18 Aug 2017 20:21:27 +0800 Subject: [PATCH] support to turn locks off by renaming executable Example: * numlock.exe -> NumLock On * numlockoff.exe -> NumLock Off --- numlock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/numlock.c b/numlock.c index c5d4c44..1b57538 100644 --- a/numlock.c +++ b/numlock.c @@ -42,6 +42,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine selfName[i] = tolower(selfName[i]); //MessageBox(NULL, selfName, NULL, MB_OK|MB_ICONINFORMATION); + if (strstr(selfName, "off") || strstr(selfName, "un")) + bState = !bState; if (strstr(selfName, "num")) SetKey(bState, VK_NUMLOCK); if (strstr(selfName, "caps") || strstr(selfName, "capital")) @@ -50,4 +52,4 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine SetKey(bState, VK_SCROLL); return 0; -} \ No newline at end of file +}