Jump to content

blocker


Recommended Posts

hello, here is my problem i want to lock the program firefox so my brothers cant use it , because when they use my computer they enter to the firefox program and as u may know firefox tab sistem grants the access to unclosed tabs so when the program is opened again is shows the tabs from the last time, but they dont respect them and they close them all, so thats why i want to know the code to stop firefox from opening

Link to comment
Share on other sites

#include <GUIConstants.au3>
Opt("WinTitleMatchMode", 2)
Global $check = False
Guicreate("Firefox blocker", 169, 92)
$Start = GUICtrlCreateButton("Start blocking", 10, 10, 150, 30)
$exit = GUICtrlCreateButton("Exit", 10, 50, 150, 30)
GUISetState(@SW_SHOW)
While 1
    $Msg = GUIGetMsg()
    Select
        Case $Msg = $Start
            if $check = True Then
                $check = False
                GUICtrlSetData($Start, "Start blocking")
            Else
                $check = True
                GUICtrlSetData($Start, "Stop blocking")
            EndIf
        Case $Msg = $exit
            Exit
        case $Msg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
    if $check = True Then
        $hWNd = WinGetTitle(" - Mozilla Firefox")
        if $hWnd then
            WinClose($hWnd)
            MsgBox(262144, "Error", "You do not have permision to start Firefox!", 10)
        EndIf
    EndIf
WEnd

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...