All Activity

This stream auto-updates   

  1. Past hour
  2. well...first you would need to get the PID of the program you're trying to edit... which should look something like this... $pid = run("C:\LOCATION") Func HWndProc($iPid, $iOption = 1, $sTitle = "", $iTimeout = 2000) Local $aReturn[1][1] = [[0]], $aWin, $hTimer = TimerInit() While 1 $aWin = WinList($sTitle) For $i = 1 To $aWin[0][0] If $iPid = WinGetProcess($aWin[$i][1]) Then If $iOption = 1 OR ($iOption = 0 And $aWin[$i][0] <> "") Then Return $aWin[$i][1] ElseIf $iOption = 2 Then ReDim $aReturn[UBound($aReturn) + 1][2] $aReturn[0][0] += 1 $aReturn[$aReturn[0][0]][0] = $aWin[$i][0] $aReturn[$aReturn[0][0]][1] = $aWin[$i][1] EndIf EndIf Next If $iOption = 2 And $aReturn[0][0] > 0 Then Return $aReturn If TimerDiff($hTimer) > $iTimeout Then ExitLoop Sleep(Opt("WinWaitDelay")) WEnd then you'd need to search that program's memory somehow, and show the addresses of data that matches for your integers
  3. Today
  4. Hello. Use str instead char* Saludos
  5. I'm trying to call the NSS_Init() function in nss3.dll. The DllCall either fails or crashes AutoIt (rc:-1073741819) and I can't figure out what I'm doing wrong. Does anyone see the problem? #AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 _Test() Func _Test() Local $h_Glue = DllOpen(@ProgramFilesDir & "\Mozilla Firefox\mozglue.dll") Local $h_NSS = DllOpen(@ProgramFilesDir & "\Mozilla Firefox\nss3.dll") Local $a_Ret = DllCall($h_NSS, "str", "NSS_GetVersion") If @error Then Return SetError(1, 0, "") ConsoleWrite($a_Ret[0] & @CRLF) ; 3.15.5 Basic ECC $a_Ret = DllCall($h_NSS, "int", "NSS_Init", "char*", "C:\Documents and Settings\TigBits\Application Data\Mozilla\Firefox\Profiles\tigbits.default") ; @error = 1 ;~ $a_Ret = DllCall($h_NSS, "int", "NSS_Init", "str", "C:\Documents and Settings\TigBits\Application Data\Mozilla\Firefox\Profiles\tigbits.default") ; hard crash ;~ Local $t_CHAR = DllStructCreate("CHAR[300];") ;~ DllStructSetData($t_CHAR, 1, "C:\Documents and Settings\TigBits\Application Data\Mozilla\Firefox\Profiles\tigbits.default") ;~ $a_Ret = DllCall($h_NSS, "int", "NSS_Init", "ptr", DllStructGetPtr($t_CHAR)) ; hard crash $a_Ret = DllCall($h_NSS, "bool", "NSS_IsInitialized") If @error Then Return SetError(2, 0, "") ConsoleWrite($a_Ret[0] & @CRLF) ; 0 because NSS_Init failed DllClose($h_Glue) DllClose($h_NSS) EndFunc #cs extern SECStatus NSS_Init(const char *configdir); configdir: A pointer to a string containing the pathname of the directory where the certificate, key, and security module databases reside. typedef enum { SECWouldBlock = -2, SECFailure = -1, SECSuccess = 0 } SECStatus; #ce
  6. @Au3Builder But I dont want to hide the controls window. If change to 'invisible', it hides all
  7. Yesterday
  8. Had you thought about it, or searched the forum, you would have found the answer to both questions - discussed multiple times. Will it? If Jon deems it worth adding. When? When Jon deems it worth adding. Locking this thread as it has been discussed ad nauseam.
  9. Map feature would be really a nice thing in AutoIt as seen in the 3.3.15.0 beta version. Will this functionality be taken up in a stable future release ? I do not ask when. I know the response ;-).
  10. Out of curiosity no real issue to fix. Can I do recursion with the ?: operators? in combination with eval, assign, execute functions Example 3 breaks whereas 1 and 2 are fine Global $j=3 ;~ Example 1 Global $trick="$j<10 ? 4 : 5" Global $j=execute($trick) consolewrite($j & @crlf) ;~ Example 2 Global $a="$j+2" Global $trick="eval(""j"")<10 ? execute(eval(""a"")) : (execute(eval(""a"")) * 5)" $j=execute($trick) consolewrite($j & @crlf) consolewrite($trick & @crlf) ;~ Example 3 Global $a="$j+2" Global $trick="eval(""j"")<10 ? (execute(eval(""a"")) + (execute(eval(""trick""))*0) ) : (execute(eval(""a"")) * 5)" $j=execute($trick) consolewrite($j & @crlf) ;~ consolewrite($x & @crlf) consolewrite($trick & @crlf) Exit Wondering if you can do something like this (pseudocode) $trick="($j=<10) ? $j=j+1 + (consolewrite($j) & @CRLF ) + execute($trick) : (consolewrite("end" & @CRLF)) I can imagine then I have to use more functions like assign, execute, eval etc. $trick="($j=<10) ? assign(""j"",execute(""j+1"")) + (consolewrite($j) & @CRLF ) + execute($trick) : (consolewrite("end" & @CRLF))
  11. Hello, Community. My goal is to create a script that will repeatedly hit the "scan" button in thinkorwim scanner (in case anyone's familiar with it). I will work on looping it later, because now it just doesn't work. The cursor is moving, the window becomes activated, but no clicks come through. I can't use ControlClick because I can't get control ID or anything from this button. If you have any advice at all, please do share - maybe it can be done via entirely different approach. Screenshot attached. $pos=MouseGetPos() MouseClick("left",690,310,1,0) MouseMove($pos[0],$pos[1],0) WinActivate ( "Stock Hacker Main@thinkorswim [build 1922]" )
  12. "And they say I'm just a grumpy old man..... " If so then you are a very kind old man Thank you for this, it makes so much more sense now if i read the construct of the code TBH i understand this forum has his own rules, because many guys ask questions like i did and also many guys ask questions before reading the forum rules and get punished more or less for this. I tried to learn about AutoIT but for someone who is not familiar with programming it is hard. With your help and look into your changes it was like turning a litght on Many thanks for this!
  13. @NguyenLe Try making the following change to _WD_WaitElement -- If $iErr Then SetError(__WD_Error($sFuncName, $iErr)) EndIf Basically, by adding the If...EndIf, it stops __WD_Error for being called unless an error was previously detected.
  14. Good catch, Miliardsto. I was aware of some issues in the latest AutoIt version, but not having upgraded yet myself, I was unaware that some of these might affect CodeScanner's proper functioning. Let's hope the devs get on top of it soon. Glad you found a way forward regardless though.
  15. This is super! I normally do this through a message box or the like. Its kind of ironic that this type of error checking is almost always required, yet I had never thought to write a function to be used as the goto, instead opting to use Consolewrite and message boxes written at the time of error to figure out what value is being passed when something unexpected is being returned. This will go into my standard includes. Thank you.
  16. Beated my own expectation down to 3 lines and shortened in bytes (using the $fcBtn makes it shorter could have made it $f offcourse but goal was not to obfuscate) local $fcBtn=GUICtrlCreateButton, $j=0, $2=0, $amsg[]=[0,0,0,0,0], $BA[] = ["7", "8", "9", "+", "C", "4", "5", "6", "-", "SqRt", "1", "2", "3", "*", ".", "0", "(", ")", "/", "="], $hGui = GUICreate("Calc", 360, 330, 229, 118), $f=GUISetFont(18, 400, 0, "MS Sans Serif"), $D = GUICtrlCreateInput("", 8, 8, 344, 31, BitOR(0x00000080, 2)), $1 = GUISetState(@SW_SHOW),$2 = $fcBtn($BA[0],7,50,65, 63) , $2 = $fcBtn($BA[1],77,50,65, 63) ,$2 = $fcBtn($BA[2],147,50,65, 63) ,$2 = $fcBtn($BA[3],217,50,65, 63) ,$2 = $fcBtn($BA[4],287,50,65, 63) ,$2 = $fcBtn($BA[5],7,120,65, 63) ,$2 = $fcBtn($BA[6],77,120,65, 63) ,$2 = $fcBtn($BA[7],147,120,65, 63) ,$2 = $fcBtn($BA[8],217,120,65, 63) ,$2 = $fcBtn($BA[9],287,120,65, 63) ,$2 = $fcBtn($BA[10],7,190,65, 63) ,$2 = $fcBtn($BA[11],77,190,65, 63) ,$2 = $fcBtn($BA[12],147,190,65, 63) ,$2 = $fcBtn($BA[13],217,190,65, 63) ,$2 = $fcBtn($BA[14],287,190,65, 63) ,$2 = $fcBtn($BA[15],7,260,65, 63) ,$2 = $fcBtn($BA[16],77,260,65, 63) ,$2 = $fcBtn($BA[17],147,260,65, 63) ,$2 = $fcBtn($BA[18],217,260,65, 63) ,$2 = $fcBtn($BA[19],287,260,65, 63) Do Until ((assign("aMsg",GUIGetMsg(1))=1) and ($aMsg[2]=0 ? $2=0 : (GUICtrlRead($aMsg[0]) = "C" ? GUICtrlSetData($D, "") : GUICtrlRead($aMsg[0]) = "SqRt" ? GUICtrlSetData($D, Sqrt(Execute(GUICtrlRead($D)))) : GUICtrlRead($aMsg[0]) = "=" ? GUICtrlSetData($D, Execute(GUICtrlRead($D))) : GUICtrlSetData($D, GUICtrlRead($D) & GUICtrlRead($aMsg[0]))) and ($aMsg[0]=-3))=true) or ($aMsg[0] = -3) ; $GUI_EVENT_CLOSE I think I am out of tricks but maybe an MVP knows how to get it into a one liner
  17. With more tinkering this seems to be the issue. These errors aren't present on external sites. Thank You.
  18. And they say I'm just a grumpy old man..... #include <GDIPlus.au3> #include <ScreenCapture.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() HotKeySet("{ESC}", "_Exit") While 1 Capture_Window() Sleep(5000) WEnd Func _Exit() _GDIPlus_Shutdown() Exit EndFunc Func Capture_Window() Local $hWnd = WinGetHandle("[CLASS:Notepad]") Local $w = _WinAPI_GetWindowWidth($hWnd) Local $h = _WinAPI_GetWindowHeight($hWnd) Local Const $hDC_Capture = _WinAPI_GetDC(HWnd($hWnd)) Local Const $hMemDC = _WinAPI_CreateCompatibleDC($hDC_Capture) Local Const $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC_Capture, $w, $h) Local Const $hObjectOld = _WinAPI_SelectObject($hMemDC, $hHBitmap) DllCall("gdi32.dll", "int", "SetStretchBltMode", "hwnd", $hDC_Capture, "uint", 4) DllCall("user32.dll", "int", "PrintWindow", "hwnd", $hWnd, "handle", $hMemDC, "int", 0) _WinAPI_DeleteDC($hMemDC) _WinAPI_SelectObject($hMemDC, $hObjectOld) _WinAPI_ReleaseDC($hWnd, $hDC_Capture) Local Const $hFullScreen = WinGetHandle("[TITLE:Program Manager;CLASS:Progman]") Local Const $aFullScreen = WinGetPos($hFullScreen) Local Const $c1 = $aFullScreen[2] - @DesktopWidth, $c2 = $aFullScreen[3] - @DesktopHeight Local Const $wc1 = $w - $c1, $hc2 = $h - $c2 If (($wc1 > 1 And $wc1 < $w) Or ($w - @DesktopWidth > 1) Or ($hc2 > 7 And $hc2 < $h) Or ($h - @DesktopHeight > 1)) And (BitAND(WinGetState(HWnd($hWnd)), 32) = 32) Then Local $hBmp_t = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) $hBmp = _GDIPlus_BitmapCloneArea($hBmp_t, 8, 8, $w - 16, $h - 16) _GDIPlus_BitmapDispose($hBmp_t) Else $hBmp = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) EndIf _WinAPI_DeleteObject($hHBitmap) Local $sSaveFileName = @ScriptDir & "\screenshot - " & @MDAY & @MON & @YEAR & '-' & @HOUR &@MIN& @SEC & ".png" _GDIPlus_ImageSaveToFile($hBmp, $sSaveFileName) EndFunc I've made some essential changes and some just to make it more portable for me... I'm sure you'll figure out what is what (note the save path change).
  19. Hi. I have a program that have a control axWindowsMediaPlayer1, classname ATL:000007FED88B80D01. I need to get the information about the current position of the video. I know that the UDF "wmp.au3" have this function, but i dont know how to define the axWindowsMediaPlayer1 as objet to use the UDF. Regards.
  20. I downgraded autoit from newest version from february to ver autoit-v3.3.14.2-setup and it works good like before
  21. That's more useful than setting the entire column/control text direction. Thanks jchd.
  22. Hi. made some changes. Maybe you will agree: $INP_FieldValue1 = IniRead($ScriptFile_In & ".ini", "Res", "Field1Value", "") ; #552 reverted back to old one $INP_FieldValue2 = IniRead($ScriptFile_In & ".ini", "Res", "Field2Value", "") ; #554 reverted back to old one If $INP_FieldValue1 = "" Then $INP_FieldValue1 = IniRead($AutoIt3WapperIni, "Res", "Field1Value", "") ; #595 reverted back to old one If $INP_FieldValue2 = "" Then $INP_FieldValue2 = IniRead($AutoIt3WapperIni, "Res", "Field2Value", "") ; #597 reverted back to old one ; #1649ff For $U = 1 To $INP_Res_FieldCount ; changed order with $INP_FieldName1 & $INP_FieldValue1 & $INP_FieldName2 & $INP_FieldValue2 If $INP_FieldName[$U] <> "" And $INP_FieldValue[$U] <> "" Then $INP_FieldValue[$U] = Convert_Variables($INP_FieldValue[$U]) $Res_StringTable_Children &= _Res_Create_RTVersion_BuildStringTableEntry($INP_FieldName[$U], $INP_FieldValue[$U]) EndIf Next If $INP_FieldName1 & $INP_FieldValue1 <> "" Then $Res_StringTable_Children &= _Res_Create_RTVersion_BuildStringTableEntry($INP_FieldName1, Convert_Variables($INP_FieldValue1)) ; converting here If $INP_FieldName2 & $INP_FieldValue2 <> "" Then $Res_StringTable_Children &= _Res_Create_RTVersion_BuildStringTableEntry($INP_FieldName2, Convert_Variables($INP_FieldValue2)) ; converting here ; about #4060ff If $INP_FieldName1 <> "" Then If Not StringInStr($INP_FieldNameEdit, $INP_FieldName1) Then ; excluding if field name is equal $INP_FieldNameEdit &= $INP_FieldName1 & " = " & $INP_FieldValue1 & @CRLF EndIf EndIf If $INP_FieldName2 <> "" Then If Not StringInStr($INP_FieldNameEdit, $INP_FieldName2) Then ; excluding if field name is equal $INP_FieldNameEdit &= $INP_FieldName2 & " = " & $INP_FieldValue2 & @CRLF EndIf EndIf Now no duplicates are written to current au3 script and macros like %date% and %time% in wrapper.ini will be written in current au3 script as macros. That's important for me as to see what is inside wrapper.ini. This I changed too: ; about #4580ff If $Changes > 0 Then __ConsoleWrite('-> ' & $Changes & ' Change(s) made.' & @CRLF) ; the whole update routine deleted here and putted after the EndIf Else __ConsoleWrite('-> No changes made..' & @CRLF) EndIf ... because I think "Save Only" should update source with wrapper.ini directives - otherwise I have "Cancel" to cancel. Fixed a missing AU3Check parameter: ' -w 7 : warn when passing Const or expression on ByRef param(s) (on)' & @CRLF & _ ; ~#4190ff ' -v 3 : show unreferenced UDFs and global variables (off)' Conrad
  23. Use the <> in the menubar to post code. I highly doubt that line 21 is the issue. This piece of code is is wrong logic and can create a recursion level error as well: Func Install() ;~ Install Program Local $CCHandle = WinGetHandle("[CLASS:#32770]", "CCleaner v5.39 Setup") If $CCHandle = 0x00000000 Then Sleep(1500) Install() EndIf Should be something like: (But still could be waiting forever so might want to put a limit to the wait time there) Func Install() ;~ Install Program Local $CCHandle = WinGetHandle("[CLASS:#32770]", "CCleaner v5.39 Setup") While $CCHandle = 0x00000000 Then Sleep(1500) $CCHandle = WinGetHandle("[CLASS:#32770]", "CCleaner v5.39 Setup") WEnd This code could be blocking as well as it is an endless wait: WinActivate($CCHandle, '') WinWaitActive($CCHandle, '') Just add a timer in the last line and test for that to trigger an error. Your other Func's have the same issue with the recursion and need to be changed as well. Jos
  24. i added the code in the hidden content on the 3rd post. Not sure how to post the code to make it colorful? As soon as the finish button is visible autoit thinks the script is finished too and quits. 21 was the top line in my post you replied to.
  25. .uiMode = "invisible" - hides the WMP window. $oMP.controls.play() - plays music $oMP.controls.pause() - pause music you can create custom buttons.
  26. Open to change proposals when you feel it can work better. Just send me the modification back and I will have a look and merge them back into my version in case I agree. Thanks, Jos
  1. Load more activity