Advice? ? ? 
Author Message
 Advice? ? ?

Is there a way to stop a user of a VB program from getting out of it by
means other than the proper course of the program ? ? ? I.e. disabling
alt-Tab, or just closing the window ? ? ?

cheerz



Fri, 15 Oct 2004 03:59:57 GMT  
 Advice? ? ?
I don't think you can trap Alt-Tab, but I may be wrong, but doesn't that
switch applications as opposed to closing them?.  However, you can trap the
close window in the terminate event if you need to do some housecleaning
before it closes.  Actually, I always considered the close window a proper
way to exit.

Bob

--
Those who make their abode in edifices of a silicon matter should refrain
from capitulating ligneous projectiles.


Quote:
> Is there a way to stop a user of a VB program from getting out of it by
> means other than the proper course of the program ? ? ? I.e. disabling
> alt-Tab, or just closing the window ? ? ?

> cheerz



Fri, 15 Oct 2004 05:40:59 GMT  
 Advice? ? ?
I'm trying to create a kind of password program, to keep unwanted users out
. . . but i don't want the program to just be sent to the background and not
do anything . . .or closed without permission . . . any ideas ? ? ?

cheerz



Fri, 15 Oct 2004 07:23:55 GMT  
 Advice? ? ?
On Mon, 29 Apr 2002 00:23:55 +0100, "Paul Washbrook"

Quote:

>I'm trying to create a kind of password program, to keep unwanted users out
>. . . but i don't want the program to just be sent to the background and not
>do anything . . .or closed without permission . . . any ideas ? ? ?

>cheerz

This is a very dirty little routine posted originally by Mike Williams

It does not trap Alt Tab - or indeed any Key - but you can get round
that by simply checking that it is the Foreground Window on a Timer

Option Explicit

Private Declare Sub keybd_event Lib "user32" _
(ByVal bVk As Byte, ByVal bScan As Byte, _
ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const VK_SNAPSHOT As Byte = 44

Private Sub Form_Activate()
Dim sw As Single, sh As Single
sw = Screen.Width
sh = Screen.Height
Clipboard.Clear
AutoRedraw = True
Move sw, sh, sw + 1000, sh + 1000
DoEvents
Call keybd_event(VK_SNAPSHOT, 1, 0, 0)
DoEvents
PaintPicture Clipboard.GetData, 0, 0
Move 0, 0, Screen.Width, Screen.Height
End Sub

Private Sub Form_Click()
Dim answer As Integer
answer = MsgBox("", vbYesNo, "Pay me the ransom money!")
If answer = vbYes Then Unload Me
End Sub



Fri, 15 Oct 2004 15:31:03 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Automation Expert Advice Needed!

2. Advice on looping through a set of arrays please

3. Please advice

4. Bad error - any advice?

5. Advice please

6. Need advice on controling application expiration

7. Advice needed on Access-Excel interoperability

8. Advice on Creating Transaction File

9. High level advice needed....please

10. HELP! Need advice on distributed database

11. Expert Advice Needed - Recordset updates Datasheet

12. need advice

 

 
Powered by phpBB® Forum Software