Leaderboard
Popular Content
Showing content with the highest reputation on 03/22/2024 in all areas
-
AutoItHelp v3.3.16.1 with external CSS loading
argumentum reacted to donnyh13 for a topic
This works: as per: https://stackoverflow.com/questions/11300887/which-css-versions-are-supported-in-chm-files in the htm file, <!-- <META HTTP-EQUIV="Content-Type" CONTENT="text-html;charset=UTF-8"> --> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> and @media works in the chm! Edit: actually I don't have to comment out the other Meta either. But I'm not sure if it serves purpose? with the new one?1 point -
AutoItHelp v3.3.16.1 with external CSS loading
donnyh13 reacted to argumentum for a topic
I checked and the engine that it uses, is the same as a chm file somehow. navigator.userAgent = Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.2; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; Tablet PC 2.0) Maybe is a good "web browser" for viewing these files.1 point -
As discussed here: I created a DLL (x86 and x64) to do a file compare like the FC.exe does (only binary comparison!) but filling up the memory which can be read out by Autoit. UDF _WinAPI_FileCompare.au3: ;Version v0.70 build 2024-03-23 beta #include-once ; #FUNCTION# ==================================================================================================================== ; Name ..........: _WinAPI_FileCompareBinaryString ; Description ...: Reads two files into the memory and compares them byte by byte. Result is saved in the memory. ; Syntax ........: _WinAPI_FileCompareBinaryString($sFile1, $sFile2, Byref $tMemArray) ; Parameters ....: $sFile1 - first file to read. ; $sFile2 - second file to read. ; $tMemArray - a ptr dll struct which holds a ptr entry which is filled by the DLL. ; Return values .: Number of unequal bytes found in both files otherwise negative value on error. ; Author ........: UEZ ; Modified ......: ; Remarks .......: The memory pointer $tMemArray must be released using _MemGlobalFree() which holds the pointer to the result. ; The result contains hex string values (offset, file1, file2) from the differences between the two files. ; Large memory consumption for files > 80 MB as everything is kept in memory! ; Related .......: ; Link ..........: https://www.autoitscript.com/forum/index.php?showtopic=211619 ; Example .......: No ; =============================================================================================================================== Func _WinAPI_FileCompareBinaryString($sFile1, $sFile2, ByRef $tMemArray) If Not FileExists($sFile1) Then Return SetError(-10, 0, 0) If Not FileExists($sFile2) Then Return SetError(-20, 0, 0) If Not FileGetSize($sFile1) Then Return SetError(-30, 0, 0) If Not FileGetSize($sFile2) Then Return SetError(-40, 0, 0) If Not IsDllStruct($tMemArray) Then Return SetError(-50, 0, 0) Local $aReturn = DllCall(@AutoItX64 ? "_WinAPI_FileCompare_x64.dll" : "_WinAPI_FileCompare.dll", "int64", "_WinAPI_FileCompareBinaryString", "str", $sFile1, "str", $sFile2, "struct*", $tMemArray) If @error Then Return SetError(-60, 0, 0) If $aReturn[0] < 0 Then SetError($aReturn[0], 0, 0) Return $aReturn[0] EndFunc ;==>_WinAPI_FileCompareBinaryString ; #FUNCTION# ==================================================================================================================== ; Name ..........: _WinAPI_FileCompareBinary ; Description ...: Reads two files into the memory and compares them byte by byte. Result is saved in the memory. ; Syntax ........: _WinAPI_FileCompareBinary($sFile1, $sFile2, Byref $tMemArray) ; Parameters ....: $sFile1 - first file to read. ; $sFile2 - second file to read. ; $tMemArray - a ptr dll struct which holds a ptr entry which is filled by the DLL. ; Return values .: Number of unequal bytes found in both files otherwise negative value on error. ; Author ........: UEZ ; Modified ......: ; Remarks .......: The memory pointer $tMemArray must be released using _MemGlobalFree() which holds the pointer to the result. ; The result contains integer values (offset, file1, file2) from the differences between the two files. ; Large memory consumption as everything is kept in memory but 1/3 less than _WinAPI_FileCompareBinaryString. ; Related .......: ; Link ..........: https://www.autoitscript.com/forum/index.php?showtopic=211619 ; Example .......: No ; =============================================================================================================================== Func _WinAPI_FileCompareBinary($sFile1, $sFile2, ByRef $tMemArray) If Not FileExists($sFile1) Then Return SetError(-10, 0, 0) If Not FileExists($sFile2) Then Return SetError(-20, 0, 0) If Not FileGetSize($sFile1) Then Return SetError(-30, 0, 0) If Not FileGetSize($sFile2) Then Return SetError(-40, 0, 0) If Not IsDllStruct($tMemArray) Then Return SetError(-50, 0, 0) Local $aReturn = DllCall(@AutoItX64 ? "_WinAPI_FileCompare_x64.dll" : "_WinAPI_FileCompare.dll", "int64", "_WinAPI_FileCompareBinary", "str", $sFile1, "str", $sFile2, "struct*", $tMemArray) If @error Then Return SetError(-60, 0, 0) If $aReturn[0] < 0 Then SetError($aReturn[0], 0, 0) Return $aReturn[0] EndFunc ;==>_WinAPI_FileCompareBinary ; #FUNCTION# ==================================================================================================================== ; Name ..........: _WinAPI_FileComparePrint ; Description ...: Reads two files into the memory and compares them byte by byte. Result will be printed to the console only. ; Syntax ........: _WinAPI_FileComparePrint($sFile1, $sFile2[, $bUnbuffered = False]) ; Parameters ....: $sFile1 - first file to read. ; $sFile2 - second file to read. ; $bUnbuffered - [optional] a boolean value. Default is False. If $bUnbuffered then file will be read ; byte by byte and result will be displayed, otherwise both files will be read into the ; memory and then compared. ; Return values .: 1 if successfull, otherwise 0. ; Author ........: UEZ ; Modified ......: ; Remarks .......: Use #AutoIt3Wrapper_Change2CUI=y when compiling to display result in console. ; Related .......: ; Link ..........: https://www.autoitscript.com/forum/index.php?showtopic=211619 ; Example .......: No ; =============================================================================================================================== Func _WinAPI_FileComparePrint($sFile1, $sFile2, $bUnbuffered = False) If Not FileExists($sFile1) Then Return SetError(-10, 0, 0) If Not FileExists($sFile2) Then Return SetError(-20, 0, 0) If Not FileGetSize($sFile1) Then Return SetError(-30, 0, 0) If Not FileGetSize($sFile2) Then Return SetError(-40, 0, 0) DllCall(@AutoItX64 ? "_WinAPI_FileCompare_x64.dll" : "_WinAPI_FileCompare.dll", "none", "_WinAPI_FileComparePrint", "str", $sFile1, "str", $sFile2, "bool", $bUnbuffered) If @error Then Return SetError(-60, 0, 0) Return 1 EndFunc ;==>_WinAPI_FileComparePrint Func _WinAPI_FileCompareAbout() DllCall(@AutoItX64 ? "_WinAPI_FileCompare_x64.dll" : "_WinAPI_FileCompare.dll", "none", "About") EndFunc ;==>_WinAPI_FileCompareAbout Example1: ;Coded by UEZ build 2024-03-22 beta #AutoIt3Wrapper_UseX64=y #include <WinAPIFiles.au3> #include <Memory.au3> #include "_WinAPI_FileCompare.au3" Global $tMemArray = DllStructCreate("ptr addr") Global $fTimer = TimerInit() Global $iReturn = _WinAPI_FileCompareBinaryString("img1.bmp", "img2.bmp", $tMemArray) ConsoleWrite("Dll runtime: " & TimerDiff($fTimer) & " ms" & @CRLF) If $iReturn Then If _WinAPI_IsBadReadPtr($tMemArray.addr, $iReturn) <> 1 Then ConsoleWrite(@CRLF) ConsoleWrite("Displaying result..." & @CRLF) ConsoleWrite("Offset" & @TAB & @TAB & "File1" & @TAB & "File2" & @CRLF) Global $i, $j, $t, $c = 0 For $i = 0 To $iReturn For $j = 0 To 2 $t = DllStructCreate("char string[15]", Ptr($tMemArray.addr + $i * 15 + ($j = 0 ? $j : 6 + $j * 3))) ConsoleWrite($t.string & ($j = 0 ? ":" : "") & @TAB) Next $c += 1 ConsoleWrite(@CRLF) Next ConsoleWrite(@CRLF) ConsoleWrite("Found " & $c & " differences!" & @CRLF) ConsoleWrite(@CRLF) If $tMemArray.addr Then _MemGlobalFree($tMemArray.addr) Else ConsoleWrite("Access violation to memory address" & @CRLF) EndIf Else ConsoleWrite("Files are equal!" & @CRLF) EndIf Example2: ;Coded by UEZ build 2024-03-22 beta #AutoIt3Wrapper_UseX64=y #include <WinAPIFiles.au3> #include <Memory.au3> #include "_WinAPI_FileCompare.au3" Global $tMemArray = DllStructCreate("ptr addr") Global $fTimer = TimerInit() Global $iReturn = _WinAPI_FileCompareBinary("img1.bmp", "img2.bmp", $tMemArray) ConsoleWrite("Dll runtime: " & TimerDiff($fTimer) & " ms" & @CRLF) If $iReturn Then If _WinAPI_IsBadReadPtr($tMemArray.addr, $iReturn) <> 1 Then ConsoleWrite(@CRLF) ConsoleWrite("Displaying result..." & @CRLF) ConsoleWrite("Offset" & @TAB & @TAB & "File1" & @TAB & "File2" & @CRLF) Global $i, $j, $t, $c = 0 For $i = 0 To $iReturn For $j = 0 To 2 Switch $j Case 0 $t = DllStructCreate("ulong offset", Ptr($tMemArray.addr + $i * 8)) ConsoleWrite(Hex($t.offset, 8) & ":" & @TAB) Case 1 $t = DllStructCreate("ubyte hex1", Ptr($tMemArray.addr + $i * 8 + 4)) ConsoleWrite(Hex($t.hex1, 2) & @TAB) Case 2 $t = DllStructCreate("ubyte hex2", Ptr($tMemArray.addr + $i * 8 + 5)) ConsoleWrite(Hex($t.hex2, 2) & @TAB) EndSwitch Next $c += 1 ConsoleWrite(@CRLF) Next ConsoleWrite(@CRLF) ConsoleWrite("Found " & $c & " differences!" & @CRLF) ConsoleWrite(@CRLF) If $tMemArray.addr Then _MemGlobalFree($tMemArray.addr) Else ConsoleWrite("Access violation to memory address" & @CRLF) EndIf Else ConsoleWrite("Files are equal!" & @CRLF) EndIf Example3: ;Coded by UEZ build 2024-03-22 beta #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Change2CUI=y #include "_WinAPI_FileCompare.au3" _WinAPI_FileComparePrint("img1.bmp", "img2.bmp") I used the two images from here: Examples output should look like this here (always hex values): Dll runtime: 5.6315 ms Displaying result... Offset File1 File2 0009AB99: F0 C7 0009AB9A: EF CB 0009AB9B: 81 34 0009C795: 23 00 0009C796: 7C 80 0009C797: F5 FF Found 6 differences! You can read out the result and put it to an array... With this version you should be able to use multi-threading / multi-calls of the DLL as the memory is now allocated with each call. For x86 it may fail when the memory cannot be allocated (2GB limit) and the dll will return 0. I may add another feature to the DLL to get around the x86 limitation at the expense of speed by using chunked memory allocation if it makes sense... All files can be found also in the 7-Zip archive. _WinAPI_FileCompare DLL v0.70 build 2024-03-22.7z1 point
-
I assume you are asking the source code of the DLL -> Freebasic.1 point
-
AutoItHelp v3.3.16.1 with external CSS loading
argumentum reacted to donnyh13 for a topic
At least we know now what to look for.1 point -
AutoItHelp v3.3.16.1 with external CSS loading
donnyh13 reacted to argumentum for a topic
http://download.jgsoft.com/helpscribble/UserAgent.chm Turns out that yes: HTML Help User Agent navigator.userAgent = Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; Win64; x64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; Tablet PC 2.0) https://stackoverflow.com/questions/11300887/which-css-versions-are-supported-in-chm-files Ok then. We'll have to work with what we've got. Edit: Where to get "Windows Internet Explorer 7 for Windows XP" from.1 point -
AutoItHelp v3.3.16.1 with external CSS loading
argumentum reacted to donnyh13 for a topic
According to those two links i referenced, it stopped at IE7 no matter what version is installed, but I'll see if I can figure out how to use the code you posted. Edit: it could be I don't have an up-to-date IE install. Will check1 point -
AutoItHelp v3.3.16.1 with external CSS loading
donnyh13 reacted to argumentum for a topic
1 point -
AutoItHelp v3.3.16.1 with external CSS loading
argumentum reacted to donnyh13 for a topic
Okay. Thank you very much for that information. I can at least reproduce it now.1 point -
AutoItHelp v3.3.16.1 with external CSS loading
donnyh13 reacted to argumentum for a topic
4k is nice to look at. Never gave it 2 thoughts until I got me one. But the problem is the scaling, not the size of the monitor. The only difference is that at 200% a 1080p ( 1k ), it would look like 800x600 monitor ( give or take ). A 4k is not needed to code the scaling. The visual oddness can be seen in a 1k all the same. 200% is too easy ( pixel wise ) so I do 175% or 225% just to accentuate the ugliness ( or better named: "misalignment" ) Just like you, am not a web developer. So all this CSS stuff. Mind boggling.1 point -
Probably... ConsoleWrite( _ExecuteNums("100^2-96^2") & @CRLF) Func _ExecuteNums($vData) Local Const $sRE = "(\d+\h*[\*\\\^]\h*\d+)" Return Execute(StringRegExpReplace($vData, $sRE, "\($1\)")) EndFunc I didn't exclusively test this... you may want to1 point
-
Thanks Zedna and ioa747. With understanding how the "SysTreeView321" is define, I can get further now. Thank you to enlighten me.1 point
-
now I understood that _TreeView is not yours but from another program let's open the auto it help file and try this #include <GuiTreeView.au3> $hWnd = WinActivate("AutoIt Help (v3.3.16.1)", "") $hTreeView = ControlGetHandle($hWnd, "", "SysTreeView321") ConsoleWrite("$hTreeView=" & $hTreeView & @CRLF) $sTViewPath = "AutoIt|Function Reference|Window Management|Controls" $iItemCnt = ControlTreeView ( $hWnd, "", $hTreeView, "GetItemCount" , $sTViewPath) ConsoleWrite("Item Count " & $iItemCnt & @CRLF) $hItemFound = _GUICtrlTreeView_FindItem($hTreeView, "ControlClick") ConsoleWrite("$hItemFound=" & $hItemFound & @CRLF) _GUICtrlTreeView_SelectItem($hTreeView, $hItemFound) Local $hItemOld = $hItemFound For $i = 1 To $iItemCnt -1 $hItemOld = _GUICtrlTreeView_GetNext($hTreeView, $hItemOld ) _GUICtrlTreeView_SelectItem($hTreeView, $hItemOld) Sleep(500) Next1 point
-
AutoItHelp v3.3.16.1 with external CSS loading
argumentum reacted to donnyh13 for a topic
Alright @argumentum, thank you for the detailed explanation, it has helped a lot. I wasn't aware of what the complete goal was in the end, other than making some nice CSS files, in regards to colour. But I see your point of not changing more than is necessary (for an overall patch to submit). I'll have to go back to the drawing board on the distances etc. Though I do hope someone more experienced, if not you, has time to come up with a solution, I'm still figuring the whole thing out. (I haven't used CSS or HTML before this week). I wasn't aware that it would change much with monitor size, though it does make sense. Other than scaling, I unfortunately don't have an opportunity to try it on a bigger monitor, let alone 4k, but I'm guessing instead of px, a percentage or else "em", or "vw" needs to be used, but that's still just a thought.1 point -
Here is my function _TreeView_GetAll() which gets whole content of TreeView control, in this case even from external application: Here you can see how to simply traverse the whole TreeView ... #Include <String.au3> #Include <GuiTreeView.au3> $sAll = _TreeView_GetAll('OLE/COM Object Viewer', '', 'SysTreeView322') FileDelete('treeview_get_all.txt') FileWrite('treeview_get_all.txt', $sAll) ;~ClipPut($sAll) Func _TreeView_GetAll($title, $text, $classNN, $expand = False, $indent = ' ', $bullet = '') ; $bullet = '- ' $hWnd = ControlGetHandle($title, $text, $classNN) $sAll = '' If $expand Then _GUICtrlTreeView_Expand($hWnd) ; Expand All $hItem = _GUICtrlTreeView_GetFirstItem($hWnd) While $hItem <> 0x00000000 $sItem = _GUICtrlTreeView_GetText($hWnd, $hItem) $level = _GUICtrlTreeView_Level($hWnd, $hItem) $sIndent = _StringRepeat($indent, $level) $sAll &= $sIndent & $bullet & $sItem & @CRLF $hItem = _GUICtrlTreeView_GetNext($hWnd, $hItem) WEnd Return $sAll EndFunc1 point
-
AutoItHelp v3.3.16.1 with external CSS loading
donnyh13 reacted to argumentum for a topic
The chopping out the unnecessary extra empty rows looks nice in my view. In regards to the links: Keeping the " buttons / links " right there, in that position / place, is ideal for when is not an IE browser or not a chm file, the looks are the same. Keeping that I believe is important, given that the same html, is the one used for the web and chm help interfaces. That is, for general distribution. All this, that worked in this patch of the chm, has to be transferred/coded, to the scripts and sources that builds the htm files, that in turn builds the chm. All keeping the default look and feel as it always was. And, the same in a 1080p as in a 4k scaled. Unfortunately 4k scaled don't have a great look as is right now**: That's the idea anyway ( with the freedom to make it look like you just did above ) I don't have time right now to get knee deep into it and revise it After all, if I don't present an acceptable solution to the devs, I don't think they are not going to devote time to change something that is functional and already in place. Hopefully I'll have a full weekend to have a "go at it" and get it done. But I don't see such weekend in sight close by for now. > Actually, a further note, there was needless (?) empty space above the example text, so I modified the following: > .codeSnippetContainerCode > margin-top:14px; ** coming back to that. In a 4k 200% scale, "14px" would not be the same as in 1080p 100% scale. We need a CSS solution for that, that will work for IE11/CHM1 point -
I can live with manual downloading of UDF to gain the advantage of quick fixes. Thank you for clarification.1 point
-
So you understand the rules and then you go on saying you want to use this stuff for game automation.. really? So explain please! Ps: all others please stay out for now.1 point
-
Well I'm no expert so there may in fact be a simple way to do it. I was about to test your script by creating an array to hold the control id's returned from GUICtrlCreateTreeViewItem and see how it correlates to a straight index value (1-155). Will post the findings. edit: The Controls IDs are consecutive, but they start at 5 instead of 0 (or 1). #include <GUIConstantsEx.au3> #include <GuiTreeView.au3> #include <WindowsConstants.au3> #include <array.au3> local $gui010 = guicreate('TreeView Test') local $aSZE = wingetclientsize($gui010) local $TV010 = guictrlcreatetreeview(0,0,$aSZE[0],$aSZE[1]-40) local $btn010 = guictrlcreatebutton('Generate Treeview Debug Data To Console',20,$aSZE[1]-30,$aSZE[0]-40) local $x,$y ; just for handle holders to create child elements local $total_entries = 0 Local $arrIDs[155][2] $IDindx = 1 _GUICtrlTreeView_BeginUpdate($TV010) ;For $1 = 1 To Random(1, 10, 1) For $1 = 1 To 5 $arrIDs[$IDindx-1][0] = $IDindx $x = GUICtrlCreateTreeViewItem(StringFormat("[%02d] Level 1", $1),$TV010) $arrIDs[$IDindx-1][1] = $x $IDindx += 1 $total_entries += 1 ;For $2 = 1 To Random(1, 10, 1) For $2 = 1 To 5 $arrIDs[$IDindx-1][0] = $IDindx $y = GUICtrlCreateTreeViewItem(StringFormat("[%02d] Level 2", $2),$x) $arrIDs[$IDindx-1][1] = $y $IDindx += 1 $total_entries += 1 ;for $3 = 1 to random(1, 10,1) for $3 = 1 to 5 $arrIDs[$IDindx-1][0] = $IDindx $arrIDs[$IDindx-1][1] = GUICtrlCreateTreeViewItem(StringFormat("[%02d] Level 3", $3),$y) $IDindx += 1 $total_entries += 1 next Next Next _GUICtrlTreeView_EndUpdate($TV010) ConsoleWrite('Generated = ' & $total_entries & ' entries' & @LF) guisetstate() while 1 switch guigetmsg() case $gui_event_close Exit case $btn010 _out() _ArrayDisplay($arrIDs) EndSwitch WEnd func _out() local $str ConsoleWrite('GETCOUNT = ' & _GUICtrlTreeView_GetCount($TV010) & @LF) for $1 = 0 to _GUICtrlTreeView_GetCount($TV010) $str &= stringformat( 'Text = %-15s Child Switch = %-5s CTLID = %03i Parent CTLID = %03i Parent Handle = %-8s Sibling Count = %03i Child Count = %03i', _ _GUICtrlTreeView_GetText($TV010, $1), _ _GUICtrlTreeView_GetChildren($TV010,$1), _ _GUICtrlTreeView_GetItemParam($tv010,$1), _ _GUICtrlTreeView_GetParentParam($TV010,$1), _ _GUICtrlTreeView_GetParentHandle($TV010,$1), _ _GUICtrlTreeView_GetSiblingCount($TV010,$1), _ _GUICtrlTreeView_GetChildCount($TV010,$1) ) & @lf next ConsoleWrite($str & @LF) endfunc1 point
-
HII;; I have alrerady say. Don't have errerur 00 points