Leaderboard
Popular Content
Showing content with the highest reputation on 07/04/2017 in all areas
-
Version 1.1
492 downloads
Params Tool is a tool to call exe's with a parameter you write in the input box. It will execute the written commands just like cmd prompt window. If the input field is empty, the default cmd is "/?" To start this tool: Double click it, it will write to registry. From there on it's just a question of shift+right click the exe you want to apply parameters to. To remove from registry: call the tool with the parameter /RemoveReg1 point -
Your comparison is not equal filewrite you should compare with fprintf or stringstreams ini file writing you should compare with https://www.autoitscript.com/autoit3/docs/functions/IniWrite.htm filewriting ini files will be normally much faster then the WritePrivateProfileString Win32 API's Long ago it was implemented like this in AutoIt . void AutoIt_Script::IniWrite(VectorVariant &vParams, Variant &vResult) { char szFileTemp[_MAX_PATH+1]; // Get the fullpathname (ini functions need a full path) Util_GetFullPathName(vParams[0].szValue(), szFileTemp); if (WritePrivateProfileString(vParams[1].szValue(), vParams[2].szValue(), vParams[3].szValue(), szFileTemp)) WritePrivateProfileString(NULL, NULL, NULL, szFileTemp); // Flush else vResult = 0; // Error, default is 1 } // IniWrite()1 point
-
I have updated and added a new option 32. I was having problems with some product pages that the site owner would comment out, modularly, products for which are no longer sold or are entirely out of stock. So me trying to make a program to scan for new products was causing all kinds of problems by showing tons of items that appear in the source code, all formatted nicely but in fact aren't actually "there", so if he uncommented those products I would not get notified because ChunkV2 had technically seen the items listed in the page's sourcecode. I had to google for the regex string and add a !? on the end because the guy's site I am interacting with finished some comments with --!> and sometimes --> By the way, here is a real-world example of using ChunkV2 #include <includes\ChunkV2.au3> #include <Array.au3> AutoItSetOption('TrayAutoPause', 0) Global $Zones[4][2], $Zones2[2][2], $PreviouslySeen[0], $url = "https://www.heinnie.com/all-products" $PreviouslySeen = FileReadToArray('productlist.txt') ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $Zones[0][0] = '<ul id="productlist"' $Zones[0][1] = '</ul>' $Zones[1][0] = '<li class="item">' $Zones[1][1] = '</li>' $Zones[2][0] = '<h2 class="product-name">' $Zones[2][1] = '</h2>' $Zones[3][0] = '" title="' $Zones[3][1] = '">' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $Zones2[0][0] = '<ul id="productlist"' $Zones2[0][1] = '</ul>' $Zones2[1][0] = '<li class="item">' $Zones2[1][1] = '</li>' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; While 1 $source = _INetGetSource($url, False) $Results = ChunkV2($source, $Zones) ; Returns raw product names $Results2 = ChunkV2($source, $Zones2) ; Returns the entire block of code for each product, so the count will be the same as the product names above. (no subscript errors) Local $new = False For $a = 0 To UBound($Results) - 1 $product = ((StringInStr($Results2[$a], '<div class="ukfriendlycarry">')) ? ('(UK Legal)' & @TAB) : (@TAB & @TAB & @TAB)) & $Results[$a] $test = _ArraySearch($PreviouslySeen, $product) If $test < 0 Then $new = True ConsoleWrite($product & @LF) FileWriteLine('productlist.txt', $product) If Not IsArray($PreviouslySeen) Then Global $PreviouslySeen[0] ReDim $PreviouslySeen[UBound($PreviouslySeen) + 1] $PreviouslySeen[UBound($PreviouslySeen) - 1] = $product EndIf Next If $new Then Beep(500, 1000) Sleep(300000) WEnd1 point
-
Hello. You can need to use ptr and DllStructCreate to store your byte array. I'm no sure but It would be better if the function support had the byte array length as return. something like (DWORD vstHandle, BOOL isPreset, DWORD* length) Otherwise You will need to allocate an unkown memory space. Edit ;~ public static byte[] BASS_VST_GetChunk( ;~ int vstHandle, ;~ bool isPreset ;~ ) ;~ This could be something like this Local $aRet=DllCall($_ghbassVSTDll,"ptr","BASS_VST_GetChunk","int",$vstHandle,"boolean",$isPreset) Local $tByteArray=DllStructCreate("byte[1024]",$aRet[0]) ;Of couse you need to allocate more than 1024 ;if the dll call allow the return size required (as I said before) if would look like Local $aRet=DllCall($_ghbassVSTDll,"ptr","BASS_VST_GetChunk","int",$vstHandle,"boolean",$isPreset,"dword*",0) ;then you could do something like this to allocate your byte array memory space. Local $tByteArray=DllStructCreate("byte[" & $aRet[3] & "]",$aRet[0]) Saludos1 point
-
Auto Fill Problem
dangkhoa9xset reacted to Danp2 for a topic
The React library wraps the input element to encapsulate it and it appears to monitor for the keypress event. I played around with this over the last day or so and finally came up with what I believe is a working solution -- #include <FF V0.6.0.1b-15.au3> $sURL = "https://www.grammarly.com/signup?breadcrumbs=true&install=true" _FFConnect() If _FFIsConnected() Then _FFOpenURL($sURL) $sInput = _FFObjGet("_60f178-field", "class") ; returns a string - no object! If @error = $_FF_ERROR_Success Then _FFSendReact($sInput, "autoit") EndIf Else MsgBox(0,"Error:", "Can't connnect to FireFox") EndIf Func _FFSendReact($sElement, $sValue = "") If StringLeft($sElement, 7) = "OBJECT|" Then $sElement = StringMid($sElement, 8) If StringLeft($sElement, 1) = "." Then $sElement = "window.content.document" & $sElement _FFCmd('FFau3.sendReact=function sendReact(a,b){try{var c=FFau3.WCD.createEvent("KeyboardEvent");for (var i = 0, len = b.length; i < len; i++) {c.initKeyEvent("keypress",true,true,null,false,false,false,false,b.charCodeAt(i),b.charCodeAt(i));a.dispatchEvent(c);};return 1}catch(e){return-1}return 0};') _FFCmd("FFau3.sendReact(" & $sElement & ",'" & $sValue & "');") EndFunc1 point -
#include <WinAPI.au3> #include <WinAPIsysinfoConstants.au3> _WinAPI_SystemParametersInfo($SPI_SETFONTSMOOTHING, True, 0, BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE)) _WinAPI_SystemParametersInfo($SPI_SETFONTSMOOTHINGTYPE, 0, $FE_FONTSMOOTHINGCLEARTYPE, BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE)) Tested on Win7Pro1 point
-
GUI design concepts.
antonioj84 reacted to PlayHD for a topic
One of my old projects... #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <WinApi.au3> Global $RBOX_EVENT_CLOSE = 1 Global $ROUNDES = 20, $LastHwnd = 0 Global $GUIBKCOLOR = 0xEEC591 Global $ARRAY_COLOR_TOP_MIN[3] = [36 ,65 ,142] , $ARRAY_COLOR_TOP_MAX[3] = [11 ,42 ,122] Local $hGui = RBoxCreate("Gui Design PHD",800,600) While 1 CheckX($hGui,$RBOX_EVENT_CLOSE,"GuiCtrlSetColor("&$RBOX_EVENT_CLOSE&",0xA3A3A3)","GuiCtrlSetColor("&$RBOX_EVENT_CLOSE&",0x555555)") $gMsg = GUIGetMsg() Switch $gMsg Case $RBOX_EVENT_CLOSE, $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func RBoxCreate($Title,$width, $height ,$left=-1 ,$top=-1 ,$show=1) Local $GUI = GUICreate($Title,$width,$height,$left,$top,$WS_POPUP) GUISetBkColor($GUIBKCOLOR,$GUI) _GuiRoundCorners($GUI,0,0,$ROUNDES,$ROUNDES) $RBOX_EVENT_CLOSE = GUICtrlCreateLabel('X',$width-20,3,25,25) GUICtrlSetCursor($RBOX_EVENT_CLOSE,0) GUICtrlSetBkColor($RBOX_EVENT_CLOSE,-2) GUICtrlSetFont($RBOX_EVENT_CLOSE,15,800) GUICtrlSetColor($RBOX_EVENT_CLOSE,0x555555) $Title &= " " Local $hTitle = GUICtrlCreateLabel($Title,0,0,$width-20,26,$SS_CENTER,$GUI_WS_EX_PARENTDRAG) GUICtrlSetFont($hTitle,17,400,0,"Consolas") GUICtrlSetBkColor($hTitle,-2) Local $Graphic = GUICtrlCreateGraphic (0,0, $width, 25) GUICtrlSetState($Graphic,$Gui_DISABLE) GradientFill($Graphic, 0, 0, $width, 25, $ARRAY_COLOR_TOP_MIN, $ARRAY_COLOR_TOP_MAX) If $show = 1 Then GUISetState(@SW_SHOW,$GUI) Return $GUI EndFunc Func CheckX($hGui, $CtrlID, $sCMD, $eCMD) Local $cGui = GUIGetCursorInfo($hGui) If Not IsArray($cGui) Then Return 0 if $LastHwnd <> $cGui[4] And $cGui[4] = $CtrlID Then Return Execute($sCMD) + Assign("LastHwnd",$cGui[4]) if $LastHwnd <> $cGui[4] Then Return Execute($eCMD) + Assign("LastHwnd",$cGui[4]) EndFunc Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3) Dim $pos, $ret, $ret2 $pos = WinGetPos($h_win) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3, "long", $i_y3) If $ret[0] Then $ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1) If $ret2[0] Then Return 1 Else Return 0 EndIf Else Return 0 EndIf EndFunc Func GradientFill($im, $x1, $y1, $width, $height, $left_color, $right_color) Local $color0=($left_color[0]-$right_color[0])/$height Local $color1=($left_color[1]-$right_color[1])/$height $color2=($left_color[2]-$right_color[2])/$height For $Y=0 to $height-1 $red=$left_color[0]-floor($Y*$color0) $green=$left_color[1]-floor($Y*$color1) $blue=$left_color[2]-floor($Y*$color2) $col = Dec(Hex($blue,2) & Hex($green,2) & Hex($red,2)) GUICtrlSetGraphic($im,$GUI_GR_COLOR, $col) GUICtrlSetGraphic($im,$GUI_GR_MOVE,0,$Y) GUICtrlSetGraphic($im,$GUI_GR_LINE,$width,$Y) Next GUICtrlSetGraphic($im,$GUI_GR_COLOR, 0x000000) GUICtrlSetGraphic($im,$GUI_GR_MOVE,0,$height) GUICtrlSetGraphic($im,$GUI_GR_LINE,$width,$height) GUICtrlSetGraphic($im,$GUI_GR_REFRESH) EndFunc Here is a screen : http://prntscr.com/ni5sq1 point