How To Lock Keyboard By Writing Code
HiWhat are the different ways to lock keyboard.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
How To Lock The Keyboard
ie. when my application is started, the keyboard must be locked, such that the user is allowed to use only the mouse, when my application is unloaded, the usual setting must be retained(ie. the keyboard must work),
how to proceed,
any suggestion, samples appreciated
thanx in advance
LOCK THE KEYBOARD
Hi,
I'd like to lock the keyboard in order to prevent the user to do certain anything in a form.
If someone can help me...
Thank you
COSIDUS
Keyboard Lock Help!
Hi, I am writing some code to control the mouse with the keyboard...
The problem I am running into, is that this program needs to run in the background, and when I assign keys to move the mouse, they echo system wide.
I need advice as to how to go about Locking keyboard input system wide (except app), while app runs in background
Any help would be appreciated...
Thank you
Edited by - funkyman on 2/5/2004 3:11:24 PM
Lock Keys Of The Keyboard
guys help!!!!!does anybody know how can i lock the letters on the keyboard so that the user of my calculating program wont be able to enter a letter and get an error message... plz help,i really need to know how to do this!!!! thanks alot!!!!!!!!!!!!!!!!!!!!
Keyboard Vs Joystick, How To Lock Each Other?
well, i need to detect 2 signals, which 1 from keyboard n 1 from joystick. i'm using joystick_move and keydown event.
however, what command i can to lock each other, that only detect 1 device at 1 time?
How To Lock Keys (keyboard)
hi @ll!
i want to make a program, that locks the keyboard or only special keys like "a" or "6" or the return-key. but i don't know, what api to use.....
because the key have to be locked in ANY windows-program, like it isn't plugged to the comp.
Keyboard-scroll-lock-detection (with Example)
Hello
i need a function to detect the "scroll lock state".
The code below works, but when changing
focus from vb to another application like notepad, the
scroll lock state no more gets displayed correctly.
Only when closing notepad so that the focus is on vb, the
scroll lock detection works fine.
How can i detect the scroll-lock-state system wide (W98)?
================================
needs 1 timer on a form
================================
Private Declare Function GetKeyboardState Lib "user32" _
(pbKeyState As Byte) As Long
Const VK_NUMLOCK = &H90
Const VK_SCROLL = &H91
Const VK_CAPITAL = &H14
Private Sub Form_Load()
Timer1.Interval = 50
End Sub
Private Sub Timer1_Timer()
Dim State As Boolean
Dim Keys(0 To 255) As Byte
Call GetKeyboardState(Keys(0))
State = Keys(VK_SCROLL)
Caption = State & " " & Rnd
End Sub
Detecting The Keyboard Scroll Lock State (example)
Hello
i need a function to detect the "scroll lock state".
The state is ON if the keyboard LED is ON, and
the state is OFF if the keyboard LED is OFF.
The code below works, but when starting another
application like notepad, vb loses the focus
and the scroll lock state no more
is displayed by my vb program.
It seems that the Function "GetKeyboardState"
does not work over vb process boundaries.
But what API can i use??
Using the api (GetAsyncKeyState)
i can detect the scroll lock state
when notepad is started too, but GetAsyncKeyState
only shows if a key is pressed at this moment
or not, but detects no state (is the keyboard LED OFF or ON?).
GetKeyState or GetKeyboardState **can** detect the scroll lock
state.
Can i detect the state by reading an i/o port
or another method?
================================
needs 1 timer on a form
================================
Private Declare Function GetKeyboardState Lib "user32" _
(pbKeyState As Byte) As Long
Const VK_NUMLOCK = &H90
Const VK_SCROLL = &H91
Const VK_CAPITAL = &H14
Private Sub Form_Load()
Timer1.Interval = 50
End Sub
Private Sub Timer1_Timer()
Dim State As Boolean
Dim Keys(0 To 255) As Byte
Call GetKeyboardState(Keys(0))
State = Keys(VK_SCROLL)
Caption = State & " " & Rnd
End Sub
How Can I Lock The Ctrl+alt+del Or The Windows Keys On The Keyboard.
Dear friends:
I have a POS system in VB6.0 running on Windows XP.
I wonder how to lock the high piority keys for the user not to alter my program and crash it.
Example: I want to lock the ctrl,alt,delete and the windows keys that let the task bar appear.
Hope you can help me.
Lock The Student Computer Keyboard And Mouse
Hi All, I'm the technician in the school. I'm writing the API program about through the Lan to lock other computers keyboard and mouse. I already try some functions which searching from the web but not work. Therefore; I hope somebody can help me or teach me how it work.
I'm using Windows XP platform. And I have try to use "Activekeyboardlayout", " edit registry", "winsock" etc.
Thank you very much!!!
Edited by - ccnc13 on 6/6/2005 9:30:09 AM
Detecting The Keyboard Scroll Lock State (example)
Hello
i need a function to detect the "scroll lock state".
The state is ON if the keyboard LED is ON, and
the state is OFF if the keyboard LED is OFF.
The code below works, but when starting another
application like notepad, vb loses the focus
and the scroll lock state no more
is displayed by my vb program.
It seems that the Function "GetKeyboardState"
does not work over vb process boundaries.
But what API can i use??
Using the api (GetAsyncKeyState)
i can detect the scroll lock state
when notepad is started too, (so it works
over vb process boundaries!!), but GetAsyncKeyState
only detects if a key is pressed at this moment
or not. It detects not the state (is the keyboard
LED OFF or ON?).
GetKeyState or GetKeyboardState **can** detect the
scroll lock state.
Can i detect the state by reading an i/o port
or any other method?
================================
needs 1 timer on a form
================================
Private Declare Function GetKeyboardState Lib "user32" _
(pbKeyState As Byte) As Long
Const VK_NUMLOCK = &H90
Const VK_SCROLL = &H91
Const VK_CAPITAL = &H14
Private Sub Form_Load()
Timer1.Interval = 50
End Sub
Private Sub Timer1_Timer()
Dim State As Boolean
Dim Keys(0 To 255) As Byte
Call GetKeyboardState(Keys(0))
State = Keys(VK_SCROLL)
Caption = State & " " & Rnd
End Sub
Detecting The Keyboard Scroll Lock State
Hello
i need a function to detect the "scroll lock state".
I want to detect the state of the green scroll-lock
keyboard LED (OFF or ON).
The code below works, but when starting another
application like notepad, the scroll lock state no more
is displayed correctly by vb.
Only when closing notepad (i use the GetKeyboardState api)
the code works.
Using another api (GetAsyncKeyState)
i could detect the scroll lock state,
when notepad is started, but i only can
see that the key is pressed at this moment.
I can not see the scroll lock state
(is the scroll LED
on or of at this time?)
Can i detect the state or
the state of the scroll lock LED, when
another application is running ?
================================
needs 1 timer on a form
================================
Private Declare Function GetKeyboardState Lib "user32" _
(pbKeyState As Byte) As Long
Const VK_NUMLOCK = &H90
Const VK_SCROLL = &H91
Const VK_CAPITAL = &H14
Private Sub Form_Load()
Timer1.Interval = 50
End Sub
Private Sub Timer1_Timer()
Dim State As Boolean
Dim Keys(0 To 255) As Byte
Call GetKeyboardState(Keys(0))
State = Keys(VK_SCROLL)
Caption = State & " " & Rnd
End Sub
How To Lock All Input Devices (mouse, Keyboard) ?
Hi, i got another one
How can i lock all input devices (mouse and keyboard) preventing
the user to do anything until the app unlocks them again ?
(First i tried to use the SetSysModalWindow - API function, but
it doesn't seem to work with Win98...)
thanks in advance
Watz
Writing Blank Entries Or Lock Ups.
i give up.
SOMEONE HELP ME 2night!!!
client:
Code:
Private Sub Winsock_DataArrival(ByVal bytestotal As Long)
Dim data As String
Winsock.GetData data
MsgBox (data)
If data = "acceptnewlist" Or data = "acceptnewlist" & vbCrLf Then
Open "C:listnew.txt" For Append As #1
Do
Winsock.GetData data
msgbox (data)
Print #1, data
If data = "end" Or data = "end" & vbCrLf Then
Close #1
Exit Do
End If
Loop Until data = "end" Or data = "end" & vbrclf
Close #1
End If
End Sub
right, what happens now is that, it will keep looping forever. it crashes. then when i look in the file, all i see is endless lines of blank lines.
then if i hit CTRL+BREAK and hover over data...it says data=""
if i put in that msgbox (data) in the do loop, it shows me as blank entries, even tho the server is sending VALID data:
server:
Code:
Private Sub Winsock_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim Data As String
Dim x As String
Dim searchstring As String
Dim searchchar As String
Dim MyPos As Integer
Winsock(Index).GetData Data
x = Data
searchstring = x
searchchar = "."
MyPos = InStr(1, searchstring, searchchar)
If MyPos Then
'MsgBox ("It contained " + searchchar)
LogIP Data
End If
Dim crucial As Integer
Dim Text As String
crucial = InStr(1, searchstring, "open file")
If crucial Then
Winsock(Index).SendData "acceptnewlist" & vbCrLf
DoEvents
Open "C:list.txt" For Input As #1
Do
Input #1, Text
Broadcast (Index), Text & vbCrLf
MsgBox (Text & vbCrLf)
Loop Until EOF(1)
Close #1
Broadcast (Index), "end"
MsgBox ("end")
End If
End Sub
Public Sub Broadcast(Index As Integer, ByVal Text As String)
Winsock(Index).SendData Text
DoEvents
End Sub
apart from this, (i haven't put it in this 10000000000 revision of code), if i tell it, in the client code, to write the incoming data to a list box, it writes nothing at all.
what the hell is going on?
i am new at this, so please, explain to me what is wrong, what needs to be done to solve it and any further explanation for my future reference.
Thank-you
Lock Excel File While Writing
Hi all,
I need to know how to either prevent anyone from open an excel file when it's open by my application and written to or only let the file being opened write-protected during the write session.
Thanks
Jonni
Writing To Keyboard Cache
How can i enter a command that would simulate a sequence of keys entered through keyboard (for example: i would like ENTER key to work as TAB key)
Writing A Keyboard Hook In Word VBA
I am trying to write a simple macro in Word VBA which increments a counter when a character is written to the screen. The point of this is to automatically detect when say, 5 lines have been typed and then to auto-insert a paragraph break.
A number of things I have tried have caused Word to hang unexpected. In particular the following code is a simple prototype for the eventual code:
I have typed the following code in a module:
Public Declare Function CallNextHookEx Lib "user32" _
(ByVal hHook As Long, _
ByVal nCode As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Public Declare Function UnhookWindowsHookEx Lib "user32" _
(ByVal hHook As Long) As Long
Public Declare Function SetWindowsHookEx Lib "user32" _
Alias "SetWindowsHookExA" _
(ByVal idHook As Long, _
ByVal lpfn As Long, _
ByVal hmod As Long, _
ByVal dwThreadId As Long) As Long
Public Declare Function GetCurrentThreadId Lib "kernel32" _
() As Long
Global hHook As Long
Public Function KeyboardProc(ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
KeyboardProc = CallNextHookEx(hHook, nCode, wParam, _ lParam)
End Function
The following code is to be typed into user-defined macro procedures (say Hook() and Unhook()) within the word document
Sub Hook()
hHook = SetWindowsHookEx(WH_KEYBOARD, _
AddressOf KeyboardProc, 0&, GetCurrentThreadId)
End Sub
Sub Unhook()
Call UnhookWindowsHookEx(hHook)
End Sub
If I am not mistaken, upon calling Hook() this should insert a hook whose only function is to call the next hook. Instead it just causes word to hang. Please help!! Thanks in advance.
Global Events For Keyboard SCAN CODE && ASCII CODE Event Trapping?
OK, don't be mad at me, if this is a stupid question, but I'm quite new to VB, so here's my Q:
Is there any global event (not KeyUp/KeyDown/KeyPress) to trap keyboard keypresses with SCAN codes? It is very important to have the exact scan code. I want to use an API function to simulate the pressed keys on an other machine, and I need to have the scan code. By the way, API function calls won't do it for me, I need an EVENT! (I don't want to call functions over and over again e.g. in a timer event. This is too -slow-)
So if anyone out there can help me, please do!
You won't regret it!
Thanks to all....
Detect Num Lock Caps Lock And Scroll Lock <solved>
i am creating a small password username program and the password is case sensitive and i want it to be but i want to warn the user if the caps lock or num lock or scroll lock is on, though i do not know to detect if these are on , anyone know thanks!.
Best Reguards
Dave Barr
Edited by - crazyoldman on 1/11/2006 11:38:51 AM
Lock The Code?
Hi,
does anyone know if there is a way to "lock" vb code whilst debugging in pause break mode? (much in the same manner as how you lock the controls on a form once you are happy with them - either a way in the IDE or via a 3rd party app).
It's just that sometime when I am debugging my finger can slip and I can inadvertently edit the code... obviously I can undo, but I'd rather this couldn't happen... anyone have any ideas?
Cheers!
Lock Code In VB 6
Hi .
I want to Lock my VB Code window
is their any possibility..
kindly Reply
shemy
Create A USB Lock Code!!
Is there anybody know how to create a code that can be put into a USB flash Driver and generate a encrypt code so we can lock that USB. For example if I have a USB flash Driver and I want nobody knows what do I have inside it even if they found it.
I already knew the code that can make the VB complied code auto run just like when you insert your CD/DVD into your CD/DVD player.
Another things, this is the code for you if the person that entering password but 3 times wrong then all files inside the usb will be auto delete
Code:
Public Sub DeleteAllFiles(ByVal strFolderSpec As String)
On Error GoTo Handler
Dim oFs As New FileSystemObject
Dim oFolder As FOLDER
Dim oFile As File
If oFs.FolderExists(strFolderSpec) Then
Set oFolder = oFs.GetFolder(strFolderSpec)
On Error Resume Next
For Each oFile In oFolder.Files
oFile.Delete True 'setting force to true
'deletes read-only file
Next
End If
Exit Sub
Handler:
MsgBox Err.description, vbCritical, "Error " & Str(Err.Number)
End Sub
How To Lock Folder Through VB 6.0 Code
Hi,
I have one problem, please any one can help me for that. Through Visual Basic 6.0, can i lock any folder.
i.e. Not Renamed,not deleted, or not opened by anyone.
I have urgency, pl. reply me as soon as possible.
Regards,
Nainesh Tailor.
Does Anyone Know Any Code That Will Lock Up A Machine?
I'm trying to cause the computer to lockup, without creating an endless loop.
I'm writing a program that will try to shut down a process that has pegged the CPU. I don't want my program's process to peg the CPU though, for testing purposes.
Turn The Num Lock On/Off Through Code
Does anyone have the code to turn the NumLock on and off??
Also, will this make the beeping noise if Mouse Keys is turned on??
I was planning on sticking this in a timer for school
How Can I Lock A Word Doc From VB6 Code
Hello,
I'm quite new to VB and Word coding so please accept my ignorance.
I have a Word doc which is populated from VB 6 using bookmarks in the Word doc. Once populated I need the Word doc to be locked so that no changes of any sort can be made to it but I am not to sure about what code to use.
Please help me out if you can.
Thank You,
SKM.
Lock Mouse Movement Until Code Is Done...
Hi all,
Is there a way I can "lock" the mouse until after my code is run? What I have is an application that sets the mouse cursos to a certain location within a giant listbox, depending on other data. It then hits enter/double-clicks on that location. If the user moves the mouse any, then the click event will not be in the right location, thus throwing the rest of the code off.
So, with that being said, is there a temporary method of completely locking the mouse to any operator intervention or am I going to have to find another method to do this?
Thanks!
VB6 Hard Lock - Code Restore Possible?
Hello! So, today I started a new VB6 project, and I was working on it for a good chunk of the day. Right before I was going to quit for the night, the VB IDE locked up XP so badly, that the Task Manager wont even work. Unfortunately, I hadnt saved my project in a good long while. I'll have to start over from scratch if I cant recover my code somehow.
Now, that computer is still in its locked up state, and almost nothing responds. But, it happily lets me surf around its files over the network. Is there anywhere that it would store temp files that would have my code? The only files I manually saved were from about 5 minutes into my development time, and fairly useless.
I suppose I'll end up starting over, but posting here was worth a shot
Informix Table Lock In VB6.0 Code
Dear Friends,
Please help me with code.
How to lock a Informix table through VB6.0 code?
FYI. I m using ODBC connection to connect the database.
Looking response as early as possible
Thanks & Best Regards
Mani
Lock The Code In Word Macros
Hello All
I wrote a word macro using VBA. Now I put this macro in the public area. I am fraid someone change the code and macro will not wrok. Does someone know how to lock my code?
Thanks
Vicky
Turning Scroll, Num And Caps Lock On/off Through Code
Hi All,
another quick question.... Is there a WORKING way of turning the Scroll, Num and Caps lock keys on and off through code? I have tried using send keys but that doesn't do anything. I need it to turn the associated light on or off.
Thanx again,
-Scott
How To Use Keyboard Function From Code?
I have created a form with command button as keyboard and text box as user input .I want to create a backspace key using command button, how to call the backspace function from the code?
Thanks.
Code To Fire A Key On The Keyboard Exp. F1
I need to know the code that will be associated with a particular key on the keyboard, F1 to be exact. I want to be able to have code behind somehting like the click of a button. This code will fire and would make it seem as if you were hitting the F1 key on the keyboard with out actually hitting the F1 key. Any solutions.
How To Lock Cursor Position For X Seconds While VB Code Is Executing
I am working on a spreadsheet with a number of list boxes. When the user makes a selection in one list box, it takes a few seconds for the entire spreadsheet to update itself. During that time, if the user moves the mouse around the screen, specifically over different entries in the list box, it can cause some weird issues.
I would like to know if it is possible, upon a list box click event, to freeze the position of the cursor for a few seconds while the spreadsheet chugs away at the updates. I have looked up the code to get the cursor position and to set the cursor position, I am a little confused as to how to hold this position for a period of time while still allowing the code associated with the list box click event to proceed.
Edited by - AbbydonKrafts on 4/3/2007 10:26:51 PM
How To Create Lock For Word Document Thru Visualbasic 6 Code?
hi Buddies,
my code does the parsing from the XML file and its details are written in a word document.
while the application runs the code starts writting detatils which got from the xml in the word document assume that it take 1 minutes to complete. Meantime the user is now try to open the word document and from the taskbar it gots open. he/she trys to modify or interupt the application while word gets writing.
code that im using
worddoc.Visible = True
when i try to change the property into false then it show an error
My Question :
1) How to set a lock untill or unless word gots over.
2) Can we acheive from this from vb 6 code.
3) can i control the word document thru vb code.
Note: since the VB and Word are two different applications
I need ur valuable suggesions and tips
Regards,
Moulee
Press A Keyboard Button Through Code.
I'm trying to make it so when you press cmd1, the keyboard's space button gets pressed. Kind of like how the Windows On-Screen keyboard does.
How can I do this?
Keyboard Hook And Shift Code???
under the forms KeyDown event, you have KeyCode and Shift Code, how can I get the Scan code using Keyboard hooks or other api-functions or similar?
Sending The F5 Key Keyboard Message By Code
Code:
msgResult = SendMessageA(hwndIE_Server, ???, ???, ???)
The hwndIE_Server represents the "Internet Explorer_Server"
Class that is used to show web-content.
This handle I get using the FindWindowEx API call and it really
gets the correct value.
With them SendMessageA API Call I want to send the F5 key
to this child-class to invoke the refresh procedure from the
Internet Explorer.
I don't know the params to do this.
What do I have to set for the MSG param, the wParam and the lParam?
Any ideas?
thx!
|