Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
FileInstall("C:\Users\Drago\Desktop\MpghLogo.jpg", @TempDir&"\MpghLogo.jpg")
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Crysis 2 Keygen", 241, 212, 362, 322)
$Input_serials = GUICtrlCreateInput("", 8, 32, 161, 21)
$Label1 = GUICtrlCreateLabel("Serial", 72, 8, 30, 17)
$Button1 = GUICtrlCreateButton("Gen.", 176, 32, 59, 25)
$Label2 = GUICtrlCreateLabel("Window Name", 72, 72, 74, 17)
$Input2 = GUICtrlCreateInput("Crysis 2 (TM)", 8, 96, 225, 21)
$Button2 = GUICtrlCreateButton("Send Key at Window", 8, 128, 227, 25)
$Pic1 = GUICtrlCreatePic(@TempDir&"\MpghLogo.jpg", 8, 160, 225, 49)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_SerialsRandom()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
_SerialsRandom()
Case $Button2
WriteIT()
Case $Pic1
ShellExecute("www.mpgh.net")
EndSwitch
WEnd
Func WriteIT()
ControlSend(GUICtrlRead($Input2),"","",GUICtrlRead($Input_serials))
EndFunc
Func _SerialsRandom()
Local $sStr = _StringGetRandomString(20, "ABCDEF1234567890")
GUICtrlSetData($Input_serials, StringRegExpReplace($sStr, '([A-Z0-9]{4})(?=[A-Z0-9])', '\1-'))
$Hot = GUICtrlRead($Input_serials)
EndFunc
Func _StringGetRandomString($iLen, $sABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ")
Local $iABC = StringLen($sABC), $sOut = ""
Local $iBit = Int(Log($iABC) / Log(2))
Local $iMsk = 2 ^ $iBit - 1
Local $iChr = Int(31 / $iBit)
Local $iRnd
While 1
$iRnd = Random(1, 0x7FFFFFFF, 1)
For $i = 1 To $iChr
$sOut &= StringMid($sABC, BitAND($iRnd, $iMsk), 1)
If StringLen($sOut) >= $iLen Then Return $sOut
$iRnd = BitShift($iRnd, $iBit)
Next
WEnd
EndFunc