Jump to content
doodilido

take a screenshot without trigger hover events on that window

Recommended Posts

doodilido
#include <Misc.au3>
#include <AutoItConstants.au3>
#include <ScreenCapture.au3>

screenshot()


Func screenshot()
if _IsPressed("01") Then
  $MousePos1 = MouseGetPos()
  While True
    While _IsPressed("01")
        Sleep(10)
    WEnd
    $MousePos2 = MouseGetPos()

    _ScreenCapture_Capture("test.bmp", $Mousepos1[0], $Mousepos1[1], $Mousepos2[0], $Mousepos2[1])
    return False
    Sleep(10)
  WEnd
EndIf
EndFunc

I have this code and i want to know how to take a screenhsot over an area without it changing. in other words not trigger hover events. thankfull for any response

Share this post


Link to post
Share on other sites
careca

You can take a screenshot of the whole area and crop it, but if the idea is to make it work like the windows snipping tool, maybe if your GUI is the top window the hover events are not triggered, but im not sure, the way i would try to do this would be making the gui temporarily small, or even move it off screen, during the coordinates grab, and then i would move the mouse to the first point, use a keyboard key instead of the mouse, to keep focus on my gui, and in the second point press the keyboard again, similarly like your script does, that would possibly work.


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
jdelaney
Posted (edited)

Use a different _ispressed key.  One that won't cause focus to the window.

Or, maybe something like this...it assumes that the window isn't present at 0,0:

#include <Misc.au3>
#include <AutoItConstants.au3>
#include <ScreenCapture.au3>

screenshot()


Func screenshot()
if _IsPressed("01") Then
  $MousePos1 = MouseGetPos()
  While True
    While _IsPressed("01")
        Sleep(10)
    WEnd
    $MousePos2 = MouseGetPos()
    MouseMove(0,0,0)
    _ScreenCapture_Capture("test.bmp", $Mousepos1[0], $Mousepos1[1], $Mousepos2[0], $Mousepos2[1])
    return False
    Sleep(10)
  WEnd
EndIf
EndFunc

 

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×