Application Password

Get help with using AutoHotkey and its commands and hotkeys
zeenun
Posts: 3
Joined: 13 Jan 2019, 09:31

Application Password

13 Jan 2019, 16:41

I have a script that requires a password when opening Microsoft Edge. It works fine until when Microsoft Edge is closed, I want the password to be required again when I open Edge again (and I leave my pc on all the time so just placing the file in Startup doesn't help). I already tried to fix this by placing it on a loop to keep opening the script again, but then I keep getting pop-ups saying that there is an older version of the same script running. Is there a way for it to require the password every time without constant pop-ups?

Here is my script:

#Persistent
SetTimer BlockNotepad, 100
BlockNotepad:
if (hwnd := WinExist("ahk_exe C:\Windows\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\MicrosoftEdge.exe"))
{
WinGet PID, PID, % "ahk_id " hwnd

handle := DllCall("OpenProcess", "UInt", 0x0800, "Int", false, "UInt", PID, "Ptr")
DllCall("ntdll\NtSuspendProcess", "Ptr", handle)

InputBox password, Enter password, Enter password
if (ErrorLevel == 1)
{
MsgBox Password is not right :(
Process Close, % PID
ExitApp
}

if (password == "blocked")
{
MsgBox Password is correct :D.
DllCall("ntdll\NtResumeProcess", "Ptr", handle)
DllCall("CloseHandle", "Ptr", handle)
ExitApp
}
else
{
MsgBox Wrong pass. Exiting.
Process Close, % PID
ExitApp
}
}

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Boborino, just me, lexikos, OceanDF, swagfag and 115 guests