How can I make it so when a person presses the Windows button or CTRL+ALT+DEL, it wont work. Instead, it will show a message, " Error".
If the same meathod can be used for all the buttons, post that here too.
Quote from: OuTLawZGoSu on April 14, 2004, 08:11 PM
How can I make it so when a person presses the Windows button or CTRL+ALT+DEL, it wont work. Instead, it will show a message, " Error".
If the same meathod can be used for all the buttons, post that here too.
Replace the keyboard driver.
P.S. Not likely with VB.
I meant only in the program, not all the programs.
I made a password program to prevent pricks ( my dad ) from gettin on my computer. But when I hit the Window Button ( between Left CTRL and Left ALT ), you can see the taskbar. Then you can just use the " Show the Desktop " feature. I need to prevent that.
Also, since I dont know how to dissable CTRL+ALT+DEL, I named the program " Norton antivirus" and put the same icon as NAV. My dad isn't THAT smart to figure out that it's not the real norton. Cleaver eh? But, not to take any chances, I need to dissable those buttons.
Try GetAsyncKeyState using the API
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
If there's something you don't want seen, just use pgp tools to encrypt it.
Log the keys and compare.
There used to be a semi-hackish way to do this by making the OS think the screensaver was enabled but it disabled those keys systemwide while the program was running
Pull out your IDE cable and take it with you when you leave, kthx
Quote from: iago on April 15, 2004, 08:24 AM
Pull out your IDE cable and take it with you when you leave, kthx
Who is grounding who? lol
Quote from: Fr0z3N on April 14, 2004, 11:38 PM
Try GetAsyncKeyState using the API
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
So how would I put that in a Form_Keypress()
If GetAsyncKeyState = "13" then
'message
ElseIf GetAsyncKeyState = (ALT KEY Here) Then
'message
EndIf
I'm at a skool computer right now so I cant test it.
Quote from: Networks on April 15, 2004, 09:05 AM
Quote from: iago on April 15, 2004, 08:24 AM
Pull out your IDE cable and take it with you when you leave, kthx
Who is grounding who? lol
Haha, I initially read that to mean electrical grounding, but I didn't think he wanted to electrocute his dad.
Why don't you just log off and not give him access to your Windows password?
Heck, I find a Screensaver password is more than enough to keep my family away from my .. . stuff.
Quote from: iago on April 15, 2004, 11:44 AM
Heck, I find a Screensaver password is more than enough to keep my family away from my .. . *porn*.
:P
Quote from: Tuberload on April 15, 2004, 01:03 PM
Quote from: iago on April 15, 2004, 11:44 AM
Heck, I find a Screensaver password is more than enough to keep my family away from my .. . *porn*.
:P
haha, I was going to type "po..... stuff" but I decided that was too obvious :)
Quote from: OuTLawZGoSu on April 15, 2004, 10:42 AM
So how would I put that in a Form_Keypress()
If GetAsyncKeyState = "13" then
'message
ElseIf GetAsyncKeyState = (ALT KEY Here) Then
'message
EndIf
I'm at a skool computer right now so I cant test it.
No, if your going to put it in keypress, you could just use KeyAscii. If you looked at the prototype of GetAsyncKeyState you'd see that you need to pass something to that function. So it would be:
if GetAsyncKeyState(13) = -32767 Then
'// doSomething();
end if
Quote
No, if your going to put it in keypress, you could just use KeyAscii. If you looked at the prototype of GetAsyncKeyState you'd see that you need to pass something to that function. So it would be:
Oh ye, I forgot about KeyAscii. Aight I'll try that.
EDIT: Eh.. wats the ascii code for the ALT, CTRL, and the "Windows" Button ( the one located between alt and ctrl).
I tryed:
Private sub Btn1_Click()
text2.text = asc(text1.text)
End sub
'didnt work.
Quote from: Telos on April 15, 2004, 07:53 AM
There used to be a semi-hackish way to do this by making the OS think the screensaver was enabled but it disabled those keys systemwide while the program was running
Think you can find more info on this?
It's in c++, but it's just an API call so it shouldn't be so hard to port to VB.
void DisableCAD(bool disabled) {
SystemParametersInfo SPI_SCREENSAVERRUNNING, disabled, NULL, NULL);
}
' // [Edit]
Private Declare Function SystemParametersInfo _
Lib "user32" Alias "SystemParametersInfoA" _
(ByVal uAction As Long, _
ByVal uParam As Long, _
ByVal lpvParam As Any, _
ByVal fuWinIni As Long) As Long
Got no idea wat that is :/
Wow! Thx for the help iago!
does anyone know off hand what the keyascii for tab is?
Quote from: GoSuGaMING on April 17, 2004, 11:15 AM
does anyone know off hand what the keyascii for tab is?
9
Doesnt' vb have constants. VBTAB or VB_TAB or VBKEYTAB or something like that?
Quote from: iago on April 17, 2004, 02:15 PM
Doesnt' vb have constants. VBTAB or VB_TAB or VBKEYTAB or something like that?
Yes, vbKeyTab.
Aight, I've been searching and I found this.
http://web.cs.mun.ca/~michael/c/ascii-table.html
The only problem I have is finding the Windows Button.
Any of those abreviations stand for that button?
Quote from: OuTLawZGoSu on April 17, 2004, 03:18 PM
Aight, I've been searching and I found this.
http://web.cs.mun.ca/~michael/c/ascii-table.html
The only problem I have is finding the Windows Button.
Any of those abreviations stand for that button?
I *think* the windows button just sends Ctrl+Esc.
Quick search for '"windows key" key code':
VK_LWIN = 0x5B;
Quote from: K on April 17, 2004, 03:56 PM
Quick search for '"windows key" key code':
VK_LWIN = 0x5B;
That is the same key as ']', isn't it? At least, that's the ascii value of ']'.
And I don't think the windows key has a code, or at least the code doesn't get passed to the form, but why don't you try displaying all pressed keys? Then you'd see the code.
Unless you look through each process,
App.TaskVisible = False should hide your program from ctrl alt del
Quote from: CrAz3D on April 17, 2004, 04:04 PM
Unless you look through each process,
App.TaskVisible = False should hide your program from ctrl alt del
That's not a bad idea, there's a program called "window hider" I posted on the general forum some time ago that will hide programs from ctrl-alt-delete and from clicking on them. You wouldn't be able see the window either, though.
Quote from: iago on April 17, 2004, 04:03 PM
Quote from: K on April 17, 2004, 03:56 PM
Quick search for '"windows key" key code':
VK_LWIN = 0x5B;
That is the same key as ']', isn't it? At least, that's the ascii value of ']'.
And I don't think the windows key has a code, or at least the code doesn't get passed to the form, but why don't you try displaying all pressed keys? Then you'd see the code.
I didn't think the windows key was passed on to applications either, but I found a code example that appeared to register it as a hotkey using that constant. *Shrug*