Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/27/2013 in all areas

  1. Hello all, this script(wrapper) uses Alternative Data Streams to store INI formatted data in the active executable even while it is running. This is great for standalone executables, or storing data you don't want a user being able to edit! There are four simple commands: Func _iniwrite($section, $key, $value, $stream = "DEFAULT") return IniWrite(@ScriptFullPath&":"&$stream, $section, $key, $value) EndFunc Func _iniread($section, $key, $default = "", $stream = "DEFAULT") return IniRead(@ScriptFullPath&":"&$stream, $section, $key, $default) EndFunc Func _inidelete($section, $key = "", $stream = "DEFAULT") if $key <> "" Then Return IniDelete(@ScriptFullPath&":"&$stream, $section, $key) Else Return IniDelete(@ScriptFullPath&":"&$stream, $section) EndIf EndFunc Func _inirenamesection($section, $newsection, $flag = 0, $stream = "DEFAULT") return IniRenameSection(@ScriptFullPath&":"&$stream, $section, $newsection, $flag) EndFunc Simply copy and paste these functions into your script!
    1 point
  2. in _GUICtrlListView_GetItemText , second parametr is Index (Number) not String try: _GUICtrlListView_GetItemText($ListView1,0)
    1 point
  3. Rickname, Well, no-one is forcing you to use AutoIt, so if it pisses you off that much I suggest you use another language. If you want to fill an array of that size with "0" you need to use a loop: Global $array[100] For $i = 0 to uBound($array) - 1 $array[$i] = "0" Next You could always hide it in a wrapper function if you really felt that was too much code to write. M23
    1 point
  4. Jfish

    Insert Image Into Excel

    Howdy all. I was searching the net trying to find an easy way to insert an image into Excel when I came accross this VBA Code: http://www.exceltip.com/general-topics-in-vba/insert-pictures-using-vba-in-microsoft-excel.html. I took a few minutes to translate it to AU3 and was pleased to see it actually worked. I thought I would share it in case anyone needed something like it. #include <Excel.au3> #include <Array.au3>; for expansion to do many pics from an array $oExcel = _ExcelBookNew() $path = @ScriptDir&"\[YOUR IMAGE NAME]" $targetRange=$oExcel.ActiveSheet.Range("B5:D10") Func _TestInsertPictureInRange() _InsertPictureInRange($path, $targetRange) EndFunc _TestInsertPictureInRange() func _InsertPictureInRange($path, $targetRange) ; inserts a picture and resizes it to fit the TargetCells range Dim $p, $t, $l, $w, $h ; import picture $p = $oExcel.ActiveSheet.Pictures.Insert($path) ; determine positions With $targetRange $t = .Top $l = .Left $w = .Offset(0, .Columns.Count).Left - .Left $h = .Offset(.Rows.Count, 0).Top - .Top EndWith ; position picture With $p .Top = $t .Left = $l .Width = $w .Height = $h EndWith $p = "Nothing" EndFunc Enjoy.
    1 point
  5. water

    Insert Image Into Excel

    Thanks for the example. The rewrite of the Excel UDF contains such a function as well. It has some added functions to exactly place the picture and maintain the ratio if desired.
    1 point
  6. Because AutoIt developers might have thought that it could be done by the user as follows: #include <GUIConstants.au3> GUICreate("PhoenixXL | Test") GUISetState() Local $nMsg, $iTimer = -1, $aRet = DllCall("user32.dll", "uint", "GetDoubleClickTime") $aRet = $aRet[0] Do $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_PRIMARYDOWN ;Double Click encountered If TimerDiff($iTimer) <= $aRet Then ConsoleWrite("Double Click Event Ocurred" & @CRLF) $iTimer = TimerInit() EndSwitch Until $nMsg = $GUI_EVENT_CLOSE Regards
    1 point
×
×
  • Create New...