Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/13/2016 in all areas

  1. J1, how many total snapshots do you have? VBox is a little squirrely when it comes to reverting to snapshots. Perhaps a screenshot of your tree?
    1 point
  2. Knock yourself out. I would have added a couple of additional fixes/changes, so maybe when I back in AutoIt mode I will do it. Thanks
    1 point
  3. @JohnOne Snapshot restores all the data on the disk + RAM... Its like a picture taken with a camera Or a Time Machine
    1 point
  4. I tried for a while to do this in autoit, and failed. I did however find a great command line tool which can do it, and wrapped that in a fancy gui. Unfortunately I have no idea on this mess of a disk, where that wrapper is. Luckily I do remember what it's called, and can vouch for it's safety and validity, here's the link. https://r1ch.net/projects/forcebindip
    1 point
  5. 1 point
  6. RTFC

    Dll call help

    There's a difference in size between BOOLEAN (8 bits, unaligned = 1 BYTE) and BOOL (32-bits, memory-aligned = 4 BYTES).
    1 point
  7. jguinch

    Dll call help

    @J1 : I'm not clever with Dllcall and variables types, maybe you can confirm that : if I understand the helpfile, BYTE and BOOLEAN are both "an unsigned 8 bit integer", so it should work with both in the DllCall, no ?
    1 point
  8. When I compile an au3 file by right clicking or through aut2exe, it won't open when I double click it, no matter what the script is. When I try to open it, it just slows down my computer by a lot and never opens.
    1 point
  9. Your security software is blocking it. Consult its documentation.
    1 point
  10. Might as well actually demonstrate it then: $Process = "Notepad.exe" ; populate a few processes to be closed later Run($Process) Run($Process) Run($Process) ; the actual "process" you will initiate in your script $iPid = Run($Process) $Processes = ProcessList($Process) For $i = 1 To $Processes[0][0] If Not ($Processes[$i][1] = $iPid) Then ProcessClose($Processes[$i][1]) NextAnd now I'm getting bored #include <WinAPI.au3> $Process = "Notepad.exe" ; populate a few processes to be closed later For $i = 1 To 5 Run($Process) Next ; the actual "process" you will initiate in your script $iPid = Run($Process) ConsoleWrite($iPid & " will not be closed" & @CRLF) Sleep(1000) $a = WinList("[CLASS:Notepad]") Local $sPid, $x = 0, $y = 0 For $i = UBound($a)-1 To 1 Step -1 _WinAPI_GetWindowThreadProcessId($a[$i][1],$sPid) ControlSetText($a[$i][1],"",15,"PID=[" & $sPid & "]") WinMove($a[$i][1],"",$x,$y) $x+=10 $y+=80 Next MsgBox(1,1,$iPid & " will not be closed") $Processes = ProcessList($Process) For $i = 1 To $Processes[0][0] If Not ($Processes[$i][1] = $iPid) Then ProcessClose($Processes[$i][1]) Next
    1 point
  11. Here you go. Global $WhitelistSinglePID = "15616" Global $Process = "Notepad.exe" ;Set Notepad.exe as the Process we are checking Global $Processes = ProcessList($Process);get all relevant Processes For $i = 1 To $Processes[0][0]; For Each found unique PID If Not ($Processes[$i][1] = $WhitelistSinglePID) Then ProcessClose($Processes[$i][1]);Close Process if it is not the whitelisted process Next
    1 point
  12. ProcessList using the name of the executable will return all instances of the program that is running. Then you can search through the array for any instance that doesn't match the PID and then close it with ProcessClose.
    1 point
  13. I think the problem is that you are using a very old version of Au3Check and AutoIt that does not understand the $bAllUsers ? @StartupCommonDir : @StartupDir syntax. You need to upgade to the latest version or rewrite your code to use If $bAllUsers Then Return @StartupCommonDir Else Return @StartupDir EndIf
    1 point
  14. mLipok

    Get All Window's Controls

    Recently I was in need to use this function. I had to change it a little, it may be useful to someone. Little refactored function: #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w 7 #include <Array.au3> #include <WinAPI.au3> _Example() Func _Example() MsgBox(0, "Make your window active!" , 'This Message Box will be closed in 5 seconds', 5) Local $sControlText = GetAllWindowsControls(WinGetHandle("[ACTIVE]")) ClipPut($sControlText) ConsoleWrite($sControlText) EndFunc ;==>_Example ; #FUNCTION# ==================================================================================================================== ; Name ..........: GetAllWindowsControls ; Description ...: ; Syntax ........: GetAllWindowsControls($hCallersWindow[, $bOnlyVisible = Default[, $sStringIncludes = Default[, $sClass = Default]]]) ; Parameters ....: $hCallersWindow - a handle value. ; $bOnlyVisible - [optional] a boolean value. Default is Default. ; $sStringIncludes - [optional] a string value. Default is Default. ; $sClass - [optional] a string value. Default is Default. ; Return values .: String with Controls descriptions. ; Author ........: jdelaney ; Modified ......: mLipok ; Remarks .......: ; Related .......: ; Link ..........: https://www.autoitscript.com/forum/topic/164226-get-all-windows-controls/ ; Example .......: No ; =============================================================================================================================== Func GetAllWindowsControls($hCallersWindow, $bOnlyVisible = Default, $sStringIncludes = Default, $sClass = Default) If Not IsHWnd($hCallersWindow) Then ConsoleWrite("$hCallersWindow must be a handle...provided=[" & $hCallersWindow & "]" & @CRLF) Return False EndIf ; Get all list of controls If $bOnlyVisible = Default Then $bOnlyVisible = False If $sStringIncludes = Default Then $sStringIncludes = "" If $sClass = Default Then $sClass = "" Local $sClassList = WinGetClassList($hCallersWindow) ; Create array Local $aClassList = StringSplit($sClassList, @CRLF, 2) ; Sort array _ArraySort($aClassList) _ArrayDelete($aClassList, 0) ; Loop Local $iCurrentClass = "" Local $iCurrentCount = 1 Local $iTotalCounter = 1 If StringLen($sClass) > 0 Then For $i = UBound($aClassList) - 1 To 0 Step -1 If $aClassList[$i] <> $sClass Then _ArrayDelete($aClassList, $i) EndIf Next EndIf Local $hControl = Null, $aControlPos Local $sControlText = '' Local $iControlID = 0 Local $bIsVisible = False Local $sResult = '' For $iClass_idx = 0 To UBound($aClassList) - 1 If $aClassList[$iClass_idx] = $iCurrentClass Then $iCurrentCount += 1 Else $iCurrentClass = $aClassList[$iClass_idx] $iCurrentCount = 1 EndIf $hControl = ControlGetHandle($hCallersWindow, "", "[CLASSNN:" & $iCurrentClass & $iCurrentCount & "]") $sControlText = StringRegExpReplace(ControlGetText($hCallersWindow, "", $hControl), "[\n\r]", "{@CRLF}") $aControlPos = ControlGetPos($hCallersWindow, "", $hControl) $iControlID = _WinAPI_GetDlgCtrlID($hControl) $bIsVisible = ControlCommand($hCallersWindow, "", $hControl, "IsVisible") If $bOnlyVisible And Not $bIsVisible Then $iTotalCounter += 1 ContinueLoop EndIf If StringLen($sStringIncludes) > 0 Then If Not StringInStr($sControlText, $sStringIncludes) Then $iTotalCounter += 1 ContinueLoop EndIf EndIf If IsArray($aControlPos) Then $sResult &= "Func=[GetAllWindowsControls]: ControlCounter=[" & StringFormat("%3s", $iTotalCounter) & "] ControlID=[" & StringFormat("%5s", $iControlID) & "] Handle=[" & StringFormat("%10s", $hControl) & "] ClassNN=[" & StringFormat("%19s", $iCurrentClass & $iCurrentCount) & "] XPos=[" & StringFormat("%4s", $aControlPos[0]) & "] YPos=[" & StringFormat("%4s", $aControlPos[1]) & "] Width=[" & StringFormat("%4s", $aControlPos[2]) & "] Height=[" & StringFormat("%4s", $aControlPos[3]) & "] IsVisible=[" & $bIsVisible & "] Text=[" & $sControlText & "]." & @CRLF Else $sResult &= "Func=[GetAllWindowsControls]: ControlCounter=[" & StringFormat("%3s", $iTotalCounter) & "] ControlID=[" & StringFormat("%5s", $iControlID) & "] Handle=[" & StringFormat("%10s", $hControl) & "] ClassNN=[" & StringFormat("%19s", $iCurrentClass & $iCurrentCount) & "] XPos=[winclosed] YPos=[winclosed] Width=[winclosed] Height=[winclosed] Text=[" & $sControlText & "]." & @CRLF EndIf If Not WinExists($hCallersWindow) Then ExitLoop $iTotalCounter += 1 Next Return $sResult EndFunc ;==>GetAllWindowsControls Regards, mLipok
    1 point
  15. InunoTaishou

    Close Usb popup

    Just curious, couldn't you just disable auto insert notifications instead of having a script running in the background?
    1 point
  16. Melba23

    PEscobar

    Such a pity to have to dust off this section of the forum - is it really nearly 3 months since the last time it was needed? Anyway, posting grossly insulting language when offered pointers to answers which are easily available in the Help file is not something we want to encourage. Amongst the insults you mentioned that you intended to "quit the AutoIt forums" - so I will help you in keeping this New year resolution by banning your account. As all you do is ask about gamebots, I do not think you will be any great loss to the community. M23
    1 point
  17. kaisies

    FTP Fileput

    Well, one of them is clearly failing, but since you have no error checking you'll never know. You should add some and then you should be able to figure it out. Theres nothing "wrong" with the code you posted. FTP port default is 21 btw. not that it matters / has relevance.
    1 point
  18. RTFC

    Changing languages (Visual C)

    Hi McLEMUR, A decent starting point with lots of simple examples is http://www.cplusplus.com/doc/tutorial/, or try https://www.learncpp.com/ Two other reference sites I've found useful in the past are http://en.cppreference.com/w/cpp and http://www.java2s.com/Tutorial/Cpp/CatalogCpp.htm But coming from AutoIt, diving into C++ will be an uphill struggle (if you'll forgive me the metaphor mixing ). There is a lot of basic functionality that you'd expect any sophisticated language to have (*cough* garbage collection *cough*), that you'll either have to add yourself or find a good library for. An immense help for me has been the (free!) Boost libraries, see http://www.boost.org/, (and tutorials I found here, although I didn't use these much myself). Boost has really saved me acres of time, and it's quite intuitive to use. You'll need plenty of perseverance though, and think of your C++ compiler as simultaneously retarded and autistic. Every typo will likely crash your code, and the error messages you get may have nothing whatsoever to do with what actually went wrong, or be so generic that they don't help you. Of course, there's always http://stackoverflow.com/ if when you get stuck, but in my experience, some C++ forum members take on some of the same attributes as C++ compilers, i.e., being unforgiving towards beginners. Just google "I hate C++" to get an idea of what people run up against in your position. On second thought, maybe you'd better not, to remain motivated. Personally, I use C++ only for tasks that require speed and a reasonably high-level of complexity (CUDA interfacing in parallel computing, matrix computing with Eigen), but user-friendly it ain't, nor will it ever be. Can't really tell you much about the transition from AutoIt, because I started from the other end (Assembly), so it was more a question of mapping the concepts used there onto the C++ framework. I fear that coming from AutoIt, it'll be much harder. As far as compilers are concerned, CodeBlocks is much easier to start with, but at some point you'll run into situations where you'll need the extra control of literally hundreds of compiler/linker settings that MSVC offers. So you either start easy and have the extra pain of switching later, or bite the bullet now (although these newer versions of MSVC are more user-friendly than the earlier stuff). Hope it works out for you (but please do not PM me if you get stuck, okay? )
    1 point
  19. w0uter

    Multithread...

    Never noticed that post till it got bumped now, better late then never. Func _CreateStruct($s_Str) Local $v_Struct = DllStructCreate('char[' & StringLen($s_Str)+1 & ']') DllStructSetData($v_Struct, 1, $s_Str) return $v_Struct EndFunc $v_Title = _CreateStruct("I Am A Box.") $v_Text = _CreateStruct("w0uter rocks my world with his h4x.") $v_Ret = DllStructCreate('byte') $v_ASM = DllStructCreate( _ 'byte;int;' _ ;01~02 00401000 > 68 00000000 PUSH 0 ; /Style = MB_OK|MB_APPLMODAL & 'byte;int;' _ ;03~04 00401005 . 68 07204000 PUSH Protect.00402007 ; |Title = "lpCaption" & 'byte;int;' _ ;05~06 0040100A . 68 00204000 PUSH Protect.00402000 ; |Text = "lpText" & 'byte;int;' _ ;07~08 0040100F 68 00000000 PUSH 0 ; |hwnd = 0 & 'byte;int;' _ ;09~10 00444448 > B8 EA04D577 MOV EAX,USER32.MessageBoxA & 'byte;byte;' _ ;11~12 0044444D FFD0 CALL NEAR EAX & 'byte;int;' _ ;13~14 00401019 A2 44332211 MOV BYTE PTR DS:[11223344],AL & 'byte' _ ;15~15 0040101E C3 RETN ) DllStructSetData($v_ASM, 01, 0x68) DllStructSetData($v_ASM, 02, 4) DllStructSetData($v_ASM, 03, 0x68) DllStructSetData($v_ASM, 04, DllStructGetPtr($v_Title)) DllStructSetData($v_ASM, 05, 0x68) DllStructSetData($v_ASM, 06, DllStructGetPtr($v_Text)) DllStructSetData($v_ASM, 07, 0x68) DllStructSetData($v_ASM, 08, 0) DllStructSetData($v_ASM, 09, 0xB8) ;~ HMODULE WINAPI LoadLibrary( ;~ LPCTSTR lpFileName ;~ ); $v_Lib = DllCall('kernel32.dll', 'int', 'LoadLibrary', 'str', 'user32.dll') ;~ FARPROC WINAPI GetProcAddress( ;~ HMODULE hModule, ;~ LPCSTR lpProcName ;~ ); $v_Msg = DllCall('kernel32.dll', 'int', 'GetProcAddress', 'int', $v_Lib[0], 'str', "MessageBoxA") DllStructSetData($v_ASM, 10, $v_Msg[0]) ;~ BOOL WINAPI FreeLibrary( ;~ HMODULE hModule ;~ ); DllCall('kernel32.dll', 'int', 'FreeLibrary', 'int', $v_Lib[0]) DllStructSetData($v_ASM, 11, 0xFF) DllStructSetData($v_ASM, 12, 0xD0) DllStructSetData($v_ASM, 13, 0xA2) DllStructSetData($v_ASM, 14, DllStructGetPtr($v_Ret, 1)) DllStructSetData($v_ASM, 15, 0xC3) ;----------------------------------------------------------------------------------------------------------------------------------------- ;~ HANDLE WINAPI CreateThread( ;~ LPSECURITY_ATTRIBUTES lpThreadAttributes, ;~ SIZE_T dwStackSize, ;~ LPTHREAD_START_ROUTINE lpStartAddress, ;~ LPVOID lpParameter, ;~ DWORD dwCreationFlags, ;~ LPDWORD lpThreadId ;~ ); ;----------------------------------------------------------------------------------------------------------------------------------------- DllCall('kernel32.dll', 'int', 'CreateThread', 'int', 0, 'int', 0, 'int', DllStructGetPtr($v_ASM), 'int', 0, 'int', 0, 'int', 0) $i = 0 While DllStructGetData($v_Ret, 1) = 0 $i += 1 ToolTip($i) WEnd ToolTip('') MsgBox(0, 'End', 'The Msgbox return was: ' & DllStructGetData($v_Ret, 1))
    1 point
×
×
  • Create New...