Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/27/2022 in all areas

  1. Yes Just try it The test.cmd is in the current working directory.
    1 point
  2. Werty

    high contrast mode

    You have to yell louder, he is 14 years away.
    1 point
  3. I got the right idea, only reacting when realy needed: Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $sIcon, $tInfo, $iIndex, $iSub, $sRes, $aPos $sDLLName = GUICtrlRead($Combo) $hWndListView = $hListview If Not IsHWnd($hListview) Then $hWndListView = GUICtrlGetHandle($hListview) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode #cs Case $LVN_COLUMNCLICK ; A column was clicked <== Diese Nachricht erreicht die Funktion nicht mehr Local $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam) ConsoleWrite('GUIRegisterMsg: $LVN_COLUMNCLICK -->Column: ' & DllStructGetData($tInfo, "SubItem") & @CRLF) #ce Case $NM_RCLICK ; Sent by a list-view control when the user clicks an item with the right mouse button $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) $iIndex = DllStructGetData($tInfo, "Index") $iSub = DllStructGetData($tInfo, "SubItem") $sRes = _GUICtrlListView_GetItemText($hListview, $iIndex, $iSub) ConsoleWrite($iCode & @TAB & 'iIndex: ' & $iIndex & @TAB & 'iSub: ' & $iSub & @TAB & 'Text: ' & $sRes & @CRLF) If $iSub > 0 Then GUICtrlSetData($inpID, $sRes) $sIcon = @SystemDir & '\' & $sDLLName $sRes = -(1 + $sRes) ConsoleWrite($sIcon & @TAB & $sRes & @CRLF) GUICtrlSetImage($IconPreview, $sIcon, $sRes) EndIf Case $LVN_HOTTRACK $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) $iIndex = DllStructGetData($tInfo, "Index") $iSub = DllStructGetData($tInfo, "SubItem") If ($iIndex <> -1) And (($iIndex <> $iOldIndex) Or ($iSub <> $iOldSub)) Then $sRes = _GUICtrlListView_GetItemText($hListview, $iIndex, $iSub) ConsoleWrite($iCode & @TAB & 'ItemIndex: ' & $iIndex & @TAB & 'SubIndex: ' & $iSub & @TAB & 'Text: ' & $sRes & @CRLF) $aPos = MouseGetPos() If $iSub = 0 Then ToolTip('Zum späteren Speichern an-"Checken" (Mehrfachspeichern) um ganze Zeile zum Speichern zu übernehmen', $aPos[0]) Else ToolTip('Rechtsklick um IconID für (Einzel-) Speichern zu übernehmen', $aPos[0] + 20, $aPos[1] + 10) EndIf EndIf $iOldIndex = $iIndex $iOldSub = $iSub Case $NM_KILLFOCUS ; The control has lost the input focus ToolTip('') EndSwitch Case Else ToolTip('') EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY and the flickr is away.
    1 point
  4. Part of what you need could be provided by CodeScanner (link in my signature), notably: all code entry & exit points all user function definitions and function calls (native and UDF) all loops (type, start point, end point) all conditional evaluations (branching points), referrred to here as "phrases" EDIT: you would have to run CodeScanner on your target script (with all relevant options enabled) and then analyse/trace through the "references.txt" array in the generated CS subdirectory.
    1 point
  5. Hi @noellarkin I also looked for something like this a while ago, but unfortunately the only one I found ready for the AutoIt language was the visustin software you found too. it would be interesting to create one from scratch... (?) In this post from @junkew from some time ago (https://www.autoitscript.com/forum/topic/193792-canvas-udf-flowchartlike-examples/), there is a script that generates something that might look like. but obviously the graphic part is the least problematic one to generate. The missing (most important) part is the conversion of an AutoIt listing into blocks and block relationships (given an AutoIt list as input, the parser should produce a file with the block list and block relationships). ... easy to say ... anyone dare try their hand at this?
    1 point
  6. It looks like you are getting some interference with some random notification codes that you don't care about - like the "-12" when crossing the border between items. I would use $LVN_HOTTRACK for what you are trying to accomplish. Case $LVN_HOTTRACK ;~ $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam) $iIndex = DllStructGetData($tInfo, "Index") $iSub = DllStructGetData($tInfo, "SubItem") But now there is still another issue. For some reason, the tagNMLISTVIEW struct is returning sub-item 0 about half-way through sub-item 1, depending on how wide the column is set. No idea what is going on there, but one easy way to solve this is to use _GUICtrlListView_SubItemHitTest instead. Case $LVN_HOTTRACK ;~ $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) ;~ $tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam) ;~ $iIndex = DllStructGetData($tInfo, "Index") ;~ $iSub = DllStructGetData($tInfo, "SubItem") Local $aSubItemHitTest = _GUICtrlListView_SubItemHitTest($hListview) If $aSubItemHitTest[0] <> -1 Then $iIndex = $aSubItemHitTest[0] $iSub = $aSubItemHitTest[1] $sRes = _GUICtrlListView_GetItemText($hListview, $iIndex, $iSub) ConsoleWrite('Code: ' & $iCode & @TAB & 'ItemIndex: ' & $iIndex & @TAB & 'SubIndex: ' &$iSub & @TAB & 'Text: ' & $sRes & @CRLF) $aPos = MouseGetPos() If $iSub = 0 Then ToolTip('Zum späteren Speichern an-"Checken" (Mehrfachspeichern) um ganze Zeile zum Speichern zu übernehmen'); _ ;& @CRLF & ' bzw. Rechtsklick auf SubItem um IconID für (Einzel-) Speichern zu übernehmen') Else ToolTip('Rechtsklick um IconID für (Einzel-) Speichern zu übernehmen', $aPos[0]+20, $aPos[1]+10) EndIf Else ToolTip('') EndIf So now it is not quite as flaky. But as for the general flickering, that is something I have not figured out how to solve yet.
    1 point
  7. @NMS, I'm not sure exactly what is causing this issue, but here are 2 workarounds. More investigation is required to create a proper fix... Option 1: create the GUI with the $WS_EX_COMPOSITED extended style $hGUI = GUICreate('test', 100, 100, -1, -1, BITOR($WS_POPUP, $WS_BORDER), $WS_EX_COMPOSITED) Option 2: redraw the button AFTER showing the GUI with GUISetState $buttonID = GuiFlatButton_Create('test', 10, 40, 100, 20, $BS_LEFT) GUISetState(@SW_SHOW, $hGUI) _WinAPI_RedrawWindow(GUICtrlGetHandle($buttonID)) Hope this helps.
    1 point
  8. Getting started example step 3: WebView window First AutoIt implementation. Tested on Windows 10/7, 32/64 bit. Execute WebView2.au3: #AutoIt3Wrapper_Au3Check_Parameters=-d -w- 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_UseX64=y Opt( "MustDeclareVars", 1 ) #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPICom.au3> #include <WinAPI.au3> Global $hGui, $oCoreWebView2Environment, $oCoreWebView2Controller #include "..\Includes\WV2Interfaces.au3" WebView2() Func WebView2() $hGui = GUICreate( "WebView2 Sample", 1200, 900, -1, -1, $WS_OVERLAPPEDWINDOW ) _WinAPI_CoInitialize( $COINIT_APARTMENTTHREADED ) CoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerCreate() ConsoleWrite( "$pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler = " & $pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler & @CRLF & @CRLF ) CoreWebView2CreateCoreWebView2ControllerCompletedHandlerCreate() ConsoleWrite( "$pCoreWebView2CreateCoreWebView2ControllerCompletedHandler = " & $pCoreWebView2CreateCoreWebView2ControllerCompletedHandler & @CRLF & @CRLF ) Local $hWebView2Loader = DllOpen( @AutoItX64 ? "WebView2Loader-x64.dll" : "WebView2Loader-x86.dll" ) Local $aRet = DllCall( $hWebView2Loader, "long", "CreateCoreWebView2EnvironmentWithOptions", "wstr", "", "wstr", "", _ "ptr", NULL, "ptr", $pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler ) If @error Or $aRet[0] Then Return ConsoleWrite( "CreateCoreWebView2EnvironmentWithOptions ERR" & @CRLF ) ConsoleWrite( "CreateCoreWebView2EnvironmentWithOptions OK" & @CRLF & @CRLF ) GUISetState( @SW_SHOW ) While 1 Switch GUIGetMsg() Case $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESIZED Local $tRect = _WinAPI_GetClientRect( $hGui ) $oCoreWebView2Controller.put_Bounds( $tRect ) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd CoreWebView2CreateCoreWebView2ControllerCompletedHandlerDelete() CoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerDelete() DllClose( $hWebView2Loader ) EndFunc Func CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke( $pSelf, $long, $ptr ) ; Ret: long Par: long;ptr* ConsoleWrite( "CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke" & @CRLF ) $oCoreWebView2Environment = ObjCreateInterface( $ptr, $sIID_ICoreWebView2Environment, $dtag_ICoreWebView2Environment ) ConsoleWrite( "IsObj( $oCoreWebView2Environment ) = " & IsObj( $oCoreWebView2Environment ) & @CRLF & @CRLF ) $oCoreWebView2Environment.CreateCoreWebView2Controller( $hGui, $pCoreWebView2CreateCoreWebView2ControllerCompletedHandler ) Return 0 #forceref $pSelf, $long EndFunc Func CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke( $pSelf, $long, $ptr ) ; Ret: long Par: long;ptr* ConsoleWrite( "CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke" & @CRLF ) $oCoreWebView2Controller = ObjCreateInterface( $ptr, $sIID_ICoreWebView2Controller, $dtag_ICoreWebView2Controller ) ConsoleWrite( "IsObj( $oCoreWebView2Controller ) = " & IsObj( $oCoreWebView2Controller ) & @CRLF ) $oCoreWebView2Controller.AddRef() $oCoreWebView2Controller.get_CoreWebView2( $pCoreWebView2 ) $oCoreWebView2 = ObjCreateInterface( $pCoreWebView2, $sIID_ICoreWebView2, $dtag_ICoreWebView2 ) ConsoleWrite( "IsObj( $oCoreWebView2 ) = " & IsObj( $oCoreWebView2 ) & @CRLF & @CRLF ) Local $tRect = _WinAPI_GetClientRect( $hGui ) $oCoreWebView2Controller.put_Bounds( $tRect ) $oCoreWebView2.Navigate( "https://www.bing.com/" ) Return 0 #forceref $pSelf, $long EndFunc The code is translated to AutoIt from the C++ code in the Getting started example step 3 and from the AutoHotkey code in WebView2.ahk. A slightly updated example is included in WebView2-1.au3 in the 7z-file at bottom of this post.
    1 point
×
×
  • Create New...