Jump to content
Sign in to follow this  
tsue

blocker

Recommended Posts

tsue

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

Share this post


Link to post
Share on other sites
sandin

#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

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.