Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/14/2022 in all areas

  1. Another update for v0.22 in the first post! More fixes and features. A couple to mention: You can now set font and background colors for labels, which I often use for visual layouts. Check the screenshot. Huge progress on the Tab control! It no longer glitches out when drawing. You can add and delete individual tabs, set tab names, and set tab text properties. All associated code creation and definition file saving/loading works as well. I also switched the object explorer to a treeview to show the tabitem parent/child relationship. To add new tabs, first draw the tab control. Then right-click on it to add as many new tabs as needed. To delete tabs, first click to activate the tab you want to delete. Then right-click on the tab control in the drawing area to delete the current tab. (eventually this can be added to the object explorer, but my brain got burnt out from all the TABS swirling around in there) To change the main tab control variable name, click on the tab control in the drawing area OR the top level item in the object explorer. To change the individual tab item names or display text, you must click on the tab item in the object explorer to activate the tab. Just clicking in the drawing area will only select the main tab control. All of this tab work has turned out to be a real BEAR (not quite a nightmare), but I am happy with where it's at for now. I think I am going to break from tabs for a while and work on other things. In the future, I'd like to be able to add controls inside tab items by drawing in the tab area. It shouldn't be too difficult, but just more things to keep track of. BE AWARE: there is a bug(?) where, when you delete the tab control, the property inspector tab control is also deleted! I suspect this has something to do with internal AutoIt functionality, but I am not too upset about it. I am probably going to change the properties to some other type of control anyway. Now you can set the position and size properties of multiple controls at once. This is really handy for aligning things - just select the controls, set the Left (or any) property, then they are align to the left! I also enjoy putting the mouse over the properties and scrolling with the mousewheel and watching the controls shift across the screen. Maybe I am just simple minded like that! 😁 Now when you move controls with the arrow keys, they shift by 1px in the direction of the arrow for fine adjustments. Holding the Ctrl button while pressing the arrow keys will shift the controls by 10px - very handy to speed things up. New statusbar to show informational messages. Changes:
    2 points
  2. You can't change the DSNServer for this UDF when that is the question.
    1 point
  3. Hello, I don't have enough time now to check this deeply, but You can handle it in this ugly way. _Test() Func _Test() Global $oHTTP = ObjCreate("Msxml2.ServerXMLHTTP") Global $tMyObject Global $oMyObject = __ObjectFromTag("__MyInterface_", "OnReadyStateChange hresult(object)", $tMyObject) Local $oScript = ObjCreate("ScriptControl") With $oScript .Language = "VBScript" .AddCode('Public Function CallBack:oAutoIt.OnReadyStateChange(oRequest):End Function') .AddObject('oAutoIt', $oMyObject) .AddObject('oRequest', $oHTTP) EndWith With $oHTTP .Open("GET", "https://www.autohotkey.com/download/1.1/version.txt", True) .onreadystatechange = $oScript.Eval('GetRef("CallBack")') .Send() EndWith ConsoleWrite("$oHTTP.readyState: " & $oHTTP.readyState & @CRLF) While $oHTTP.ReadyState <> 4 Sleep(100) WEnd Exit EndFunc ;==>_Test Func __MyInterface_QueryInterface($pSelf, $pRIID, $pObj) Local $tStruct = DllStructCreate("ptr", $pObj) DllStructSetData($tStruct, 1, $pSelf) Return 0 ; $S_OK EndFunc ;==>__MyInterface_QueryInterface Func __MyInterface_AddRef($pSelf) Return 1 EndFunc ;==>__MyInterface_AddRef Func __MyInterface_Release($pSelf) Return 1 EndFunc ;==>__MyInterface_Release Func __MyInterface_OnReadyStateChange($pSelf, $oRequest) If Not IsObj($oRequest) Then Return ConsoleWrite("Error $oRequest" & @CRLF) If $oRequest.ReadyState <> 4 Then Return 0 If $oRequest.Status = 200 Then MsgBox(0, "", "Latest AutoHotkey version: " & $oRequest.responseText) Else Exit MsgBox(0, "Error", "Status: " & $oRequest.Status) EndIf Return 0 ; $S_OK EndFunc ;==>__MyInterface_OnReadyStateChange Func __ObjectFromTag($sFunctionPrefix, $tagInterface, ByRef $tInterface, $bIsUnknown = Default, $sIID = "{00000000-0000-0000-C000-000000000046}") ; last param is IID_IUnknown by default If $bIsUnknown = Default Then $bIsUnknown = True Local $sInterface = $tagInterface ; copy interface description Local $tagIUnknown = "QueryInterface hresult(ptr;ptr*);" & _ "AddRef dword();" & _ "Release dword();" ; Adding IUnknown methods If $bIsUnknown Then $tagInterface = $tagIUnknown & $tagInterface ; Below line is really simple even though it looks super complex. It's just written weird to fit in one line, not to steal your attention Local $aMethods = StringSplit(StringTrimRight(StringReplace(StringRegExpReplace(StringRegExpReplace($tagInterface, "\w+\*", "ptr"), "\h*(\w+)\h*(\w+\*?)\h*(\((.*?)\))\h*(;|;*\z)", "$1\|$2;$4" & @LF), ";" & @LF, @LF), 1), @LF, 3) Local $iUbound = UBound($aMethods) Local $sMethod, $aSplit, $sNamePart, $aTagPart, $sTagPart, $sRet, $sParams, $hCallback ; Allocation $tInterface = DllStructCreate("int RefCount;int Size;ptr Object;ptr Methods[" & $iUbound & "];int_ptr Callbacks[" & $iUbound & "];ulong_ptr Slots[16]") ; 16 pointer sized elements more to create space for possible private props If @error Then Return SetError(1, 0, 0) For $i = 0 To $iUbound - 1 $aSplit = StringSplit($aMethods[$i], "|", 2) If UBound($aSplit) <> 2 Then ReDim $aSplit[2] $sNamePart = $aSplit[0] ; Replace COM types by matching dllcallback types $sTagPart = StringReplace(StringReplace(StringReplace(StringReplace($aSplit[1], "object", "idispatch"), "hresult", "long"), "bstr", "ptr"), "variant", "ptr") $sMethod = $sFunctionPrefix & $sNamePart $aTagPart = StringSplit($sTagPart, ";", 2) $sRet = $aTagPart[0] $sParams = StringReplace($sTagPart, $sRet, "", 1) $sParams = "ptr" & $sParams $hCallback = DllCallbackRegister($sMethod, $sRet, $sParams) DllStructSetData($tInterface, "Methods", DllCallbackGetPtr($hCallback), $i + 1) ; save callback pointer DllStructSetData($tInterface, "Callbacks", $hCallback, $i + 1) ; save callback handle Next DllStructSetData($tInterface, "RefCount", 1) ; initial ref count is 1 DllStructSetData($tInterface, "Size", $iUbound) ; number of interface methods DllStructSetData($tInterface, "Object", DllStructGetPtr($tInterface, "Methods")) ; Interface method pointers Return ObjCreateInterface(DllStructGetPtr($tInterface, "Object"), $sIID, $sInterface, $bIsUnknown) ; pointer that's wrapped into object EndFunc ;==>__ObjectFromTag Func __DeleteObjectFromTag(ByRef $tInterface) For $i = 1 To DllStructGetData($tInterface, "Size") DllCallbackFree(DllStructGetData($tInterface, "Callbacks", $i)) Next $tInterface = 0 EndFunc ;==>__DeleteObjectFromTag Saludos
    1 point
  4. Subz

    Addition value ini file

    Total results of all data for example: #include <GUIConstants.au3> Local $iTotal = 0, $vValue1, $vValue3 GUICreate("", 350, 700, -1, -1) GUISetBkColor(0x00E0FFFF) Local $idListView = GUICtrlCreateListView("CARD-ID'S|NAME AND SURNAME|REMAIN", 10, 10, 330, 600) ;,$LVS_SORTDESCENDING) Local $idValue = GUICtrlCreateButton("VALUE", 20, 630, 80, 20) Local $idTotal = GUICtrlCreateButton("TOTAL", 120, 630, 80, 20) Local $idTotalInput = GUICtrlCreateInput("", 220, 630, 80, 20) GUISetState() Local $nArray = IniReadSectionNames('CardID.ini') If Not @error Then For $i = 1 To $nArray[0] $vValue1 = IniRead("CardID.ini", $nArray[$i], "Value1", "") $vValue3 = IniRead("CardID.ini", $nArray[$i], "Value3", "") If Number($vValue3) > 0 Then $iTotal += $vValue3 GUICtrlCreateListViewItem($nArray[$i] &'|'& $vValue1 &"|"& $vValue3, $idListView) Next GUICtrlSetData($idTotalInput, $iTotal) EndIf While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $idValue MsgBox(0, "DETAIL", GUICtrlRead(GUICtrlRead($idListView)), 2) Case $idTotal GUICtrlSetData($idTotalInput,$iTotal) EndSwitch WEnd
    1 point
  5. @Jemboy Use the one that best suits the task at hand -- _WD_ElementAction implements standard webdriver actions related to elements _WD_ElementActionEx implements additional "advanced" actions that either involve executing a Javascript command or performing a set of actions with _WD_Action
    1 point
×
×
  • Create New...