Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/28/2012 in all areas

  1. I have been reading this forum, and site, for the past couple of years. I decided today that this post was long overdue. I have learned much and honestly there wasn't any issue I ever had with autoit that I couldn't find the answer already on the forums. I just wanted to extend a big thank you to all the devs and the people in the community to take time out of their day to help the "newbs" learn and, more importantly, understand our own code. Sincerely, A grateful (forever) noob
    2 points
  2. Yashied

    DLL Helper

    LAST VERSION - 1.0 28-May-12 This small utility designed for viewing the exported DLL functions and is written specifically for AutoIt community. Nothing excess, just the tools you need. Especially useful are Drag-and-Drop and support for command line that allows you to add DLL Helper in the Windows Explorer context menu. To do this, you can use the following .reg file. Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\dllfile\shell\View] @="View exported function" [HKEY_CLASSES_ROOT\dllfile\shell\View\command] @=""C:\Program Files\DLLHelper\DLLHelper.exe" "%1""Also worth noting is fairly fast enumeration of exported DLL functions and the ability to export the function list into a text or HTML document. As usualy, I will be glad to any feedback and suggestions. Major program features Support for both x86 and x64 DLL files.Fast enumeration of exported DLL functions.Support for command line (use the full path in the first parameter).Support Drag-and-Drop.Web search for functions with the ability to add user-defined services (up to 10, via registry).Ability to view the undecorated names of DLL function.Ability to specify a filter to display the functions of interest.Sort the function list by any column.Copying any data (by column) from the list to the clipboard.Export list of function to the .txt or .html file.List of recently opened files (up to 10).Simple and intuitive interface. License Supported operating systems Windows XP, Vista, 7 Files to download Binary Redirection to DLLHelper_bin.zip, 475 KB DLLHelper_bin.html Source Redirection to DLLHelper_source.zip, 657 KB DLLHelper_source.html
    1 point
  3. danielkza

    C struct with array

    First of all, your code is invalid: you're passing a structure as the first parameter to printf() while it is expecting a float. printf() works by looking at the string specifier and pulling the appropriate amount of data from the stack, which you wrongly populated with the contents of the structure *twice*. Remember that in the default C calling convention arguments are passed in reverse order, so they can be popped in left-to-right order by the callee, and that you passed the structure *as a single piece*. This is how the stack will look, from top to bottom, right before control is passed to printf(): // top test.val[0] test.val[1] test test.val[2] / test.val[3] / test.val[0] <= test.val[0] test.val[1] <= test.val[1] test.val[2] <= test.val[2] test.val[3] <= test.val[3] printf() will then pop 5 floats from the stack and print them, which explains the behavior you are seeing. The lesson to take is *don't pass printf() anything but exactly what it is expecting*, which *is not* a struct and 4 floats, but *exactly 5 floats*.
    1 point
  4. Try this: While True $hWnd = WinGetHandle('[active]') If WinGetState($hWnd) = 23 Then WinSetState($hWnd,'',@SW_HIDE) Sleep(10) WEnd
    1 point
  5. water

    Compile and Autoit

    @Compiled returns 1 if the script is a compiled exe file, and 0 if run (interpreted) from SciTE. This can be useful if you want to run some functions (check authorization etc.) when run on a customers PC as an exe but suppress the function when you develop and run the script from SciTE.
    1 point
  6. For minimized windows you cannot take a screen afaik but from inactive even windows which are behind others. ;coded by UEZ 2012 #include <Array.au3> #include <Constants.au3> #include <WindowsConstants.au3> #include <GDIPlus.au3> $aWinlist = GetAllWindow() For $i = 0 To UBound($aWinlist) - 1 $hWnd = $aWinlist[$i][1] If Not WinActive($hWnd) Then ExitLoop Next If $i = UBound($aWinlist) Then Exit MsgBox(0, "Info", "No inactive window found", 10) _GDIPlus_Startup() $hBitmap = Capture_Window($hWnd, 300, 200) _GDIPlus_ImageSaveToFile($hBitmap, @ScriptDir & "Test.jpg") _GDIPlus_BitmapDispose($hBitmap) ShellExecute(@ScriptDir & "Test.jpg") _GDIPlus_Shutdown() Exit Func Capture_Window($hWnd, $w, $h) Local $hDC_Capture = _WinAPI_GetWindowDC($hWnd) Local $hMemDC = _WinAPI_CreateCompatibleDC($hDC_Capture) Local $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC_Capture, $w, $h) Local $hObject = _WinAPI_SelectObject($hMemDC, $hHBitmap) DllCall("user32.dll", "int", "PrintWindow", "hwnd", $hWnd, "handle", $hMemDC, "int", 0) _WinAPI_DeleteDC($hMemDC) Local $hObject = _WinAPI_SelectObject($hMemDC, $hObject) _WinAPI_ReleaseDC($hWnd, $hDC_Capture) Local $hBmp = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap) _WinAPI_DeleteObject($hHBitmap) Return $hBmp EndFunc ;==>Capture_Window Func GetAllWindow() ;code by Authenticity - modified by UEZ Local $aWin = WinList(), $aWindows[1][4] Local $iStyle, $iEx_Style, $iCounter = 0 Local $i, $hWnd_state, $aWinPos For $i = 1 To $aWin[0][0] $iEx_Style = BitAND(_WinAPI_GetWindowLong($aWin[$i][1], $GWL_EXSTYLE), $WS_EX_TOOLWINDOW) $iStyle = BitAND(WinGetState($aWin[$i][1]), 2) If $iEx_Style <> -1 And Not $iEx_Style And $iStyle Then $aWinPos = WinGetPos($aWin[$i][1]) If $aWinPos[2] > 1 And $aWinPos[3] > 1 Then $aWindows[$iCounter][0] = $aWin[$i][0] $aWindows[$iCounter][1] = $aWin[$i][1] $aWindows[$iCounter][2] = $aWinPos[2] $aWindows[$iCounter][3] = $aWinPos[3] $iCounter += 1 EndIf ReDim $aWindows[$iCounter + 1][4] EndIf Next ReDim $aWindows[$iCounter][4] Return $aWindows EndFunc ;==>GetAllWindow Br, UEZ
    1 point
  7. water

    Compile and Autoit

    Sure. Check macro @Compiled: Returns 1 if script is a compiled executable; otherwise, returns 0.
    1 point
  8. I second this. I have learned so much in the past year and my scripting has improved tremendiouly. I used to be afraid of arrays and loops because they seemed so hard to do right. This forum has been the single greatest reason I have succeeded in Autoit, and why it remains my favorite scripting language. Anyone that listens hears me constantly singing the praises of this amazing and easy to learn language. Thank you again.
    1 point
  9. _IsPressed is not the right thing for you. Lookup _WinAPI_SetWindowsHookEx in the help file. Now you're on your own!
    1 point
  10. cramaboule

    FF.au3 (V0.6.0.1b-10)

    Hello all, Trying the FF.au3 UDF, it opens me 2 times Firefox (2 windows: one with my link 'www.google.com' and the other one 'www.4242.com') with this simple code: #include "ff.au3" $socket = _FFStart("http://www.google.com/") Searching where would be the problem, I found that in Func __FFStartProcess() a small error: Local $sCommand = StringFormat('"%s" %s %s %s -repl %i %s', $sFFExe, $sNewWin, $sURL, $sNoRemote, $iPort, $sProfile)So I added 2 double quotes like this: Local $sCommand = StringFormat('"%s" %s %s %s "-repl %i %s"', $sFFExe, $sNewWin, $sURL, $sNoRemote, $iPort, $sProfile)and it works fine for me ! Win7 X64 Firefox 9.01 FF.au3 0.6.0.1b-3 Hope this helps. PS it works fine if you change the ports of mozrepl
    1 point
×
×
  • Create New...