How to Disable Alt-F4 in HTA ?

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
hackoo
Posts: 103
Joined: Sat Jan 22, 2011 12:27 am

How to Disable Alt-F4 in HTA ?

Post by hackoo » Wed Aug 15, 2012 11:51 pm

Hi !I wonder How to Disable Alt-F4 in HTA ?i read this article : http://ehow.com/how_10031549_disable-al ... l-hta.html and i tried it but didn't work for me , so i'm asking you how can this be done properly !Thank you !


hackoo2012-08-16 06:52:37

User avatar
hackoo
Posts: 103
Joined: Sat Jan 22, 2011 12:27 am

How to Disable Alt-F4 in HTA ?

Post by hackoo » Wed Aug 15, 2012 11:51 pm

Hi !I wonder How to Disable Alt-F4 in HTA ?i read this article : http://ehow.com/how_10031549_disable-al ... l-hta.html and i tried it but didn't work for me , so i'm asking you how can this be done properly !Thank you !


hackoo2012-08-16 06:52:37

User avatar
hackoo
Posts: 103
Joined: Sat Jan 22, 2011 12:27 am

How to Disable Alt-F4 in HTA ?

Post by hackoo » Fri Aug 17, 2012 3:10 am

Hi Just give a try ;)

Code: Select all

    <html>
<head>
<TITLE>LOGIN</TITLE>  
<HTA:APPLICATION  
 APPLICATIONNAME="LOGIN"  
 VERSION="1.0.0.0"  
 BORDER="none"  
 INNERBORDER="no"  
 CAPTION="no"  
 SYSMENU="no"  
 MAXIMIZEBUTTON="no"  
 MINIMIZEBUTTON="no"  
 ICON="NO"  
 SCROLL="no"  
 SCROLLFLAT="yes"  
 SINGLEINSTANCE="yes"  
 WINDOWSTATE="maximize"  
 SHOWINTASKBAR="no"  
 CONTEXTMENU="no"  
 SELECTION="no"/> 
</head>

<SCRIPT Language="VBScript">
Sub RunScript
 Password=InputBox("Type your Password :","Type your Password")  
 IF Password ="" THEN  
 MsgBox "Password is empty !",16,"Password is empty !"
 End If
 If Password = "123" Then
 window.close
 End if
End Sub

Sub Pointer
    document.body.style.cursor = "hand"
End Sub

Sub DefaultCursor
    document.body.style.cursor = "default"
End Sub
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript"> 
function document.onkeydown() {  
 var alt=window.event.altKey; 
 if (event.keyCode==116 || event.keyCode==27 || alt && event.keyCode==115) { 
 event.keyCode=0; 
 event.cancelBubble=true; 
 return false; 
 } 
 } 
</SCRIPT> 
<body text=white bgcolor=#1234568>

<center><span id="ClickableSpan" onClick="RunScript" onmouseover="Pointer" 
onmouseout="DefaultCursor">
Click here to UnLock The Screen !</span>

</body>
</html>

Locked