Solved

disabling ctrl+alt+del in windows-95

Posted on 1998-07-17
9
163 Views
Last Modified: 2010-05-03
How can i disable the ctrl+alt+del combination in windows-95 .That is when a user presses this combination he gets a dialog box from where he can terminate any process. I don't want this to happen?can any body help me.I want the souurce code in visual basic using API functions.
0
Comment
Question by:ZENO
  • 5
  • 4
9 Comments
 
LVL 9

Accepted Solution

by:
Dalin earned 80 total points
ID: 1466089
ZENO,
Try this. let me know if you have any problems
Regards
Dalin

Private Const SPI_SCREENSAVERRUNNING = 97&

Private Declare Function SystemParametersInfo Lib "User32" Alias "SystemParametersInfoA" (ByVal uAction As Long,
ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long

Public Sub AllowKeys(bParam as Boolean)

Dim lRetVal As Long, bOld As Boolean

lRetVal = SystemParametersInfo(SPI_SCREENSAVERRUNNING, bParam, bOld, 0&)

End Sub


To Call

AllowKeys(False)    ' Disable

AllowKeys(True)  'Enable
0
 

Author Comment

by:ZENO
ID: 1466090
This worked perfectly.Thanks a lot.just do help me to find a window and then make it disappear from the taskbar using API.That is if Microsoft Word is open i want to be able to hide it from taskbar when i run my VB program.Can you tell me the HEX codes for other system key combinations like ctrl+esc etc.

Thank you.I will increase the points to 59.Thats all the points I have got.
Bye and thank you once again...
Zeus.
0
 

Author Comment

by:ZENO
ID: 1466091
Adjusted points to 60
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1466092
ZENO,
Here is the code for Hide the App from the task bar.
(This uses notepad as example. You need to change it to your app).

You should have a lot more point than that. You should have at least 280 points by now. If you don't, post a question in the costomer service area and ask linda to look at your account.

Regards
Dalin
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:ZENO
ID: 1466093
you did not give the code.I am readjusting the points to 75 .Please do send me the code.
Bye
zeno
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1466094
Zeno
Sorry, I must have forgetting to paste the code. Did not  mean to delay.
Regards
Dalin


'Declarations

Declare Function SetWindowPos Lib "user32" (ByVal hwnd _
As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, _
ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal _
wFlags As Long) As Long    

Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, ByVal _
lpWindowName As String) As Long

Const SWP_HIDEWINDOW = &H80
Const SWP_SHOWWINDOW = &H40    

'Code to Hide the Taskbar
Dim Thwnd as Long
Thwnd = FindWindow("Shell_traywnd", "")
Call SetWindowPos(Thwnd, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)    

'Code to Show the Taskbar

Dim Thwnd as Long
Thwnd = FindWindow("Shell_traywnd", "")
Call SetWindowPos(Thwnd, 0, 0, 0, 0, 0, SWP_SHOWWINDOW)
0
 

Author Comment

by:ZENO
ID: 1466095
this code hides the whole of taskbar idont want that i just want my application that is word to not appear on the taskbar whereas the remaining application continue to do so.I have increased the points to 80.Thank you
Zeus
0
 
LVL 9

Expert Comment

by:Dalin
ID: 1466096
Sorry...
Here is the code to hide your app from the task bar
Regards
DAlin


    Public Const SWP_NOSIZE = &H1
    Public Const SWP_NOMOVE = &H2
    Public Const SWP_NOZORDER = &H4
    Public Const SWP_NOREDRAW = &H8
    Public Const SWP_NOACTIVATE = &H10
    Public Const SWP_HIDEWINDOW = &H80

    Public Const MAX_LENGTH = 1024

    Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal
    cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
    Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal LParam As Long) As Long

    Public Function EnumWindowProc(ByVal hWnd As Long, ByVal Param As Long) As Long
        Dim sName As String
        sName = Space(MAX_LENGTH)
        If GetClassName(hWnd, sName, MAX_LENGTH) <> 0 Then
            If Left$(sName, InStr(sName, vbNullChar) - 1) = "Notepad" Then
                SetWindowPos hWnd, 0, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOZORDER Or SWP_NOACTIVATE Or
    SWP_HIDEWINDOW
            End If
        End If
        EnumWindowProc = 1
    End Function

    Private Function HideWindow()
        EnumWindows AddressOf EnumWindowProc, 0
    End Function
0
 

Author Comment

by:ZENO
ID: 1466097
Thanks for your answer.I found abetter way infact which does not require this much of code.that is by searching for the window using findwindow api with parameters of vbnullstring and name of window and once you get the handle of window you hide it from the taskbar.
Thanks anyway...
Zeus
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Crystal reports - Formula Field code need assistance with code 17 52
Hide vba in gp 7 83
How to make an ADE file by code? 11 81
Added a column screws up code 5 50
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now