Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/25/2019 in all areas

  1. Hi robertocm I tried _WinAPI_GetFocus() and it gave good results (code below) without the need of GUIRegisterMsg() or AdlibRegister() or $GUI_EVENT_PRIMARYDOWN (coupled with GUIGetCursorInfo() to retrieve the ID of the control that the mouse cursor is hovering over) Also the _WinAPI_GetFocus() approach allows you to move through your Input controls using the Tab key, while the background colors change, which you can't do when using $GUI_EVENT_PRIMARYDOWN As Melba23 wrote in one of your links : "It seems Input controls do not send messages, so we have to take a roundabout way..." #include <GuiConstants.au3> #include <WinAPISysWin.au3> Global $idInput[2][5], $hInput[2][5], $hGetFocus = 0, $hGetFocus_Old = 0, $iRow = -20 $hGUI = GUICreate("Test", 500, 500) For $i = 0 To 1 For $j = 0 To 4 $iRow += 30 $idInput[$i][$j] = GUICtrlCreateInput("Some text " & ($i + 1) & Chr(97 + $j), _ 10, $iRow + $i*50, 200, 24) $hInput[$i][$j] = GUICtrlGetHandle($idInput[$i][$j]) Next Next GUISetState(@SW_SHOW, $hGUI) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch $hGetFocus = _WinAPI_GetFocus() If $hGetFocus <> $hGetFocus_Old Then Focus_Changed() WEnd Func Focus_Changed() For $i = 0 To 1 For $j = 0 To 4 If $hGetFocus = $hInput[$i][$j] Then GUICtrlSetBkColor($idInput[$i][$j], 0x98FB98) For $k = 0 To 4 If $k <> $j Then GUICtrlSetBkColor($idInput[$i][$k], 0xD3D3D3) Next ExitLoop(2) ; exit both For loops EndIf Next Next $hGetFocus_Old = $hGetFocus EndFunc
    2 points
  2. LAST VERSION - 1.1 18-May-12 Control Viewer (CV) is a replacement of AutoIt Window Info with a number of advantages. I tried to stick to the interface of the last, so you almost do not have to be retrained. During testing, I never managed to find any controls that could not be identified by CV (on the contrary, shows a lot of hidden controls, especially for the system windows). The all program settings are stored in the following registry key: HKEY_CURRENT_USERSoftwareY'sControl Viewer The main differences CV from AWI Shows the complete list of all existing controls for the window that are interested (visible, hidden and deleted controls are displayed with different colors that can be changed to any other).Dynamically changing information during search for the windows and their controls.Ability to quickly switch between controls in the list.Ability to show/hide any controls from the list (useful for the overlaping controls).Information for the Style and ExStyle parameters shown in the form of hexadecimal values​​, and as its flags.Added the PID and Path parameters in the Window tab and ability to quickly open a folder that containing the process file.Added the coordinate system relative to the selected control.Shows a color of the selected pixel in RGB and BGR formats.Shows an example fill of the selected color.Ability to select the text encoding (affects the Text parameter in the Control tab).The complete change the appearance of pop-up frame for the selected controls.Simple and convenient tool to get a screenshot of the part screen of interest for publication on the forum (Capture tab).Create a report in the clipboard or a text file for subsequent publication on the forum.Search all running AutoIt scripts and their windows in the system (AutoIt tab).User-friendly interface. Used shortcuts Ctrl+Alt+T - Enable/Disable "Always On Top" mode (also available from the menu). Ctrl+Alt+H - Enable/Disable highlight selected controls (also available from the menu). Ctrl+A - Select all text (works in any input field). Ctrl - Hold down when moving the mouse to scroll the screenshot (Capture tab). Shift - Hold down when stretching/compression of the contour frame for an equilateral resizing screenshots (Capture tab). DoubleClick (on the screenshot) - Save the image to a file (Capture tab). DoubleClick (on any list item) - Open a folder with the file of the process or AutoIt script (AutoIt tab). Del (on any list item) - Close process (AutoIt tab). F5 - Updating the list (AutoIt tab). If anyone have any questions or comments about CV, please post it in this thread. I will be glad to any feedback and suggestions. Files to download Binary (x86 and x64) Redirection to CV_bin.zip, 1.14 MB CV_bin.html Source Redirection to CV_source.zip, 691 KB CV_source.html
    1 point
  3. Jos

    Portable tutorial

    So you basically want to rewrite NSIS in AutoIt3? I am still lost what it is you really want to reinvent here and your given explanations haven't made it clear to me yet.....sorry. Jos
    1 point
  4. maniaczs

    Silent Install application

    Thank you for your help @Aelc and @Earthshine. Been working on a different application that has no silent install options, anyway I preinstalled the .net framework so that won't be an issue.
    1 point
  5. Earthshine

    Portable tutorial

    if you want autoit to be what the thin app is, good luck, and get to writing code. asking us to do it isn't going to happen. as for tutorials, there is always Google to search. bye if you know how to do it, then do it. don't ask others to do your work
    1 point
  6. Earthshine

    Portable tutorial

    what has NSIS got to do with this? it's for making application installers. what is this magic algorithm? like to share it? first, do you have any idea how to go about making an application installer? because if you don't you won't be able to understand what YOU must do in order to make an application portable. I guess basically you want to repackage an app in NSIS, but that isn't making it portable. You need to figure out what the app does at install time, then YOU must do it all after you plunk down the fileset to the target pc, register all the necessary files (not to mention install needed prerequisites, drivers, etc...), create shortcuts, registry entries, all that. if you know about all the stuff that needs to be done, you can then package it with NSIS autoit is most likely not the tool you are seeking for this job. watch this. you need a clean system and a way to scan all the changes so you can start to build your portable app. I use SysTracerPro to take snapshots before and after the initial app install. http://www.blueproject.ro/systracer/ now you have all the data you need in order to repackage as a portable app.,
    1 point
  7. Here is another option. #include <Array.au3> #include <GUIConstantsEx.au3> #include <WinAPIDlg.au3> Global $g_idFocus, $g_aInput[2][2] Global $g_hWnd = GUICreate("Test", 500, 500) $g_aInput[0][0] = GUICtrlCreateInput("Some text 1a", 10, 10, 200, 24) $g_aInput[0][1] = GUICtrlCreateInput("Some text 1b", 10, 40, 200, 24) $g_aInput[1][0] = GUICtrlCreateInput("Some text 2a", 10, 80, 200, 24) $g_aInput[1][1] = GUICtrlCreateInput("Some text 2b", 10, 110, 200, 24) GUISetState() AdlibRegister("_Highlight") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func _Highlight() ;~ Get currently focused control id $idFocus = _WinAPI_GetDlgCtrlID(ControlGetHandle($g_hWnd, "", ControlGetFocus($g_hWnd, ""))) ;~ Get Control Id ;~ Compare local control id and global control id to determine if the focused control has already been processed, stops flickering If $g_idFocus = $idFocus Then Return ;~ Set global control id to local control id to show focused control has begun processing, stops flickering $g_idFocus = $idFocus ;~ Search input array for focused control id Local $iSearch = _ArraySearch($g_aInput, $idFocus) ;~ If search is unsuccessful return If @error Then Return ;~ Highlights for focused control id and unfocused control id of the selected array index item If $g_aInput[$iSearch][0] = $idFocus Then GUICtrlSetBkColor($g_aInput[$iSearch][0], 0x98FB98) GUICtrlSetBkColor($g_aInput[$iSearch][1], 0xD3D3D3) Else GUICtrlSetBkColor($g_aInput[$iSearch][0], 0xD3D3D3) GUICtrlSetBkColor($g_aInput[$iSearch][1], 0x98FB98) EndIf EndFunc
    1 point
  8. The issue is elsewhere: since it's sooo easy to detect AutoIt exes, cheap AV companies believe it's a valuable move for to flag them all. That increases their "success rate" at zero cost since they can't care less about false positives... Call that " security through genocide".
    1 point
  9. Did the Pentagon actually drop ADA for AutoIt?
    1 point
  10. CefApp should use for one application, but CefClient (includes many event handles from this) should use each browser. You can see, https://github.com/small-autoit/mb/blob/master/mini_browser.au3 I used two CefClient for two browser handle ($browser_client and $toolbar_client). And the browser window is created after toolbar created, via OnAfterCreated event. func toolbar_onAfterCreated($browser) if ($toolbar_hwnd==0) then $toolbar_frame = $browser.GetMainFrame() $toolbar_hwnd = ptr($browser.GetHost().GetWindowHandle()) _MoveWindow($toolbar_hwnd, 0, 0, $width, $toolbar_height, 1) _ShowWindow($toolbar_hwnd) $cef.CreateBrowser($cef_winfo.__ptr, $browser_client.__ptr, $url, $cef_bs.__ptr, null) endif endfunc On the other hand, one client can create multiple browser windows via $cef.CreateBrowser; after created, browser handle, browser host and frame will be difference, you should identify for each one. $client.OnAfterCreated = func_; $client.OnBeforeClose = func_;
    1 point
  11. Earthshine

    Environment variables

    It may be difficult but in order to learn it is necessary
    1 point
  12. Thanks for the code, but please, can you make a lot easier version of this for the beginners. Maybe a file open dialog, where you can choose a picture and than, when the image is shown in the gui, only the possibility to zoom with the mouse wheel and to drag the image. Without the tabs, the toolbar, the menu etc. I try to understand it and to make it useable for my own project, but it's hard for me.
    1 point
  13. BitByteBit, A few lines to add to your code just before and within your While...WEnd loop: $dll = DllOpen("user32.dll") $Search_Handle = GUICtrlGetHandle($Search) While 1 $nMsg = GUIGetMsg() ;$Msg= GUIGetMsg ($GUI_EVENT_PRIMARYDOWN) Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Google Google() Case $GUI_EVENT_PRIMARYDOWN $aCurInfo = GUIGetCursorInfo() If $aCurInfo[4] = $Search Then Sleep(100) Send("{HOME}{SHIFTDOWN}{END}{SHIFTUP}") EndIf EndSwitch If _IsPressed("0D", $dll) And _WinAPI_GetFocus() = $Search_Handle Then ConsoleWrite("I can run a function!" & @CRLF) While _IsPressed("0D", $dll) Sleep(10) ; Important so as not to use 100% CPU! WEnd EndIf WEndIt seems Input controls do not send messages, so we have to take a roundabout way of looking for a click and then seeing if the mouse if over the Input. As to the hitting the Enter key, you can see how it checks if the Input has focus before doing anything. As we are polling _IsPressed in a loop, it is good practice to open the DLL beforehand - but you then need to close the DLL once you no longer need to check for the keypress. Despite its less than elegant form, I hope this code helps. M23
    1 point
  14. Grof

    Portable tutorial

    For portabilizer I mean a competor of PortableApps, not a rival of WMWare ThinApp. AutoIt is a script system, so can do this, and not a sandbox. I know the algorithm and most of the code in NSIS language. The algorithm is very simple, the coding more difficult... But not so much. Could be about 100 lines or little more.
    0 points
×
×
  • Create New...