maqleod Posted September 10, 2007 Posted September 10, 2007 just in case you want a generator to make class ids for your file type associations: expandcollapse popup;CLSID Generator #include <GuiConstants.au3> Local $array[8],$number $parent = GUICreate("CLSID",250,80) $input = GuiCtrlCreateInput("",10,10,225,20) $button = GuiCtrlCreateButton("Generate",50,40,75,25) $close = GuiCtrlCreateButton("Close",130,40,75,25) Generate() GUISetState() Do $msg = GUIGetMsg() if $msg = $button then GuiCtrlSetData($input,"") Generate() endif if $msg = $close then ExitLoop endif Until $msg = $GUI_EVENT_CLOSE GUIDelete() Func Generate() ;First 8 numbers are completely random, next for are based off the current day and month For $i = 1 to 8 RandomHex() $array[$i-1] = $number Next GuiCtrlSetData($input,$array[0] & $array[1] & $array[2] & $array[3] & $array[4] & $array[5] & $array[6] & $array[7] & "-" & @MDAY & @MON & "-") ;next 4 numbers are based off of the current PID of a system core process, random numbers are filled in when needed $pid1 = ProcessExists("csrss.exe") $pid1len = StringLen($pid1) if $pid1len > 4 then $newlen = $pid1len - 4 $newpid1 = StringTrimRight($pid1,$newlen) $default = GuiCtrlRead($input) GuiCtrlSetData($input,$newpid1 & "-",$default) elseif $pid1len < 4 then $default = GuiCtrlRead($input) GuiCtrlSetData($input,$pid1,$default) $newlen = 4 - $pid1len For $i = 1 to $newlen RandomHex() $default = GuiCtrlRead($input) GuiCtrlSetData($input,$number,$default) Next $default = GuiCtrlRead($input) GuiCtrlSetData($input,"-",$default) elseif $pid1len = 4 then $default = GuiCtrlRead($input) GuiCtrlSetData($input,$pid1 & "-",$default) endif ;next 4 numbers are based off of the current PID of a system core process, random numbers are filled in when needed $pid2 = ProcessExists("smss.exe") $pid2len = StringLen($pid2) if $pid2len > 4 then $newlen = $pid2len - 4 $newpid2 = StringTrimRight($pid2,$newlen) $default = GuiCtrlRead($input) GuiCtrlSetData($input,$newpid2 & "-",$default) elseif $pid2len < 4 then $default = GuiCtrlRead($input) GuiCtrlSetData($input,$pid2,$default) $newlen = 4 - $pid2len For $i = 1 to $newlen RandomHex() $default = GuiCtrlRead($input) GuiCtrlSetData($input,$number,$default) Next $default = GuiCtrlRead($input) GuiCtrlSetData($input,"-",$default) elseif $pid2len = 4 then $default = GuiCtrlRead($input) GuiCtrlSetData($input,$pid2 & "-",$default) endif ;last 12 numbers are based off of the serial of your hard drive, random numbers are filled in when needed $drives = DriveGetDrive("Fixed") $serial = DriveGetSerial($drives[1]) $seriallen = StringLen($serial) if $seriallen > 12 then $newlen = $seriallen - 12 $newstring = StringTrimRight($serial,$newlen) $default = GuiCtrlRead($input) GuiCtrlSetData($input,$newstring,$default) elseif $seriallen < 12 then $default = GuiCtrlRead($input) GuiCtrlSetData($input,$serial,$default) $addition = 12 - $seriallen For $i = 1 to $addition RandomHex() $default = GuiCtrlRead($input) GuiCtrlSetData($input,$number,$default) Next elseif $seriallen = 12 then $default = GuiCtrlRead($input) GuiCtrlSetData($input,$serial,$default) endif EndFunc Func RandomHex() $number = Random(1,16,1) if $number = 10 then $number = "A" endif if $number = 11 then $number = "B" endif if $number = 12 then $number = "C" endif if $number = 13 then $number = "D" endif if $number = 14 then $number = "E" endif if $number = 15 then $number = "F" endif if $number = 16 then $number = "G" endif EndFunc [u]You can download my projects at:[/u] Pulsar Software
ptrex Posted September 10, 2007 Posted September 10, 2007 @maqleod Something like this ? But a little shorter : MsgBox(0,"GUID Generator",_GenerateGUID ()) Func _GenerateGUID () $oScriptlet = ObjCreate ("Scriptlet.TypeLib") Return $oScriptlet.Guid EndFunc Regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
maqleod Posted September 10, 2007 Author Posted September 10, 2007 fancy that, had no idea it could be done that way. could you by chance recommend a site for reading up on how to work with objects and libraries within windows? [u]You can download my projects at:[/u] Pulsar Software
ptrex Posted September 10, 2007 Posted September 10, 2007 @maqleod I can only recommend "Google" and the "MSDN" if it concerns microsoft Objects Regards, ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
Red-Steel Posted September 10, 2007 Posted September 10, 2007 (edited) if $number = 16 then $number = "G" endif There are no G in hexadecimal Edited September 10, 2007 by Red-Steel
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now