gcue Posted February 22, 2008 Posted February 22, 2008 i am trying to use this function here at work.. in our environment we have a varation of dual, tri, and sometimes quad monitor setups. ; Capture full screen _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image1.jpg") only captures the active window.. any ideas for workarounds? thanks
Bert Posted February 22, 2008 Posted February 22, 2008 use ctrl+printscreen. Alt+printscreen will get the active window to the clipboard, while Ctrl+printscreen will get everything to the clipboard. The Vollatran project My blog: http://www.vollysinterestingshit.com/
gcue Posted February 22, 2008 Author Posted February 22, 2008 good idea.. problem is that we use printkey and by default that program fires up whenever u press ctrl/alt + printscreen. any other ideas?
Bert Posted February 22, 2008 Posted February 22, 2008 can you disable printkey for the time you are getting your screenshot? It may have command line switches, or you may be able to access the icon in the system tray to disable it while you do what you need. The Vollatran project My blog: http://www.vollysinterestingshit.com/
MrCreatoR Posted February 22, 2008 Posted February 22, 2008 only captures the active window.Well, _ScreenCapture_Capture uses GetSystemMetrics if Right/Bottom is -1, try to set these parameters by your self... _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image1.jpg", 0, 0, @DesktopWidth, @DesktopHeight) Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
gcue Posted February 22, 2008 Author Posted February 22, 2008 i tried putting in those values.. no dice. could it be that @desktopheight/@desktopwidth only take the values of the main monitor?
MrCreatoR Posted February 22, 2008 Posted February 22, 2008 could it be that @desktopheight/@desktopwidth only take the values of the main monitor?Thats could be the reason, yes. Spoiler Using OS: Win 7 Professional, Using AutoIt Ver(s): 3.3.6.1 / 3.3.8.1 AutoIt Russian Community My Work... Spoiler Projects: ATT - Application Translate Tool {new}| BlockIt - Block files & folders {new}| SIP - Selected Image Preview {new}| SISCABMAN - SciTE Abbreviations Manager {new}| AutoIt Path Switcher | AutoIt Menu for Opera! | YouTube Download Center! | Desktop Icons Restorator | Math Tasks | KeyBoard & Mouse Cleaner | CaptureIt - Capture Images Utility | CheckFileSize ProgramUDFs: OnAutoItErrorRegister - Handle AutoIt critical errors {new}| AutoIt Syntax Highlight {new}| Opera Library! | Winamp Library | GetFolderToMenu | Custom_InputBox()! | _FileRun UDF | _CheckInput() UDF | _GUIInputSetOnlyNumbers() UDF | _FileGetValidName() UDF | _GUICtrlCreateRadioCBox UDF | _GuiCreateGrid() | _PathSplitByRegExp() | _GUICtrlListView_MoveItems - UDF | GUICtrlSetOnHover_UDF! | _ControlTab UDF! | _MouseSetOnEvent() UDF! | _ProcessListEx - UDF | GUICtrl_SetResizing - UDF! | Mod. for _IniString UDFs | _StringStripChars UDF | _ColorIsDarkShade UDF | _ColorConvertValue UDF | _GUICtrlTab_CoverBackground | CUI_App_UDF | _IncludeScripts UDF | _AutoIt3ExecuteCode | _DragList UDF | Mod. for _ListView_Progress | _ListView_SysLink | _GenerateRandomNumbers | _BlockInputEx | _IsPressedEx | OnAutoItExit Handler | _GUICtrlCreateTFLabel UDF | WinControlSetEvent UDF | Mod. for _DirGetSizeEx UDF Examples: ScreenSaver Demo - Matrix included | Gui Drag Without pause the script | _WinAttach()! | Turn Off/On Monitor | ComboBox Handler Example | Mod. for "Thinking Box" | Cool "About" Box | TasksBar Imitation Demo Like the Projects/UDFs/Examples? Please rate the topic (up-right corner of the post header: Rating ) * === My topics === * ================================================== ================================================== AutoIt is simple, subtle, elegant. © AutoIt Team
gcue Posted February 22, 2008 Author Posted February 22, 2008 nice try though. anything else you could think of? i tried exactly what you put _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image1.jpg", 0, 0, @DesktopWidth, @DesktopHeight) that should be the right values right? topmost , leftmost, width, height
gcue Posted February 28, 2008 Author Posted February 28, 2008 im trying to play with this script and get something that works (im runnning it on remote machines within our domain): sometimes the script works and i get a screenshot out of it sometimes i dont.. im running the clipboard application on the remote machine to monitor what happens on the clipboard and i think its not working because of a clipboard issue - a screenshot for some reason, isnt getting to the clipboard sometimes id like to use send("{printscreen}") so i can a screenshot of multiple monitors > how can i pipe it into a file wout having to use screencapture? ClipPut("") ;_ClipBoard_Open(0) ;_ClipBoard_Empty() ;_ClipBoard_Close() ;Send("^{PRINTSCREEN}") Send("{ALT}{PRINTSCREEN}") _ClipBoard_Open(0) ; open clipboard is associated with the current task $hBitmap = _ClipBoard_GetData(2) ; $CF_BITMAP _ScreenCapture_SaveImage(@ScriptDir & "\" & @ComputerName & "_" & $filename & ".jpg", $hBitmap) _ClipBoard_Close()
tehdon Posted March 31, 2010 Posted March 31, 2010 i am trying to use this function here at work.. in our environment we have a varation of dual, tri, and sometimes quad monitor setups. ; Capture full screen _ScreenCapture_Capture(@MyDocumentsDir & "\GDIPlus_Image1.jpg") only captures the active window.. any ideas for workarounds? thanks Not a big fan of bumping up a 2+ year old topic, but I ran into this same issue today and found a decent workaround. I found that calling the function in the following method allow the entire desktop to be captured. _ScreenCapture_Capture($capFullPath,0,0,@DesktopWidth+@DesktopWidth,@DesktopHeight,True) The above will work if the primary display is farthest left, there are exactly two displays, and both have identical height and width attributes. Or in other words, is set up identical to how my workstation is setup at the moment There's probably a good method of identifying all of those attributes and passing in the parameters accordingly.
Ascend4nt Posted March 31, 2010 Posted March 31, 2010 This will get the full virtual screen width and height. Keep in mind that monitors with varying resolutions will return the maximum height for these values. The width returned is all monitor widths combined... unless somehow the monitors are stacked vertically which would make the situation the opposite I suppose. ;SM_CXVIRTUALSCREEN = 78 $iVScrWidth=_WinAPI_GetSystemMetrics(78) ;SM_CYVIRTUALSCREEN = 79 $iVScrHeight=_WinAPI_GetSystemMetrics(79) My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code)
norry Posted September 24, 2010 Posted September 24, 2010 Thanks for the hints, I ended up doing it this way $desktopSize = WinGetPos("Program Manager") _ScreenCapture_Capture(@DesktopDir & "\Desktop.jpg",0,0,$desktopSize[2],$desktopSize[3],True)
water Posted September 24, 2010 Posted September 24, 2010 (edited) I once downloaded this script and it works fine for my dual monitor environment. Edited September 24, 2010 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now