|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Intercepting Ctrl+Alt+DelIn our application written in VB6 we use 3rd party controls from a vendor who is no longer in business. The problem with the controls occurs only under WinXP and happens when users would like to lock their computers by pressing first Ctrl+Alt+Del. They may choose to go back to the desktop immediately, but by that time our application is GPFd. Upon further investigation we noticed, that the controls in question must be enabled (.Enabled = True), so quick workaround was to add an application wide functionality to disable all controls on all open forms and link it to a menu command. This is good except that users need to remember to choose the command before they press Ctrl+Alt+Del. That's why I'm interested in intercepting the keys combination in code if possible. Any ideas are welcome. TIA, Vitaliy OAS Software Corp. Vitalik wrote:
> In our application written in VB6 we use 3rd party controls from a General concensus is, sorry, "forget it." That key combination is handled> vendor who is no longer in business. The problem with the controls > occurs only under WinXP and happens when users would like to lock > their computers by pressing first Ctrl+Alt+Del. They may choose to > go back to the desktop immediately, but by that time our application > is GPFd. Upon further investigation we noticed, that the controls in > question must be enabled (.Enabled = True), so quick workaround was > to add an application wide functionality to disable all controls on > all open forms and link it to a menu command. This is good except > that users need to remember to choose the command before they press > Ctrl+Alt+Del. That's why I'm interested in intercepting the keys > combination in code if possible. Any ideas are welcome. by msgina.dll, which you'd have to rewrite and replace. Most shops would (rightly) view this as a *serious* compromise of their security, and bar such software from ever being installed. I think you need to find another way. Hello Karl,
Thanks for your quick response. I didn't have any high expectations simply because I tried to subclass a form in a sample project and that didn't help either. So, I guess I will stick with my "plan B" which is finding another suitable set of controls (and get the source!) and replace our current ones. Vitaliy Show quoteHide quote "Karl E. Peterson" <k***@mvps.org> wrote in message news:ebr9YzCKGHA.668@TK2MSFTNGP11.phx.gbl... > Vitalik wrote: > > In our application written in VB6 we use 3rd party controls from a > > vendor who is no longer in business. The problem with the controls > > occurs only under WinXP and happens when users would like to lock > > their computers by pressing first Ctrl+Alt+Del. They may choose to > > go back to the desktop immediately, but by that time our application > > is GPFd. Upon further investigation we noticed, that the controls in > > question must be enabled (.Enabled = True), so quick workaround was > > to add an application wide functionality to disable all controls on > > all open forms and link it to a menu command. This is good except > > that users need to remember to choose the command before they press > > Ctrl+Alt+Del. That's why I'm interested in intercepting the keys > > combination in code if possible. Any ideas are welcome. > > General concensus is, sorry, "forget it." That key combination is handled > by msgina.dll, which you'd have to rewrite and replace. Most shops would > (rightly) view this as a *serious* compromise of their security, and bar > such software from ever being installed. I think you need to find another > way. > -- > Working without a .NET? > http://classicvb.org/ > >
Show quote
Hide quote
On Thu, 2 Feb 2006 13:04:29 -0600, "Vitalik" <addr***@domain.com> See whether this works for disabling the keyswrote: >Hello, > >In our application written in VB6 we use 3rd party controls from a vendor >who is no longer in business. The problem with the controls occurs only >under WinXP and happens when users would like to lock their computers by >pressing first Ctrl+Alt+Del. They may choose to go back to the desktop >immediately, but by that time our application is GPFd. Upon further >investigation we noticed, that the controls in question must be enabled >(.Enabled = True), so quick workaround was to add an application wide >functionality to disable all controls on all open forms and link it to a >menu command. This is good except that users need to remember to choose the >command before they press Ctrl+Alt+Del. That's why I'm interested in >intercepting the keys combination in code if possible. Any ideas are >welcome. (your real solution is to ditch the 3rd party junk) Option Explicit ' Disable Windows Key ' and Ctl Alt Delete 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 Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Dim Mask% Mask = vbCtrlMask + vbAltMask 'If (Shift And Mask) = Mask Then If KeyCode = vbKeyDelete Then Me.Print "Gottit" End If 'End If End Sub Private Sub Form_Load() Command1.Caption = "Stop Keys" Command2.Caption = "Allow Keys" End Sub Private Sub Command1_Click() SystemParametersInfo 97, True, "1", 0 End Sub Private Sub Command2_Click() SystemParametersInfo 97, False, "1", 0 End Sub
Show quote
Hide quote
"J French" <erew***@nowhere.uk> wrote in message Are you sure SPI_SETSCREENSAVERRUNNING works in Windows XP? I thought that news:43e26800.119404801@news.btopenworld.com... > ' Disable Windows Key > ' and Ctl Alt Delete > > 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 > Private Sub Command1_Click() > SystemParametersInfo 97, True, "1", 0 > End Sub was only for non-NT-based OSes. On Thu, 2 Feb 2006 15:30:35 -0500, "Jeff Johnson [MVP: VB]"
<i.get@enough.spam> wrote: <snip> >Are you sure SPI_SETSCREENSAVERRUNNING works in Windows XP? I thought that You are probably right - it was getting late>was only for non-NT-based OSes.
KeyPress event help needed
module Best way to extract a word from a sentence Does this serial port device exist? Text box - Change/Lost Focus use VB6 Thesaurus & internationalisation color format Installing VB5 Application Causing Hardware Problems? Outlook Style Date Grouping Function result differs from same code for subroutine |
|||||||||||||||||||||||