Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I create a System modal Form

Status
Not open for further replies.

smash81

Programmer
Mar 12, 2001
88
KE
Hi Friends,
I am a VB programmer and have a requirement that when i run my application, i should be able to stop anyone from exiting from the application and moving to some other application,something that can easily be accomplished by using key combinations such as "alt+tab" or ending the task using the task manager(ctrl+alt+del).
I have tried to use the sendkeys method but for the global keys such as the alt+del, it does not work.
Any suggestions please?
Alternatively you could also help by giving me other solutions as my requirement is to ensure that my application can monitor the use of the internet and so it shoul be running constantly.After the user has been given access into the system, is when he should be able to access the browsers.For this i need to have all global keys disabled and allow the user to use the letters and numbers ONLY,NO other key should work.
Kindly assist.
 
Enable And Disable The Ctrl-Alt-Del

'Add a module to your project (In the menu choose Project -> Add Module, Then click Open)
'Insert 2 CommandButtons to your form (named Command1 and Command2)
'When you will press the first button, you will disable the Ctrl-Alt-Del
'and when you will press the second button you will enable the Ctrl-Alt-Del

'Insert this code to the module :

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

'Insert this code to your form:

Sub DisableCtrlAltDelete(bDisabled As Boolean)
Dim x As Long
x = SystemParametersInfo(97, bDisabled, CStr(1), 0)
End Sub

Private Sub Command2_Click()
DisableCtrlAltDelete (False)
End Sub

Private Sub Command1_Click()
DisableCtrlAltDelete (True)
End Sub

Eric De Decker
vbg.be@vbgroup.nl

License And Copy Protection AxtiveX.

Download Demo version on my Site:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top