| 1 | Global $g_bRegistered = False |
|---|
| 2 | Global Const $nDest = @ScriptDir & "\AutoItX3.dll" |
|---|
| 3 | |
|---|
| 4 | Local Const $x = 0, $y = 0, $w = 1000, $h = 1000 |
|---|
| 5 | Local $oAutoIt = ObjCreate("AutoItX3.Control") |
|---|
| 6 | If Not IsObj($oAutoIt) Then |
|---|
| 7 | If MsgBox(4100, "", "Install AutoItX?") = 6 Then |
|---|
| 8 | FileInstall("D:\Program Files\AutoIt3\AutoItX\AutoItX3.dll", $nDest) |
|---|
| 9 | DllCall($nDest, "int", "DllRegisterServer") |
|---|
| 10 | $g_bRegistered = True |
|---|
| 11 | $oAutoIt = ObjCreate("AutoItX3.Control") |
|---|
| 12 | EndIf |
|---|
| 13 | EndIf |
|---|
| 14 | |
|---|
| 15 | If Not IsObj($oAutoIt) Then |
|---|
| 16 | Exit MsgBox(4096, "", "Unable to create object.") |
|---|
| 17 | EndIf |
|---|
| 18 | |
|---|
| 19 | MsgBox(4096, "", $oAutoIt.PixelCheckSum($x, $y, $w, $h) & @CRLF & PixelChecksum($x, $y, $w, $h)) |
|---|
| 20 | |
|---|
| 21 | Func OnAutoItExit() |
|---|
| 22 | If $g_bRegistered Then DllCall($nDest, "int", "DllUnregisterServer") |
|---|
| 23 | EndFunc |
|---|