Jump to content

Conabler


James
 Share

Recommended Posts

Hi all,

The strange name Conabler is a shortened name for Control Enabler! The genius that I am :wub:

Basically, Conabler allows you to enable any disabled controls! It uses EnablerDLL.dll by Stephen Hewitt and was inspired by Gifs Enabler that I found on his website, only mine runs in the tray!

#NoTrayIcon

#Include <Constants.au3>

Opt("TrayMenuMode", 1)

Global $DLL = DllOpen("EnablerDLL.dll"), $Hook = 0

If _Singleton(@ScriptName, 1) = 0 Then
    MsgBox(0, @ScriptName, "Conabler can only be ran once at a time!")
    Exit
EndIf

$enitem = TrayCreateItem("Disabled")
TrayCreateItem("")
$aboutitem = TrayCreateItem("About")
$exititem = TrayCreateItem("Exit")

TraySetState()

While 1
    $msg = TrayGetMsg()
    Select
        Case $msg = 0
            ContinueLoop
        Case $msg = $enitem
            If $Hook = 0 Then
                DllCall($DLL, "int", "SetHook")
                TrayItemSetText($enitem, "Enabled")
                TrayItemSetState($enitem, $TRAY_CHECKED)
                $Hook = 1
            ElseIf $Hook = 1 Then
                DllCall($DLL, "int", "ReleaseHook")
                TrayItemSetText($enitem, "Disabled")
                TrayItemSetState($enitem, $TRAY_UNCHECKED)
                $Hook = 0
            EndIf
        Case $msg = $aboutitem
            MsgBox(0, "Conabler", "Conabler is a product from James-Brooks.net" & @CRLF & @CRLF & _
                    "EnablerDLL.dll is a product of Stephen Hewitt" & @CRLF & @CRLF & _
                    "Conabler is Copyright James Brooks 2007")
        Case $msg = $exititem
            DllCall($DLL, "int", "ReleaseHook")
            DllClose($DLL)
            ExitLoop
    EndSelect
WEnd

Exit

Func _Singleton($sOccurenceName, $iFlag = 0)
    Local $ERROR_ALREADY_EXISTS = 183, $handle, $lastError
    
    $sOccurenceName = StringReplace($sOccurenceName, "\", "") ; to avoid error
    ;$handle = DllCall("kernel32.dll", "int", "CreateSemaphore", "int", 0, "long", 1, "long", 1, "str", $sOccurenceName)
    $handle = DllCall("kernel32.dll", "int", "CreateMutex", "int", 0, "long", 1, "str", $sOccurenceName)
    $lastError = DllCall("kernel32.dll", "int", "GetLastError")
    If $lastError[0] = $ERROR_ALREADY_EXISTS Then
        If $iFlag = 0 Then
            Exit -1
        Else
            Return SetError($lastError[0], $lastError[0], 0)
        EndIf
    EndIf
    Return $handle[0]
EndFunc   ;==>_Singleton

You will also need EnablerDLL.dll. Make sure it is placed in the same directory as is the script, otherwise it will not work!

I think screenshots may make this more appealing :blink:

Before Conabler:

Posted Image

After Conabler:

Posted Image

Note: Conabler cannot enable controls which have no function when enabled! It has some slight restrictions.

Any comments, suggestions, whatever are welcome!

Thankyou,

James!

P.S: :) Merry Christmas! :P

Edited by JamesB
Link to comment
Share on other sites

Marry christmas to you too!!! :)

May I ask what type of situation this is intended for?

Spoiler

 

"If a vegetarian eats vegetables,What the heck does a humanitarian eat?"

"I hear voices in my head, but I ignore them and continue on killing."

"You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring."

An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.

 

 
Link to comment
Share on other sites

Hi all,

The strange name Conabler is a shortened name for Control Enabler! The genius that I am :wub:

Basically, Conabler allows you to enable any disabled controls! It uses EnablerDLL.dll by Stephen Hewitt and was inspired by Gifs Enabler that I found on his website, only mine runs in the tray!

(*code*)

You will also need EnablerDLL.dll. Make sure it is placed in the same directory as is the script, otherwise it will not work!

I think screenshots may make this more appealing :blink:

Before Conabler:

After Conabler:

Note: Conabler cannot enable controls which have no function when enabled! It has some slight restrictions.

Any comments, suggestions, whatever are welcome!

Thankyou,

James!

P.S: :) Merry Christmas! :P

I can't view screenshot. (And I told you you are only genius for Photoshop).

Nice. Now I can cheat on Club Penguin (Enable that Moderation panel!)

I can do signature me.

Link to comment
Share on other sites

Weird. What version of AutoIt do you have?

Try this:

#NoTrayIcon

#Include <Constants.au3>
#Include <Misc.au3>

Opt("TrayMenuMode", 1)

Global $DLL = DllOpen("EnablerDLL.dll"), $Hook = 0

If _Singleton(@ScriptName, 1) = 0 Then
    MsgBox(0, @ScriptName, "Conabler can only be ran once at a time!")
    Exit
EndIf

$enitem = TrayCreateItem("Disabled")
TrayCreateItem("")
$aboutitem = TrayCreateItem("About")
$exititem = TrayCreateItem("Exit")

TraySetState()

While 1
    $msg = TrayGetMsg()
    Select
        Case $msg = 0
            ContinueLoop
        Case $msg = $enitem
            If $Hook = 0 Then
                DllCall($DLL, "int", "SetHook")
                TrayItemSetText($enitem, "Enabled")
                TrayItemSetState($enitem, $TRAY_CHECKED)
                $Hook = 1
            ElseIf $Hook = 1 Then
                DllCall($DLL, "int", "ReleaseHook")
                TrayItemSetText($enitem, "Disabled")
                TrayItemSetState($enitem, $TRAY_UNCHECKED)
                $Hook = 0
            EndIf
        Case $msg = $aboutitem
            MsgBox(0, "Conabler", "Conabler is a product from James-Brooks.net" & @CRLF & @CRLF & _
                    "EnablerDLL.dll is a product of Stephen Hewitt" & @CRLF & @CRLF & _
                    "Conabler is Copyright James Brooks 2007")
        Case $msg = $exititem
            DllCall($DLL, "int", "ReleaseHook")
            DllClose($DLL)
            ExitLoop
    EndSelect
WEnd

Exit
Link to comment
Share on other sites

But aren't the disabled controls context specific? I guess I'm trying to figure out why you'd want to enable something that has no real function at the given time that it is disabled...

And yes, I read the red text stating as much as I just did, but I can't think of a single instance where I have wanted to use an option that wasn't available when I wanted to use it.

Or am I missing something?

Link to comment
Share on other sites

Well, Google "Stephen Hewitt" and go to his website. It explains why he made it.

I didn't see where he explains why he made it. Merely that it can be useful at times. I did see where he says that clicking on a control you've enabled through the program can have disastrous results...

Here is the same dialog but we have used the "Windows Enabler" to enable some of the controls. We can now use these controls but how the software will react can vary greatly. Sometimes the results are disastrous, YOU HAVE BEEN WARNED!!

Sounds like good advice to me. If the program isn't expecting you to access some function because the developer has it disabled at that stage and you access it anyway, it likely won't know how to deal with it and will eat your soul.

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...