Jump to content

KXM

Active Members
  • Posts

    88
  • Joined

  • Last visited

KXM's Achievements

Wayfarer

Wayfarer (2/7)

1

Reputation

  1. I don't understand, it looks like all for the functions of you program come with the default autoit install. (Hell 2.64 should do all of that) At best it's an autoit based command prompt, without all that messy usefullness of CMD.exe? I could see not posting the source of something some one might like to steal, but at best this is 100 lines (Mostly calling Autoit builtins).
  2. Looks like they are just files that have the system & hidden attrib turned on, nothing all that special. Here's some MSDN info: Super Hidden Files A new feature we have on Windows 2000 is Super Hidden Files. These are files with both the System and the Hidden attributes. The files are still there but when you are in Windows Explorer, these files are not going to show up. Even if you check Show Hidden Files, you won't see them. There is a new check box on the list of attributes for a folder that will allow the user to see these files that is unchecked by default. This is not really a compatibility problem for the 32-bit applications. Applications can see these files in the common Open File dialog box, and can open the files without any problem. The command line will still work. If you do a Dir /ASH to see the Super Hidden Files, you will see all the files. The only compatibility issue here is for 16-bit applications, which may fall into a trap if they make calls through the INT21 on MS-DOS. The INT21 on MS-DOS will only find the hidden service file, if you have actually asked to find hidden files. Some of the files that you'll find hidden: MS-DOS system files, such as io.dos and Office Fast Find files. From: http://msdn.microsoft.com/library/default....2000appcomp.asp
  3. Added : Call with parameters (Doc missing but just add parameters as needed). Does this include HotKeySet, and other parameterless calling built-ins?
  4. Do as you'd like with my code, but I don't think you can include the .dll in an AutoIt install.
  5. This is killer! I'm a big fan of a little app called PowerMenu. I would have never thoght of rewriting it, untill I saw this... But I thought it would be fun to see how much of it's functrionallty I could duplicate using this as a base. It seems to work really well, I only had a little time to play with it, and didn't do much testing. So I'm sure there are some bugs. None-the-less: #include <GUIConstants.au3> opt("WinTitleMatchMode", 4) opt("TrayMenuMode", 1) Global $itemnum, $enum, $msg, $num, $proc, $gett, $gettif, $itemnum2, $recountt, $recount2, $bit, $state, $title, $exitc, $proclist, $upcount, $procupcount, $hUI_Popup Dim $hLastTopped = '' Dim $hLastTransed = '' Dim $trayitem1[100] Dim $procitem[100] Dim $trayrec[100] Dim $proclist[100][2] $execpath = @AutoItExe $string1 = StringInStr($execpath, "\", 0, -1) $string2 = StringTrimLeft($execpath, $string1) $proclist = ProcessList($string2) Do $upcount = $upcount + 1 If $proclist[$upcount][0] = $string2 Then $procupcount = $procupcount + 1 EndIf Until $upcount = $proclist[0][0] If $procupcount > 1 Then Exit HotKeySet("{F11}", "Menu") $trayitem2 = TrayCreateItem ("Exit") TrayCreateItem ("") TraySetState () TrayTip("Hide To Tray - Hot Key", "Press F11 to view HTT Menu.", 5) While 1 $msg = TrayGetMsg () Select Case $msg = $trayitem2 Exit EndSelect If $msg > 0 Then restore() WEnd Func hide() ; <-- To hide active window $title = "" $proc = WinGetProcess("active", "") If $itemnum > 0 Then Do $state = WinGetState("active", "") If Not BitAND($state, 2) Then recount() Return EndIf $num = $num + 1 If $procitem[$num] = $proc Then $gettif = TrayItemGetText ($trayitem1[$num]) WinSetTitle($gettif & $procitem[$num], "", $gettif) TrayItemDelete ($trayitem1[$num]) $procitem[$num] = 0 EndIf Until $num = $itemnum EndIf recount() $num = 0 $title = WinGetTitle("active", "") If @error Or $title = 1 Or $title = "" Then Return EndIf $itemnum = $itemnum + 1 WinSetTitle("active", "", $title & $proc) WinSetState("active", "", @SW_HIDE) $trayitem1[$itemnum] = TrayCreateItem ($title) $procitem[$itemnum] = $proc $bit = $bit + 1 EndFunc ;==>hide Func ontop() ; <-- Sets win on top $hLastTopped = WinGetHandle("active") WinSetOnTop("active", "", 1) EndFunc ;==>ontop Func semitrans() $hLastTransed = WinGetHandle("active") WinSetTrans("active", "", 175) EndFunc ;==>semitrans Func Menu() HotKeySet("{F11}", "killmenu");Reset so menu is only called once HotKeySet("1", "runhide");hide HotKeySet("2", "runontop");always on top HotKeySet("3", "runsemitrans");makse win semi transparent HotKeySet("4", "reset");resets all wins defaults HotKeySet("5", "exithtt");exits hide to tray ;now set the same for the numpad HotKeySet("{NUMPAD1}", "runhide");hide HotKeySet("{NUMPAD2}", "runontop");always on top HotKeySet("{NUMPAD3}", "runsemitrans");makse win semi transparent HotKeySet("{NUMPAD4}", "reset");resets all wins defaults HotKeySet("{NUMPAD5}", "exithtt");exits hide to tray ;let's make a 10 sec popup option menu $hUI_Popup = GUICreate("", 400, 150, Default, Default, $WS_POPUP, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST) GUISetBkColor(0xBCD2EE, Default) GUICtrlCreateLabel("1: Hide current window", 8, 10, 427, 57) GUICtrlSetFont(Default, 14, 1000) GUICtrlCreateLabel("2: Set current window on top", 8, 30, 427, 57) GUICtrlSetFont(Default, 14, 1000) GUICtrlCreateLabel("3: Make current window semi-transparent", 8, 50, 427, 57) GUICtrlSetFont(Default, 14, 1000) GUICtrlCreateLabel("4: Reset all windows to default settings", 8, 70, 427, 57) GUICtrlSetFont(Default, 14, 1000) GUICtrlCreateLabel("5: Exit HTT (resets all windows)", 8, 90, 427, 57) GUICtrlSetFont(Default, 14, 1000) GUICtrlCreateLabel("F11: Cancel (Close HTT menu)", 8, 120, 427, 57) GUICtrlSetFont(Default, 13, 1000) WinSetTrans($hUI_Popup, "", 200) GUISetState(@SW_SHOW) Sleep(10000) killmenu();delets menu, kills hkey regs EndFunc ;==>Menu Func restore(); <-- Unhides window If $itemnum < 1 Then Return $itemnum2 = $itemnum Do Select Case $msg = $trayitem1[$itemnum2] $enum = $itemnum2 EndSelect $itemnum2 = $itemnum2 - 1 Until $itemnum2 = 0 $gett = TrayItemGetText ($trayitem1[$enum]) WinSetState($gett & $procitem[$enum], "", @SW_SHOW) WinSetTitle($gett & $procitem[$enum], "", $gett) TrayItemDelete ($trayitem1[$enum]) $procitem[$enum] = 0 recount() Return EndFunc ;==>restore Func recount(); <-- Removes and recalculates variable and tray menu text If $itemnum = 0 Then Return $recountt = 0 $recount2 = 0 $bit = 0 Do $recountt = $recountt + 1 $trayrec[$recountt] = TrayItemGetText ($trayitem1[$recountt]) Until $recountt = $itemnum $recountt = 0 Do $recountt = $recountt + 1 If $procitem[$recountt] <> 0 Then $bit = $bit + 1 EndIf Until $recountt = $itemnum If $bit = 0 Then $itemnum = $bit Return EndIf $recountt = 0 Do $recountt = $recountt + 1 $recount2 = $recount2 + 1 If $procitem[$recountt] = 0 Then $recount2 = $recount2 + 1 EndIf If $recount2 < $itemnum Or $recount2 = $itemnum Then $procitem[$recountt] = $procitem[$recount2] EndIf Until $recount2 = $itemnum Or $recount2 > $itemnum $recountt = 0 Do $recountt = $recountt + 1 TrayItemDelete ($trayitem1[$recountt]) Until $recountt = $itemnum + 5 $recountt = 0 $recount2 = 0 Do $recount2 = $recount2 + 1 $recountt = $recountt + 1 If $trayrec[$recountt] = "" Then $recount2 = $recount2 + 1 EndIf If $recount2 < $itemnum Or $recount2 = $itemnum Then $trayitem1[$recountt] = TrayCreateItem ($trayrec[$recount2]) EndIf Until $recount2 = $itemnum Or $recount2 > $itemnum $itemnum = $bit Return EndFunc ;==>recount Func runhide() killmenu() hide() EndFunc ;==>runhide Func runontop() killmenu() If $hLastTopped <> '' Then WinSetOnTop($hLastTopped, "", 0);removes 'top' from last toped window ontop() EndFunc ;==>runontop Func runsemitrans() killmenu() If $hLastTransed <> '' Then WinSetTrans($hLastTransed, "", 255);resets last win set to trans semitrans() EndFunc ;==>runsemitrans Func killmenu();removes hkey registration, delets menu HotKeySet("{F11}", "Menu");RReenable F11 menu calls HotKeySet("1");called with no second parama, unregs hkey. HotKeySet("{NUMPAD1}") HotKeySet("2") HotKeySet("{NUMPAD2}") HotKeySet("3") HotKeySet("{NUMPAD3}") HotKeySet("4") HotKeySet("{NUMPAD4}") HotKeySet("5") HotKeySet("{NUMPAD5}") HotKeySet("{ESC}") GUIDelete($hUI_Popup) Sleep(20);grrr EndFunc ;==>killmenu Func reset() killmenu() If $itemnum > 0 Then Do $exitc = $exitc + 1 $gett = TrayItemGetText ($trayitem1[$exitc]) TrayItemDelete ($trayitem1[$exitc]) WinSetState($gett & $procitem[$exitc], "", @SW_SHOW) WinSetTitle($gett & $procitem[$exitc], "", $gett) Until $exitc = $itemnum EndIf If $hLastTopped <> '' Then WinSetOnTop($hLastTopped, "", 0);removes 'top' from last toped window If $hLastTransed <> '' Then WinSetTrans($hLastTransed, "", 255);resets last win set to trans EndFunc ;==>reset Func exithtt() Exit EndFunc ;==>exithtt Func OnAutoItExit(); <-- Unhides all windows that have been hidden with this app on exit reset() EndFunc ;==>OnAutoItExit
  6. I am such a dumbass!!! THNX!
  7. So schtasks.exe just isn't cutting it for me any more... I need more power. But I can't seem to get the syntax quite right: $oComError_UDFGlobal = ObjEvent("AutoIt.Error", "__Generic_COM_Error") $strComputer = "." $objWMIService = ObjCreate("winmgmts:{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2") $JobID = "Test" $objNewJob = $objWMIService.Get("Win32_ScheduledJob") $errJobCreate = $objWMIService.Create ("C:\windows\Notepad.exe", "********143000.000000-420", True , 1 OR 4 OR 16, ,True, $JobId) If $errJobCreate = 0 Then MsgBox(0, '', "Job created successfully: Notepad.exe scheduled to run repeately at 14.30 (2:30 P.M.) PST on Mon, Wed, and Fri.") Else MsgBox(0, '', "Job not created. Error code = " & $errJobCreate) EndIf Func __Generic_COM_Error() Local $hNumber = Hex($oComError_UDFGlobal.number, 8) ;blantly stolen from SvenP (We'll call it a 'port') MsgBox(0, 'XZip Com Error', 'There was COM Error!' & @CRLF & @CRLF & _ 'description is: ' & @TAB & $oComError_UDFGlobal.description & @CRLF & _ 'windescription:' & @TAB & $oComError_UDFGlobal.windescription & @CRLF & _ 'number is: ' & @TAB & $hNumber & @CRLF & _ 'lastdllerror is: ' & @TAB & $oComError_UDFGlobal.lastdllerror & @CRLF & _ 'scriptline is: ' & @TAB & $oComError_UDFGlobal.scriptline & @CRLF & _ 'source is: ' & @TAB & $oComError_UDFGlobal.source & @CRLF & _ 'helpfile is: ' & @TAB & $oComError_UDFGlobal.helpfile & @CRLF & _ 'helpcontext is: ' & @TAB & $oComError_UDFGlobal.helpcontext _ ) SetError(1) EndFunc From this example: strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" _ & strComputer & "\root\cimv2") JobID = "Test" Set objNewJob = objWMIService.Get("Win32_ScheduledJob") errJobCreate = objNewJob.Create _ ("Notepad.exe", "********143000.000000-420", _ True , 1 OR 4 OR 16, ,True, JobId) If errJobCreate = 0 Then WScript.Echo "Job created successfully: " & VBNewLine _ & "Notepad.exe scheduled to run repeately at 14.30 (2:30 P.M.) PST" & VBNewLine _ & "on Mon, Wed, and Fri." Else WScript.Echo "Job not created. Error code = " & errJobCreate End If Any tips? TIA!
  8. Here's another that's kind of silyy, but it was something I needed. Func _DateToSeason($iMon = 0, $iDay = 0) If $iMon = 0 Then $iMon = @MON;Current month. Range is 01 to 12 If $iDay = 0 Then $iDay = @MDAY;Current day of month. Range is 01 to 31 Select Case $iMon = 12 Or $iMon <= 2 If $iMon = 12 Then If $iDay <= 21 Then Return 'Autumn' EndIf Return 'Winter' Case $iMon >= 3 And $iMon <= 5 If $iMon = 3 Then If $iDay <= 20 Then Return 'Winter' EndIf Return 'Spring' Case $iMon >= 6 And $iMon <= 8 If $iMon = 6 Then If $iDay <= 21 Then Return 'Spring' EndIf Return 'Summer' Case $iMon >= 9 And $iMon <= 11 If $iMon = 9 Then If $iDay <= 21 Then Return 'Summer' EndIf Return 'Autumn' Case Else Return False EndSelect EndFunc ;==>_DateToSeason
  9. If it's a system DLL, MSDN sould have information regarding any OPEN/PUBLIC/EXPOSED API calls it supports, how to access them, and how the respond/reply. If it's a non-system DLL ( like one provided with an installed program ) the you must find the documtation for it as provided by the author. HOWEVER, if there is no documation, then there is no way to find out how to use it. For instance, Norton AV my come with many (many, many) DLLs to provide functionallty within the program, but those are for only the program (and Windows it's self) to use. There is no documation, and hence no way to call the dynamic functions those DLLs contain. This holds true to the Windows DLLs. Some may be accessed using MSDN docs, and cleaver porting to AutoIT. However MOST are for Windows it's self to use.
  10. I think I may have found a bug in compileau3: Some of the default values are not working in compileau3.ini, and I think it's do to the localfile.au3.ini inireads not returning "" (blank string) defaults. example: $INP_Resource = IniRead($ScriptFile_In & ".ini", "Res", "UpdateInformation", 4) $INP_Comment = IniRead($ScriptFile_In & ".ini", "Res", "Comment", "http://www.hiddensoft.com/autoit3/compiled.html") $INP_Description = IniRead($ScriptFile_In & ".ini", "Res", "Description", "AutoIt v3 Compiled Script") $INP_Fileversion = IniRead($ScriptFile_In & ".ini", "Res", "Fileversion", "") $INP_Fileversion_AutoIncrement = IniRead($ScriptFile_In & ".ini", "Res", "Fileversion_AutoIncrement", "") $INP_LegalCopyright = IniRead($ScriptFile_In & ".ini", "Res", "LegalCopyright", "") $INP_FieldName1 = IniRead($ScriptFile_In & ".ini", "Res", "Field1Name", "") $INP_FieldValue1 = IniRead($ScriptFile_In & ".ini", "Res", "Field1Value", "") $INP_FieldName2 = IniRead($ScriptFile_In & ".ini", "Res", "Field2Name", "") $INP_FieldValue2 = IniRead($ScriptFile_In & ".ini", "Res", "Field2Value", "") $INP_Run_AU3Check = IniRead($ScriptFile_In & ".ini", "Other", "Run_AU3Check", 1) $INP_Run_Before = IniRead($ScriptFile_In & ".ini", "Other", "Run_Before", "") $INP_Run_After = IniRead($ScriptFile_In & ".ini", "Other", "Run_After", "") ;Retrieve CompileAU3 Defaults from CompileAU3.INI If $ScriptFile_Out_Type = "" Then $ScriptFile_Out_Type = IniRead(@ScriptDir & "\CompileAU3.ini", "Autoit", "outfile_type", "") If $INP_Icon = "" Then $INP_Icon = IniRead(@ScriptDir & "\CompileAU3.ini", "Autoit", "icon", "") If $INP_Compression = "" Then $INP_Compression = IniRead(@ScriptDir & "\CompileAU3.ini", "Autoit", "Compression", 2) If $INP_PassPhrase = "" Then $INP_PassPhrase = IniRead(@ScriptDir & "\CompileAU3.ini", "Autoit", "PassPhrase", "") If $INP_PassPhrase2 = "" Then $INP_PassPhrase2 = IniRead(@ScriptDir & "\CompileAU3.ini", "Autoit", "PassPhrase", "") If $INP_Allow_Decompile = "" Then $INP_Allow_Decompile = IniRead(@ScriptDir & "\CompileAU3.ini", "Autoit", "Allow_Decompile", 1) If $INP_AutoitDir = "" Then $AUT2EXE_PGM = IniRead(@ScriptDir & "\CompileAU3.ini", "Autoit", "aut2exe", "") If $INP_Resource = "" Then $INP_Resource = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "UpdateInformation", 4) If $INP_Comment = "" Then $INP_Comment = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "Comment", "http://www.hiddensoft.com/autoit3/compiled.html") If $INP_Description = "" Then $INP_Description = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "Description", "AutoIt v3 Compiled Script") If $INP_Fileversion = "" Then $INP_Fileversion = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "Fileversion", "") If $INP_Fileversion_AutoIncrement = "" Then $INP_Fileversion_AutoIncrement = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "Fileversion_AutoIncrement", "") If $INP_LegalCopyright = "" Then $INP_LegalCopyright = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "LegalCopyright", "") If $INP_FieldName1 = "" Then $INP_FieldName1 = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "Field1Name", "") If $INP_FieldValue = "" Then $INP_FieldValue1 = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "Field1Value", "") If $INP_FieldName2 = "" Then $INP_FieldName2 = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "Field2Name", "") If $INP_FieldValue2 = "" Then $INP_FieldValue2 = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "Field2Value", "") If $INP_Run_AU3Check = "" Then $INP_Run_AU3Check = IniRead(@ScriptDir & "\CompileAU3.ini", "Other", "Run_AU3Check", 1) If $INP_Run_Before = "" Then $INP_Run_Before = IniRead(@ScriptDir & "\CompileAU3.ini", "Other", "Run_Before", "") If $INP_Run_After = "" Then $INP_Run_After = IniRead(@ScriptDir & "\CompileAU3.ini", "Other", "Run_After", "") fix: If $INP_Compression = "" Then $INP_Compression = IniRead($ScriptFile_In & ".ini", "Autoit", "Compression", "") If $INP_PassPhrase = "" Then $INP_PassPhrase = IniRead($ScriptFile_In & ".ini", "Autoit", "PassPhrase", "") If $INP_PassPhrase2 = "" Then $INP_PassPhrase2 = IniRead($ScriptFile_In & ".ini", "Autoit", "PassPhrase", "") If $INP_Allow_Decompile = "" Then $INP_Allow_Decompile = IniRead($ScriptFile_In & ".ini", "Autoit", "Allow_Decompile", "") If $INP_AutoitDir = "" Then $AUT2EXE_PGM = IniRead($ScriptFile_In & ".ini", "Autoit", "aut2exe", "") $INP_Resource = IniRead($ScriptFile_In & ".ini", "Res", "UpdateInformation", "") $INP_Comment = IniRead($ScriptFile_In & ".ini", "Res", "Comment", "") $INP_Description = IniRead($ScriptFile_In & ".ini", "Res", "Description", "") $INP_Fileversion = IniRead($ScriptFile_In & ".ini", "Res", "Fileversion", "") $INP_Fileversion_AutoIncrement = IniRead($ScriptFile_In & ".ini", "Res", "Fileversion_AutoIncrement", "") $INP_LegalCopyright = IniRead($ScriptFile_In & ".ini", "Res", "LegalCopyright", "") $INP_FieldName1 = IniRead($ScriptFile_In & ".ini", "Res", "Field1Name", "") $INP_FieldValue1 = IniRead($ScriptFile_In & ".ini", "Res", "Field1Value", "") $INP_FieldName2 = IniRead($ScriptFile_In & ".ini", "Res", "Field2Name", "") $INP_FieldValue2 = IniRead($ScriptFile_In & ".ini", "Res", "Field2Value", "") $INP_Run_AU3Check = IniRead($ScriptFile_In & ".ini", "Other", "Run_AU3Check", "") $INP_Run_Before = IniRead($ScriptFile_In & ".ini", "Other", "Run_Before", "") $INP_Run_After = IniRead($ScriptFile_In & ".ini", "Other", "Run_After", "") ;Retrieve CompileAU3 Defaults from CompileAU3.INI If $ScriptFile_Out_Type = "" Then $ScriptFile_Out_Type = IniRead(@ScriptDir & "\CompileAU3.ini", "Autoit", "outfile_type", "") If $INP_Icon = "" Then $INP_Icon = IniRead(@ScriptDir & "\CompileAU3.ini", "Autoit", "icon", "") If $INP_Compression = "" Then $INP_Compression = IniRead(@ScriptDir & "\CompileAU3.ini", "Autoit", "Compression", 2) If $INP_PassPhrase = "" Then $INP_PassPhrase = IniRead(@ScriptDir & "\CompileAU3.ini", "Autoit", "PassPhrase", "") If $INP_PassPhrase2 = "" Then $INP_PassPhrase2 = IniRead(@ScriptDir & "\CompileAU3.ini", "Autoit", "PassPhrase", "") If $INP_Allow_Decompile = "" Then $INP_Allow_Decompile = IniRead(@ScriptDir & "\CompileAU3.ini", "Autoit", "Allow_Decompile", 1) If $INP_AutoitDir = "" Then $AUT2EXE_PGM = IniRead(@ScriptDir & "\CompileAU3.ini", "Autoit", "aut2exe", "") If $INP_Resource = "" Then $INP_Resource = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "UpdateInformation", 4) If $INP_Comment = "" Then $INP_Comment = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "Comment", "http://www.hiddensoft.com/autoit3/compiled.html") If $INP_Description = "" Then $INP_Description = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "Description", "AutoIt v3 Compiled Script") If $INP_Fileversion = "" Then $INP_Fileversion = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "Fileversion", "") If $INP_Fileversion_AutoIncrement = "" Then $INP_Fileversion_AutoIncrement = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "Fileversion_AutoIncrement", "") If $INP_LegalCopyright = "" Then $INP_LegalCopyright = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "LegalCopyright", "") If $INP_FieldName1 = "" Then $INP_FieldName1 = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "Field1Name", "") If $INP_FieldValue = "" Then $INP_FieldValue1 = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "Field1Value", "") If $INP_FieldName2 = "" Then $INP_FieldName2 = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "Field2Name", "") If $INP_FieldValue2 = "" Then $INP_FieldValue2 = IniRead(@ScriptDir & "\CompileAU3.ini", "Res", "Field2Value", "") If $INP_Run_AU3Check = "" Then $INP_Run_AU3Check = IniRead(@ScriptDir & "\CompileAU3.ini", "Other", "Run_AU3Check", 1) If $INP_Run_Before = "" Then $INP_Run_Before = IniRead(@ScriptDir & "\CompileAU3.ini", "Other", "Run_Before", "") If $INP_Run_After = "" Then $INP_Run_After = IniRead(@ScriptDir & "\CompileAU3.ini", "Other", "Run_After", "")
  11. It wouldn't be a question of 'hard'. There is no way to make THESE function calls work with 7-Zip. They are based only on the documation from the xzip web site. As far as working w/ 7-Zip, if it supports in any way activex/com, it's really only a matter of finding out the format of the function calls.
  12. I wanted to see if I could get it to work, and to some extent did. It's really just a lot of strinstr stuff. Not really suitable for production use. The more I play with it, the more I realize it would really need to built into the AutoIt core. I haven't figured out a good way to pass back info. But thinking about stdin/out. #include-once #include <array.au3> #include <Constants.au3> Global $aParams_A3XGlobal[1], $iError_A3XGlobal = 0, $hPID_A3XGlobal = 0 Func _a3xCall($sPath, $sFunc, ByRef $aParamas, $bRunWait = False) Local $sParamas = '' For $v in $aParamas If IsArray($v) Then $sParamas &= __ParseArray($v) & ',' ContinueLoop EndIf $sParamas &= $v & ',' Next $sParamas = StringTrimRight($sParamas, 1) If $bRunWait Then $hPID_A3XGlobal = RunWait(@ScriptFullPath & ' /AutoIt3ExecuteScript "' & $sPath & '" Call::' & $sFunc & ' Paramas::' & $sParamas) Else $hPID_A3XGlobal = Run(@ScriptFullPath & ' /AutoIt3ExecuteScript "' & $sPath & '" Call::' & $sFunc & ' Paramas::' & $sParamas, '', '', $STDERR_CHILD + $STDOUT_CHILD + $STDIN_CHILD) EndIf EndFunc ;==>_a3xCall Func _A3XClose() ProcessClose($hPID_A3XGlobal) $aParams_A3XGlobal = '' $iError_A3XGlobal = 0 $hPID_A3XGlobal = 0 EndFunc ;==>_A3XClose Func _ParseA3XCall($sParamas) Local $aSplit, $sFunc, $aFuncParams $aSplit = StringSplit( StringTrimLeft($sParamas, (StringInStr($sParamas, 'Call::') + 5)), 'Paramas::', 1) $sFunc = $aSplit[1] $aFuncParams = StringSplit($aSplit[2], ',') _ArrayDelete($aFuncParams, 0) For $s in $aFuncParams _ArrayAdd($aParams_A3XGlobal, __VarentToType($s)) Next $aParams_A3XGlobal[0] = UBound($aParams_A3XGlobal) - 1 Call(StringStripWS($sFunc, 8)) If @error Then MsgBox(0, '', 'Called Function non-exantiant: ' & $sFunc) EndIf ConsoleWrite('Exit Code: ' & $iError_A3XGlobal) EndFunc ;==>_ParseA3XCall Func _Return($v) ConsoleWrite($v) EndFunc ;==>_Return ;helpers Func __VarentToType($v) Local $sCheck, $n = Number($v) $sCheck = StringLeft($v, 1) If $sCheck == '"' Or $sCheck == "'" Then $v = StringTrimLeft($v, 1) EndIf $sCheck = StringRight($v, 1) If $sCheck == '"' Or $sCheck == "'" Then $v = StringTrimRight($v, 1) EndIf Select Case StringInStr($v, 'Array::', 1) Return StringSplit (StringReplace($v, 'Array::', ''), '|', 1) Case $v = 'true' Return True Case $v = 'false' Return False Case $n <> 0 Return $n Case Else If $v == 0 And $n == 0 Then Return 0 Return String($v) EndSelect EndFunc ;==>__VarentToType Func __ParseArray(ByRef $aArray) If Not IsArray($aArray) Then SetError(1) Return False EndIf $sSendString = _ArrayToString($aArray, '|') Return 'Array::' & $sSendString EndFunc ;==>__ParseArraya3xConcepts.zip
  13. Hot off the presses: http://www.autoitscript.com/forum/index.php?showtopic=18428
  14. Nothin'?
  15. I know nothing of VB, and I'm having no luck proting this: VERSION 5.00 Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX" Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "comctl32.ocx" Begin VB.Form neroFiddlesCOMForm Caption = "NeroFiddles COM" ClientHeight = 6150 ClientLeft = 60 ClientTop = 345 ClientWidth = 6930 LinkTopic = "Form1" ScaleHeight = 6150 ScaleWidth = 6930 StartUpPosition = 3 'Windows Default Begin MSComDlg.CommonDialog ImageFileDialog Left = 1680 Top = 4800 _ExtentX = 688 _ExtentY = 688 _Version = 393216 DefaultExt = "nrg" DialogTitle = "Select Image File " Filter = "All Files (*.*)|*.*|Nero Image Files (*.nrg)|*.nrg" End Begin VB.Frame Frame4 Caption = "Available Devices" Height = 735 Left = 120 TabIndex = 10 Top = 960 Width = 6495 Begin VB.ComboBox AvailableDevices Height = 315 ItemData = "neroFiddlesCOMForm.frx":0000 Left = 240 List = "neroFiddlesCOMForm.frx":0002 TabIndex = 11 Top = 240 Width = 5895 End End Begin VB.Frame Frame3 Caption = "Progress" Height = 735 Left = 120 TabIndex = 5 Top = 1800 Width = 6495 Begin ComctlLib.ProgressBar ProgressBar Height = 375 Left = 240 TabIndex = 6 Top = 240 Width = 5895 _ExtentX = 10398 _ExtentY = 661 _Version = 327682 Appearance = 1 End End Begin MSComDlg.CommonDialog SelectFileDialog Left = 1080 Top = 4800 _ExtentX = 847 _ExtentY = 847 _Version = 393216 DefaultExt = "mp3" DialogTitle = "Select File For Burning" Filter = "All Files (*.*)|*.*|MP3 Files (*.mp3)|*.mp3" End Begin VB.TextBox edtMessages Height = 2055 Left = 360 MultiLine = -1 'True ScrollBars = 3 'Both TabIndex = 0 Top = 3840 Width = 5895 End Begin VB.Frame Frame2 Caption = "Nero Messages" Height = 2535 Left = 120 TabIndex = 1 Top = 3480 Width = 6495 End Begin VB.Frame Frame1 Caption = "File Name" Height = 735 Index = 1 Left = 120 TabIndex = 2 Top = 120 Width = 6495 Begin VB.CommandButton Browse Caption = "Browse" Height = 375 Left = 4680 TabIndex = 9 Top = 240 Width = 1455 End Begin VB.TextBox edtFileName Height = 375 Left = 240 Locked = -1 'True ScrollBars = 1 'Horizontal TabIndex = 4 Top = 240 Width = 4215 End End Begin VB.Frame Frame1 Caption = "Burn Control" Height = 735 Index = 2 Left = 120 TabIndex = 3 Top = 2640 Width = 6495 Begin VB.CommandButton Burn Caption = "Burn" Enabled = 0 'False Height = 375 Left = 240 TabIndex = 8 Top = 240 Width = 4215 End Begin VB.CommandButton btnAbort Caption = "Abort" Enabled = 0 'False Height = 375 Left = 4680 TabIndex = 7 Top = 240 Width = 1455 End End Begin MSComDlg.CommonDialog CommonDialog1 Left = 2400 Top = 4200 _ExtentX = 847 _ExtentY = 847 _Version = 393216 DefaultExt = "mp3" Filter = "All Files (*.*)|*.*|MP3 Files (*.mp3)|*.mp3" End End Attribute VB_Name = "neroFiddlesCOMForm" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Public WithEvents nero As nero Attribute nero.VB_VarHelpID = -1 Public drives As INeroDrives Attribute drives.VB_VarHelpID = -1 Public WithEvents drive As NeroDrive Attribute drive.VB_VarHelpID = -1 Public cnt As Integer Public Folder As INeroFolder Public strMessages As String Function NameFromPath(strPath As String) As String Dim lngPos As Long Dim strPart As String Dim blnIncludesFile As Boolean lngPos = InStrRev(strPath, "\") blnIncludesFile = InStrRev(strPath, ".") > lngPos strPart = "" If lngPos > 0 Then If blnIncludesFile Then strPart = Right$(strPath, Len(strPath) - lngPos) End If End If NameFromPath = strPart End Function Private Sub Browse_Click() SelectFileDialog.CancelError = True On Error GoTo ErrHandler SelectFileDialog.Flags = cdlOFNHideReadOnly SelectFileDialog.FilterIndex = 2 SelectFileDialog.ShowOpen edtFileName.Text = SelectFileDialog.FileName Burn.Enabled = True Exit Sub ErrHandler: Exit Sub End Sub Private Sub btnAbort_Click() nero.Abort End Sub Private Sub Burn_Click() btnAbort.Enabled = True Browse.Enabled = False Burn.Enabled = False Set Folder = New NeroFolder Dim drives As INeroDrives Set drives = nero.GetDrives(NERO_MEDIA_CDR) Set drive = drives(AvailableDevices.ListIndex) Dim isotrack As NeroISOTrack Set isotrack = New NeroISOTrack isotrack.Name = "TestTrack" isotrack.RootFolder = Folder Dim file As NeroFile Set file = New NeroFile Folder.Files.Add file file.Name = NameFromPath(edtFileName.Text) file.SourceFilePath = edtFileName.Text isotrack.BurnOptions = NERO_BURN_OPTION_CREATE_ISO_FS + NERO_BURN_OPTION_USE_JOLIET drive.BurnIsoAudioCD "Pop Star", "Title", 0, isotrack, Nothing, Nothing, NERO_BURN_FLAG_SIMULATE + NERO_BURN_FLAG_WRITE, 4, NERO_MEDIA_CD GoTo quit handle_error: strMessages = strMessages + Err.Description + Chr(13) + Chr(10) + nero.LastError edtMessages = strMessages quit: End Sub Private Sub drive_onaborted(Abort As Boolean) Abort = False End Sub Private Sub drive_OnAddLogLine(TextType As NEROLib.NERO_TEXT_TYPE, Text As String) strMessages = strMessages + Text + Chr(13) + Chr(10) edtMessages = strMessages End Sub Private Sub drive_OnDoneBurn(StatusCode As NEROLib.NERO_BURN_ERROR) strMessages = strMessages + Chr(13) + Chr(10) + nero.ErrorLog + Chr(13) + Chr(10) strMessages = strMessages + nero.LastError + Chr(13) + Chr(10) strMessages = strMessages + "Burn finished " If StatusCode <> NEROLib.NERO_BURN_OK Then strMessages = strMessages + "NOT (" & StatusCode & ")" End If strMessages = strMessages + "successfully!" + Chr(13) + Chr(10) edtMessages = strMessages btnAbort.Enabled = False Browse.Enabled = True Burn.Enabled = True ProgressBar.Value = 0 End Sub Private Sub drive_OnDoneWaitForMedia(Success As Boolean) strMessages = strMessages + "Done waiting for media." + Chr(13) + Chr(10) edtMessages = strMessages End Sub Private Sub drive_onprogress(ProgressInPercent As Long, Abort As Boolean) Abort = False ProgressBar.Value = ProgressInPercent End Sub Private Sub drive_OnSetPhase(Text As String) strMessages = strMessages + Text + Chr(13) + Chr(10) edtMessages = strMessages End Sub Private Sub Form_Initialize() Set nero = New nero ProgressBar.Value = 0 strMessages = "" Dim drives As INeroDrives Set drives = nero.GetDrives(NERO_MEDIA_CDR) For myIndex = 0 To drives.Count - 1 AvailableDevices.AddItem drives(myIndex).DeviceName, myIndex Next AvailableDevices.ListIndex = 0 ErrHandler: Exit Sub End Sub Private Sub nero_OnFileSelImage(FileName As String) ImageFileDialog.CancelError = True On Error GoTo ErrHandler ImageFileDialog.Flags = cdlOFNHideReadOnly ImageFileDialog.FilterIndex = 2 ImageFileDialog.ShowOpen FileName = ImageFileDialog.FileName Exit Sub ErrHandler: Exit Sub End Sub Private Sub nero_OnMegaFatal() strMessages = strMessages + "A mega fatal error has occurred." + Chr(13) + Chr(10) edtMessages = strMessages End Sub Private Sub nero_OnNonEmptyCDRW(Response As NEROLib.NERO_RESPONSE) strMessages = strMessages + "CD-RW not empty!" + Chr(13) + Chr(10) edtMessages = strMessages Response = NERO_RETURN_EXIT End Sub Private Sub nero_OnRestart() strMessages = strMessages + "The system is being restarted." + Chr(13) + Chr(10) edtMessages = strMessages End Sub Private Sub nero_OnWaitCD(WaitCD As NEROLib.NERO_WAITCD_TYPE, WaitCDLocalizedText As String) strMessages = strMessages + WaitCDLocalizedText + Chr(13) + Chr(10) edtMessages = strMessages End Sub Private Sub nero_OnWaitCDDone() strMessages = strMessages + "Done waiting for CD." + Chr(13) + Chr(10) edtMessages = strMessages End Sub Private Sub nero_OnWaitCDMediaInfo(LastDetectedMedia As NEROLib.NERO_MEDIA_TYPE, LastDetectedMediaName As String, RequestedMedia As NEROLib.NERO_MEDIA_TYPE, RequestedMediaName As String) strMessages = strMessages + "Waiting for a particular media type:" + Chr(13) + Chr(10) strMessages = strMessages + RequestedMediaName + Chr(13) + Chr(10) edtMessages = strMessages End Sub Private Sub nero_OnWaitCDReminder() strMessages = strMessages + "Still waiting for CD..." + Chr(13) + Chr(10) edtMessages = strMessages End Sub My poor attempt: Global $oNero_UDFGlobal $oComError_UDFGlobal = ObjEvent("AutoIt.Error", "__Nero_COM_Error") $oNero_UDFGlobal = ObjCreate("nero.nero") $oNero_Someting = ObjCreate("NeroDrive.nero") ;~ $Folder = ObjEvent($oNero_UDFGlobal, "Drive_", "INeroFolder" ) ;~ _DM(_NeroOpen()) ;~ _DM(_NeroGetDrives()) _DM() Func _NeroOpen() ;~ $oNero_UDFGlobal = ObjCreate("nero.nero");new nero object ;~ $oNeroDrive = ObjCreate('nero.NeroDrive') If IsObj($oNero_UDFGlobal) Then;make sure it's opened Return True Else SetError(3) Return False EndIf EndFunc Func _NeroGetDrives() ;~ drivesObjEvent ($oNero_UDFGlobal, "functionprefix" [, "interface name"] ) ;~ $oEvent = INeroDrives ;~ Return $oNero_UDFGlobal.GetDrives(NERO_MEDIA_CDR) EndFunc Func _NeroClose() $oNero_UDFGlobal = '' EndFunc Func __Nero_COM_Error() Local $hNumber = Hex($oComError_UDFGlobal.number, 8) ;blantly stolen from SvenP (We'll call it a 'port') MsgBox(0, 'Nero Com Error', 'There was COM Error!' & @CRLF & @CRLF & _ 'description is: ' & @TAB & $oComError_UDFGlobal.description & @CRLF & _ 'windescription:' & @TAB & $oComError_UDFGlobal.windescription & @CRLF & _ 'number is: ' & @TAB & $hNumber & @CRLF & _ 'lastdllerror is: ' & @TAB & $oComError_UDFGlobal.lastdllerror & @CRLF & _ 'scriptline is: ' & @TAB & $oComError_UDFGlobal.scriptline & @CRLF & _ 'source is: ' & @TAB & $oComError_UDFGlobal.source & @CRLF & _ 'helpfile is: ' & @TAB & $oComError_UDFGlobal.helpfile & @CRLF & _ 'helpcontext is: ' & @TAB & $oComError_UDFGlobal.helpcontext _ ) SetError(1) EndFunc ;==>__Nero_COM_Error As you can see I have NO clue what I'm doing... Any tips?
×
×
  • Create New...