CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual Basic Programming > Visual Basic 6.0 Programming
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Visual Basic 6.0 Programming Ask questions about VB 6.0 (or earlier versions) or help others by answering their question.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old April 27th, 2004, 05:24 PM
    New_Brink's Avatar
    New_Brink New_Brink is offline
    Member
     
    Join Date: Apr 2004
    Location: Alaska
    Posts: 87
    New_Brink is on a distinguished road (10+)
    Question anyone got code that will disable the keyboard and mouse?

    I need a code where it will disable the keyboard and the mouse i'm useing window's 98. please help me if you can

    Last edited by New_Brink; April 27th, 2004 at 07:21 PM.
    Reply With Quote
      #2    
    Old April 28th, 2004, 06:05 AM
    Cimperiali's Avatar
    Cimperiali Cimperiali is offline
    Old Uncle Moderator
    Power Poster
     
    Join Date: Jul 2000
    Location: Milano, Italy
    Posts: 7,157
    Cimperiali is a glorious beacon of light (400+)Cimperiali is a glorious beacon of light (400+)Cimperiali is a glorious beacon of light (400+)Cimperiali is a glorious beacon of light (400+)Cimperiali is a glorious beacon of light (400+)Cimperiali is a glorious beacon of light (400+)
    This should work in win98 (hope you have Se)

    Code:
    Private Declare Function BlockInput Lib "user32" (ByVal fBlock As Long) As Long
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    Private Sub Form_Activate()
      'KPD-Team 2000
     'URL: http://www.allapi.net/
     'E-Mail: KPDTeam@Allapi.net
     DoEvents
     'block the mouse and keyboard input
     BlockInput True
     'wait 10 seconds before unblocking it
     Sleep 10000
     'unblock the mouse and keyboard input
     BlockInput False
    End Sub
    __________________
    Rules in Codeguru
    Color code:Cimp Yves Simon666JeffBAio Code
    Job opportunities
    Do you sell? - not tested but could be interesting

    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.
    Reply With Quote
      #3    
    Old April 29th, 2004, 02:55 PM
    New_Brink's Avatar
    New_Brink New_Brink is offline
    Member
     
    Join Date: Apr 2004
    Location: Alaska
    Posts: 87
    New_Brink is on a distinguished road (10+)
    thanks do you got a code that will disable "ctrl", "alt", "delete"? that would help alot and how can i change it to where it will enable after 60 seconds instead of 10? help me if you can thanks
    Reply With Quote
      #4    
    Old April 30th, 2004, 07:14 AM
    Cimperiali's Avatar
    Cimperiali Cimperiali is offline
    Old Uncle Moderator
    Power Poster
     
    Join Date: Jul 2000
    Location: Milano, Italy
    Posts: 7,157
    Cimperiali is a glorious beacon of light (400+)Cimperiali is a glorious beacon of light (400+)Cimperiali is a glorious beacon of light (400+)Cimperiali is a glorious beacon of light (400+)Cimperiali is a glorious beacon of light (400+)Cimperiali is a glorious beacon of light (400+)
    as far as I know, disable "ctrl", "alt", "delete" is not possible
    under NT, win2k, winXp.


    abut 60 seconds:
    Code:
     BlockInput True
     'wait 60 seconds before unblocking it
     Sleep 60000
     'unblock the mouse and keyboard input
     BlockInput False
    __________________
    Rules in Codeguru
    Color code:Cimp Yves Simon666JeffBAio Code
    Job opportunities
    Do you sell? - not tested but could be interesting

    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.
    Reply With Quote
      #5    
    Old May 3rd, 2004, 03:03 PM
    New_Brink's Avatar
    New_Brink New_Brink is offline
    Member
     
    Join Date: Apr 2004
    Location: Alaska
    Posts: 87
    New_Brink is on a distinguished road (10+)
    Is there a disable for "ctrl", "alt", "delete" for windows 98? thanks for your help
    Reply With Quote
      #6    
    Old May 4th, 2004, 05:36 AM
    Cimperiali's Avatar
    Cimperiali Cimperiali is offline
    Old Uncle Moderator
    Power Poster
     
    Join Date: Jul 2000
    Location: Milano, Italy
    Posts: 7,157
    Cimperiali is a glorious beacon of light (400+)Cimperiali is a glorious beacon of light (400+)Cimperiali is a glorious beacon of light (400+)Cimperiali is a glorious beacon of light (400+)Cimperiali is a glorious beacon of light (400+)Cimperiali is a glorious beacon of light (400+)
    Yes: tell os your program is a screensaver running

    On win 98 you can:

    Code:
    Private Const SPI_SCREENSAVERRUNNING As Long = 97
    Private Declare Function SystemParametersInfo Lib "User32.dll" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
    
    'To disable:
    'call it as
    DisableEnable True
    
    'To enable, call it as:
    DisableEnable False
    'remember to enable when quitting your program!
      
    Private Sub DisableEnable(bParam As Boolean)
        Dim lRetVal As Long, bOld As Boolean
        lRetVal = SystemParametersInfo(SPI_SCREENSAVERRUNNING, bParam, bOld, 0&)
    End Sub
    Another way:
    Code:
    Private Declare Function RegisterServiceProcess Lib "Kernel32.dll" _
        (ByVal dwProcessId As Long, ByVal dwType As Long) As Long
    Sub AltCtrlDel_Show()
        Call RegisterServiceProcess(0, 0)
    End Sub
    
    Sub AltCtrlDel_Hide()
        Call RegisterServiceProcess(0, 1)
    End Sub
    __________________
    Rules in Codeguru
    Color code:Cimp Yves Simon666JeffBAio Code
    Job opportunities
    Do you sell? - not tested but could be interesting

    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

    Last edited by Cimperiali; May 4th, 2004 at 05:40 AM.
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual Basic Programming > Visual Basic 6.0 Programming


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 01:26 AM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009