Well, to get it at bootup, if it's Win98 or previous (he didn't say which OS he was running) you could just throw the compiled program into Autoexec.bat. In QB, you can create custom ON KEY events to trap ctrl-alt-del (which would just end up going back to the PW program again anyway), alt-tab, ctrl-break, ctrl-esc(which is the same as the Start key), etc. But, by running it in the autoexec.bat prior to loading windows, there's only 2 ways out of it:
1) Remove it from autoexec.bat AFTER you're logged in. If you shut down the computer whenever you're not using it, you shouldn't have to worry about this.
2) Use F* (not sure about the number, i think it's F6) to change to "line-by-line" autoexec.bat execution. Whoever was using it would just be able to skip over the program. Or if they bypassed autoexec altogether.
As far as the program itself goes, I'd say just do something like the following:
Code: Select all
'Insert ON KEY events here; I'd have to look it up to see the syntax. Basically you'd set keys for ctrl-alt-del, ctrl-break, and every other event you want to 'trap'. Then you'd call ON KEY(n) (where n = the key number you defined; I think custom keys start at 15) and send it to a dummy gosub.
10 input "Password:", z$
if z$ <> "password" then
print "Invalid password."
attempts = attempts + 1
if attempts = 5 then print "Hack attempt detected. Locking Computer.": do: loop
print "Correct password!"
I'd have to look up the syntax again for how to set custom keys (I haven't used them since GWBasic).