Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/07/2017 in all areas

  1. jguinch

    WinExists problem

    RunWait pauses the script until the process finishes. Use Run instead. an example : Local $iPid = Run(@ComSpec & " /c" & $cmd) While ProcessExists($iPid) If WinExists("Windows Installer") Then ControlClick("Windows Installer", "","[CLASS:Button; INSTANCE:1]") Sleep(100) WEnd
    2 points
  2. Updates.sq3I've spent a little time on your question. I've changed the schema to apply what I said in previous post. The Updates table is more or less your original, but I added an explicit ID (alias for rowid). There are 4 new tables: Productcodes: tables of all known product codes, each given an Id (alias for rowid) Languages: table of all known languages, each given an Id (alias for rowid) Two other tables link Updates IDs to productcodeIDs and languagesIDs (N to N relationships). Using this schema, a sample query to find applicable updates to a given productcode for a given language might look like this (I interpreted language '0000' as "language-independant and I may miss something else): select distinct U.Id, KBARTICLENUMBER, DESCRIPTION, PLATFORM, TARGETPRODUCTNAME, MSPFILENAME, ISCHECKED from updates U join updprod up on u.id = up.updid join productcodes pc on up.prodid = pc.id join updlang ul on u.id = ul.updid join languages l on ul.langid = l.id where prod = '90140000-003D-0000-1000-0000000FF1CE' and lang in ('0000', '0422') It returns 52 results (distinct updates) in 20ms on my very slow PC. Of course that is just a simple example off the top of my head. To play with the joined DB (I changed the extension to avoid collision) without having to write code, download and install SQLite Expert (home edition is free) from http://www.sqliteexpert.com/ and then you can issue SQL queries/statements and adapt the schema if needed. You'll probably have to add suitable indices for the actual queries you need, and possibly make the schema more powerful using triggers and much more, depending on your actual use. Updates.sq3 Updates.sq3
    2 points
  3. Update Post 1 - Release CLRv3a - added CLR Constants.au3 - Danyfirex - Global Constants added (Magic numbers) - added .NET CLR CreateObject vs ObjCreate Example.au3 - Junkew • 2 approaches give the same result (only valid for COM Visible Assembly) • Includes a function that shows you which Assembly Classes are COM Visible - added .Net Conventional COM Objects Examples - ptrex - added .NET CLR CreateComInstanceFrom Example - Danyfirex - You can use it for Regfree COM Assembly Access - System.Activator has 4 methods : • CreateComInstanceFrom : Used to create instances of COM objects. • CreateInstanceFrom : Used to create a reference to an object from a particular assembly and type name. • GetObject : Used when marshaling objects. • CreateInstance : Used to create local or remote instances of an object. - added .NET Access SafeArrays Using AccVarsUtilities Example - LarsJ - added SafeArray Utilities functions in Includes - LarsJ - added .NET Access Native MSCorLib Classes - System - ptrex Multiple System Class Examples : • System.Random • System.DateTime • System.Diagnostics.PerformanceCounter • System.IO.FileInfo • System.Int32 • System.Double • System.Speech • System.Web - added Third Party Assembly Access - ptrex • WinSCP : https://winscp.net/eng/download.php • IonicZip : http://dotnetzip.codeplex.com/
    1 point
  4. You can check out GDIP.au3 and look for _GDIPlus_ImageGetAllPropertyItems() function.
    1 point
  5. I use Window 10. Try the WinHTTP UDF. Saludos
    1 point
  6. "StockPrice-ALL.txt" file into a 2D array. #include <Array.au3> #include <Date.au3> Local $aFile Local $aFile = FileReadToArray("StockPrice-ALL.txt") ;_ArrayDisplay($aFile) Local $iUB = UBound($aFile) Local $iMaxCols = 1 ; Must be at least 1 column and less than 50. Local $tCur = _Date_Time_GetLocalTime() Local $aRetArray[$iUB][50] = [[$aFile[0] & " - " & _Date_Time_SystemTimeToDateTimeStr($tCur)], [$aFile[1]]] ; First 2 lines and unknown number of columns (less than 50). For $i = 2 To $iUB - 1 ; Start on 3rd line $aTemp = StringSplit($aFile[$i], ";", 2) If UBound($aTemp) > $iMaxCols Then $iMaxCols = UBound($aTemp) ; Find maximum number of columns. For $j = 0 To UBound($aTemp) - 1 $aRetArray[$i][$j] = $aTemp[$j] Next Next ReDim $aRetArray[$iUB][$iMaxCols] ; Add extra row in array if last line in file is blank. StringReplace(FileRead("StockPrice-ALL.txt"), @LF, "") If @extended = $iUB Then _ArrayAdd($aRetArray, "", 0, ";", $iUB) ; Add extra row to array. _ArrayDisplay($aRetArray)
    1 point
  7. If you remove the two first useless lines, then you have a SSV (semicolumn separated value) file which can be easily imported into an SQLite database, building a 9275-row table. You can query this DB using SQLite support proposed by AutoIt. Note that the last column has no explicit name in the header line. I believe it's due to an extraneous semicolumn at the end of each data line.
    1 point
  8. Another way: _FileWriteFromArray() , _FileReadToArray()
    1 point
  9. You can try with _ArrayToDeclarationString / _ArrayDeclareFromString from here :
    1 point
  10. @coffeeturtle..Thanks but I actually wanted to know if there was any way of doing this via cmd. Also i dont know about flat files but I could do it using the normal text file. But it is not as efficient as the cmd way. There is a method to pass normal variables using cmd, but i couldn't find one for arrays.
    1 point
  11. Tjalve, Here you go: #include <GUIConstantsEx.au3> #include <GuiTreeView.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> ; Flag for TV selection change Global $hItemSelected = 9999 ;~ Create GUI dim $guilabel[7] local $currentlevel = 1 Local $hGui = GUICreate( "Grejs", 1000, 500, 600, 300, BitOR( $GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX ) ) Local $iBorderWidth = 4, $aPos = WinGetClientSize( $hGui ) $hTV = _GUICtrlTreeView_Create($hGui, $iBorderWidth, $iBorderWidth, $aPos[0]-2*$iBorderWidth-400, $aPos[1]-2*$iBorderWidth-30 ) $root_level = _GUICtrlTreeView_Add($hTV,0,"Root") $item1 = _GUICtrlTreeView_AddChild($hTV, $root_level, "child1") $item2 = _GUICtrlTreeView_AddChild($hTV, $root_level, "child2") $item3 = _GUICtrlTreeView_AddChild($hTV, $root_level, "child3") ;~ Start Gui GUISetState() GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch ; If flag set If $hItemSelected <> 9999 Then ; Here is the action MsgBox($MB_SYSTEMMODAL, "Selected", _GUICtrlTreeView_GetText($hTV, $hItemSelected)) ; Clear flag $hItemSelected = 9999 EndIf WEnd GUIDelete($hGui) Exit Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam ; Create NMTREEVIEW structure Local $tStruct = DllStructCreate("struct;hwnd hWndFrom;uint_ptr IDFrom;INT Code;endstruct;" & _ "uint Action;struct;uint OldMask;handle OldhItem;uint OldState;uint OldStateMask;" & _ "ptr OldText;int OldTextMax;int OldImage;int OldSelectedImage;int OldChildren;lparam OldParam;endstruct;" & _ "struct;uint NewMask;handle NewhItem;uint NewState;uint NewStateMask;" & _ "ptr NewText;int NewTextMax;int NewImage;int NewSelectedImage;int NewChildren;lparam NewParam;endstruct;" & _ "struct;long PointX;long PointY;endstruct", $lParam) If DllStructGetData($tStruct, "hWndFrom") = $hTV Then Switch DllStructGetData($tStruct, "Code") ; If item selection changed Case $TVN_SELCHANGEDA, $TVN_SELCHANGEDW Local $hItem = DllStructGetData($tStruct, "NewhItem") ; Set flag to selected item handle If $hItem Then $hItemSelected = $hItem EndSwitch EndIf EndFunc Note that I changed the variable in which you store the return from _GUICtrlTreeView_Create to reflect the fact that you get a handle and not a ControlID - please ask if you do not understand why this is important (or if you have any other questions). M23
    1 point
×
×
  • Create New...