YoseMite Posted May 10, 2006 Share Posted May 10, 2006 Can you share the source with us? Link to comment Share on other sites More sharing options...
jacksont123 Posted May 10, 2006 Share Posted May 10, 2006 Are you asking the creator? Link to comment Share on other sites More sharing options...
jacksont123 Posted May 11, 2006 Share Posted May 11, 2006 I figured it out. $date= @YEAR & @MON & @MDAY & @HOUR & @MIN & @SEC FileOpen ( $date & 'my.file', 2 ) Link to comment Share on other sites More sharing options...
mr.underperson Posted June 3, 2006 Share Posted June 3, 2006 Am I missing something, or is this just the same as doing... Send("{PRINTSCREEN}") ; add alt, if required. no? -mu Link to comment Share on other sites More sharing options...
jefhal Posted June 3, 2006 Share Posted June 3, 2006 Hi LazyCat- Very nice job on creating a dll for AutoIT. I think this is a wonderful addition to the "native" tools that make AutoIT richer. In my case, I have been using IrFanView to get screen captures from remote computers and have found that IFV's command line parameters offer a huge amount of flexibility. You can output any of IFV's dozens of formats, perform size and color depth reduction, output directly to printer, capture images with incremental names, etc. etc. My point is, that, unless you plan to turn this into a lifelong project (like Irfan has), AutoIT users may still want to look at IrfanView when they plan their next screen capture project. Certainly, for 98% of applications your dll is fantastic, but for those "sticky" ones, check out IrfanView... ...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format Link to comment Share on other sites More sharing options...
Lazycat Posted June 4, 2006 Author Share Posted June 4, 2006 AutoIT users may still want to look at IrfanView when they plan their next screen capture project. Certainly, for 98% of applications your dll is fantastic, but for those "sticky" ones, check out IrfanView...Noone say this is alpha and omega, surely Irfan have a lots of more power. But if you don't need many, just simple capture, it's can still be preferable - it's can be tightly integrated (especially plugin version) and it's really small. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
ChrisL Posted June 5, 2006 Share Posted June 5, 2006 Lazycat this is truely very nice. Thanks! I've used it to make an incremental screen capture for our guys who write training manuals to aid screen shots. I am probably going to modify it to allow BMP save and Compression levels when it starts when time permits Here is my code if anyone is interested. expandcollapse popup$g_szVersion = "MultiScreenDump" If WinExists($g_szVersion) Then Exit MsgBox (262144,"Error","Screen Capture is already running") AutoItWinSetTitle($g_szVersion) FileInstall ("captdll.dll", @tempdir & "\captdll.dll", 1) Global $count = 1, $dest MsgBox (262144, "Screen Capture", "Press PrintScreen to capture screen shot press escape to quit") While $dest = "" $dest = FileSelectFolder ( "Select a destination", "" ,1) Wend HotKeySet ("{PRINTSCREEN}", "Capture") HotKeySet ("{ESC}", "quit") While 1 Sleep (100) Wend Func Capture() If FileExists ($dest & "\image_" & $count & ".jpg") <> 0 then Do $count +=1 until FileExists ($dest & "\image_" & $count & ".jpg") = 0 Endif DllCall(@tempdir & "\captdll.dll", "int", "CaptureScreen", "str", $dest & "\image_" & $count & ".jpg", "int", 100) $count +=1 EndFunc Func Quit() $ans = MsgBox (262145, "Screen Capture", "Files are saved in " & $dest & @CRLF & "Do you really want to quit?") If $ans = 1 then Exit EndFunc Func OnAutoITExit() FileDelete (@tempdir & "\captdll.dll") EndFunc [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
nfwu Posted June 6, 2006 Share Posted June 6, 2006 Am I missing something, or is this just the same as doing... Send("{PRINTSCREEN}") ; add alt, if required. no? -mu That's WinKey + PrintScreen. Nope, it aint the same. That copies the screenshot to the clipboard. It does not save it. #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
H.J. Posted June 6, 2006 Share Posted June 6, 2006 (edited) Dear LazyCat, I have two question : 1) Is the all Dynamic Link Libraries ( DLL's ) located in this link www.autoitscript.com/fileman/users/Lazycat/dlls.html owned by you and you have All Copyrights. 2) If the all Dynamic Link Libraries ( DLL's ) located in this link www.autoitscript.com/fileman/users/Lazycat/dlls.htm owned by you and you have All Copyrights, Can I use and distribute it with the Autoit Scripts I created and/or Compiled Scripts and/or any Applications created for Personal use and Commercial use to sell the Scripts I created and/or Compiled Scripts and/or my Applications for profit or distribute it commercially or freely or for any purpose ?. And do I have to pay any royalties or other fees to you or anyone if I use and distribute it with the Scripts I created and/or Compiled Scripts and/or Applications created for Personal use and Commercial as I explained before?. Thanks to you in advance. Best regards H.J. Edited June 8, 2006 by H.J. Link to comment Share on other sites More sharing options...
ChrisL Posted June 6, 2006 Share Posted June 6, 2006 (edited) I made another screen capture app to go with LazyCats dll expandcollapse popup#include <GuiConstants.au3> ;only allow 1 running copy $g_szVersion = "MultiScreenDump" If WinExists($g_szVersion) Then Exit MsgBox(262144, "Error", "Screen Capture is already running") AutoItWinSetTitle($g_szVersion) ;install Dll FileInstall("captdll.dll", @TempDir & "\captdll.dll", 1) ;set initial global settings Global $count = 1, $dest = @ScriptDir, $quality = "100", $ext = "JPG" , $useButtonGui = 0 ;instructions for user MsgBox(262144, "Screen Capture", "Press ""F1"" to change settings at any time" & @CRLF & _ "Press ""PrintScreen"" to capture whole screen" & @CRLF & _ "Press ""Alt"" + ""Printscreen"" to capture active window" & @CRLF & _ "Press ""escape"" to quit") ;bring up settings dialogue and activate hotkeys Settings() While 1 If $usebuttonGui = 1 then ButtonGui() Sleep(100) WEnd Func Settings() HotKeySet("{PRINTSCREEN}", "Capture") HotKeySet("!{PRINTSCREEN}", "AreaCapture") HotKeySet("{ESC}", "Quit") HotKeySet("{F1}", "Settings") $main = GUICreate("Close this window to change settings", 392, 178, -1, -1, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $outputLabel = GUICtrlCreateLabel("Output Directory", 10, 15, 180, 20) $OutputDir = GUICtrlCreateInput("", 10, 40, 290, 25) GUICtrlSetData(-1, $dest) $Browse = GUICtrlCreateButton("Browse", 320, 40, 60, 25) $Combo = GUICtrlCreateCombo("JPG", 20, 75, 80, 61) GUICtrlSetData(-1, "BMP", $ext) $QualitySlide = GUICtrlCreateSlider(10, 100, 290, 30) GUICtrlSetLimit($QualitySlide, 100, 1) GUICtrlSetData($QualitySlide, $quality) If $ext = "BMP" then GuiCtrlSetState ($QualitySlide, $GUI_Disable) $SliderLabel = GUICtrlCreateLabel("Quality " & $quality, 200, 80, 120, 20) $OSButtons = GUICtrlCreateCheckbox ("Use on screen capture buttons", 20,150) If $useButtonGui = 1 then GuiCtrlSetState ($OSButtons, $GUI_CHECKED) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE $dest = GUICtrlRead($OutputDir) If StringRight($dest, 1) = "\" Then $dest = StringTrimRight($dest, 1) $quality = GUICtrlRead($QualitySlide) $ext = GUICtrlRead($Combo) If Bitand (GUICtrlRead ($OSButtons), $GUI_Checked) Then $useButtonGui = 1 Else $useButtonGui = 0 Endif GUIDelete($main) Exitloop Case $msg = $Browse $dest = FileSelectFolder("Select a destination", "", 1) GUICtrlSetData($OutputDir, $dest) Case $msg = $Combo If GUICtrlRead($Combo) = "BMP" Then GUICtrlSetState($QualitySlide, $GUI_Disable) GUICtrlSetData($SliderLabel, "Quality N/A") $quality = "-1" $ext = "BMP" Else GUICtrlSetState($QualitySlide, $GUI_Enable) $quality = GUICtrlRead($QualitySlide) GUICtrlSetData($SliderLabel, "Quality " & $quality) EndIf Case $msg = $QualitySlide $quality = GUICtrlRead($QualitySlide) GUICtrlSetData($SliderLabel, "Quality " & $quality) $ext = "JPG" Case Else ;;; EndSelect WEnd ;Exit EndFunc ;==>Settings Func ButtonGui() $buttonGui = GuiCreate("Buttons", 120, 120,@DesktopWidth -170, @desktopheight -210 , $WS_POPUP, $WS_EX_TOPMOST) $button1 = GuiCtrlCreateButton ("Screen",0,0,60,60) $button2 = GuiCtrlCreateButton ("Area",61,0,60,60) $button3 = GuiCtrlCreateButton ("Setup",0,61,60,60) $button4 = GuiCtrlCreateButton ("Quit",61,61,60,60) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button1 WinSetState ($buttonGui,"",@SW_MINIMIZE) GuiSetState (@SW_HIDE, $buttonGui) Capture() Sleep (100) GuiSetState (@SW_SHOW, $buttonGui) WinSetState ($buttonGui,"",@SW_Restore) Case $msg = $Button2 WinSetState ($buttonGui,"",@SW_MINIMIZE) GuiSetState (@SW_HIDE, $buttonGui) AreaCapture() Sleep (100) GuiSetState (@SW_SHOW, $buttonGui) WinSetState ($buttonGui,"",@SW_Restore) Case $msg = $Button3 GuiDelete($buttonGui) Send ("{F1}") ExitLoop Case $msg = $Button4 Send ("{ESC}") Case Else If not BitAnd (WinGetState ($buttonGui),8) then WinSetOnTop ($buttonGui,"",1) ;;; EndSelect WEnd EndFunc Func Capture() If FileExists($dest & "\image_" & $count & "." & $ext) <> 0 Then Do $count += 1 Until FileExists($dest & "\image_" & $count & "." & $ext) = 0 EndIf DllCall(@TempDir & "\captdll.dll", "int", "CaptureScreen", "str", $dest & "\image_" & $count & "." & $ext, "int", $quality) $count += 1 EndFunc ;==>Capture Func AreaCapture() If FileExists($dest & "\image_" & $count & "." & $ext) <> 0 Then Do $count += 1 Until FileExists($dest & "\image_" & $count & "." & $ext) = 0 EndIf $winlist = WinList() For $i = 1 To $winlist[0][0] $state = WinGetState($winlist[$i][1]) If BitAND($state, 8) Then $cords = WinGetPos($winlist[$i][1]) ExitLoop EndIf Next If IsArray($cords) Then DllCall(@TempDir & "\captdll.dll", "int", "CaptureRegion", "str", $dest & "\image_" & $count & "." & $ext, "int", $cords[0], "int", $cords[1], "int", $cords[2], "int", $cords[3], "int", $quality) $count += 1 EndIf EndFunc ;==>AreaCapture Func Quit() $ans = MsgBox(262145, "Screen Capture", "Files are saved in " & $dest & @CRLF & "Do you really want to quit?") If $ans = 1 Then Exit EndFunc ;==>Quit Func OnAutoITExit() FileDelete(@TempDir & "\captdll.dll") EndFunc ;==>OnAutoITExit Edited June 7, 2006 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
H.J. Posted June 8, 2006 Share Posted June 8, 2006 Dear LazyCat, Please any replay to my two questions, I need your help and advice. Best regards H.J. Link to comment Share on other sites More sharing options...
Lazycat Posted June 8, 2006 Author Share Posted June 8, 2006 Dear LazyCat,Please any replay to my two questions, I need your help and advice.Best regardsH.J.I'm not too experienced in licensing mazes, sorry :"> Dll is opensource, parts are used: - Libjpeg v6 from Independent Jpeg Group (http://www.ijg.org/) - bitmap to jpeg conversion routines written by magma (http://www.cppfrance.com/codes/BMP-JPG_28263.aspx)You may check those sources, if they are allow commercial distribution. If this ok, nothing opposite from my side. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
H.J. Posted June 8, 2006 Share Posted June 8, 2006 Thanks for your replay, I appreciate you for takin the time to write back to me. Best regards H.J. Link to comment Share on other sites More sharing options...
ppat Posted June 9, 2006 Share Posted June 9, 2006 . The dll works great and is simple to use. I would like to capture the screen and paste the image into a button control with GUICtrlSetImage ($controlID, "C:\ScreenShot001.bmp") But the screenshot taken with the dll is too big. Could you add in the dll an option to freely resize the screenshot before saving the file? Then, I have a *stupid* question, I am just wondering. Imagine that a window is full screen (not maximized though) and then you slide this window left by 100 pixels. Obviously, you cannot see the left part of the window anymore (I am assuming single monitor here). Then use the dll with CaptureRegion, passing -100 for x. The area returned is correct in size, but the 100pixels on the left are returned black. I was just wondering whether it was possible that the dll returned what is actually left of the screen, in this case the original window. I am asking this because I extensively use moving windows beyond the screen area (using WinMove) and want to get screenshots of what is outside of the screen. PS: Why is it necessary to pass "int" parameters before passing x, y, etc.? . Link to comment Share on other sites More sharing options...
nfwu Posted June 9, 2006 Share Posted June 9, 2006 Welcome to the forums!Why is it necessary to pass "int" parameters before passing x, y, etc.?Lookup DLLCall() in the help file.#) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
ppat Posted June 13, 2006 Share Posted June 13, 2006 .Lookup DLLCall() in the help file.Sorry, my download consists of the dll and an .au3 file only, I could not see any help file.Lazycat, would you consider adding "image resizing" in your dll?More generally, could anybody tell me how to put the huge bmp file created by Lazycat's dll inside a button control? I tried GUICtrlSetImage ($controlID, "C:\ScreenShot001.bmp"), but this shows just the part of the bmp image fitting the button dimension. I could not fit the whole screenshot inside a small button control.. Link to comment Share on other sites More sharing options...
nfwu Posted June 14, 2006 Share Posted June 14, 2006 Sorry, i mean DLLCall() in the AutoIt help file. #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
ppat Posted June 14, 2006 Share Posted June 14, 2006 . Sorry, i mean DLLCall() in the AutoIt help file. #) I see, but help file says that type is [optional]. Does the dll support passing nothing instead of "int"? It would be nice not to have to pass optional arguments. I do not see added-value passing "int". . Link to comment Share on other sites More sharing options...
jftuga Posted June 19, 2006 Share Posted June 19, 2006 (edited) I used this code:DllCall("captdll.dll", "int", "CaptureRegion", "str", "second_screen.jpg", "int", 1280, "int", 0, "int", 1280, "int", 1024, "int", 85) to get a shot of my second monitor. Is there a more generic way to do this? How can I get the resolution of the 2nd screen and is relative location to the first screen (ie is it to the left or to the right of the 1st screen)? Thanks, -John Edited June 19, 2006 by jftuga Admin_Popup, show computer info or launch shellRemote Manager, facilitates connecting to RDP / VNCProc_Watch, reprioritize cpu intensive processesUDF: _ini_to_dict, transforms ini file entries into variablesUDF: monitor_resolutions, returns resolutions of multiple monitorsReport Computer Problem, for your IT help deskProfile Fixer, fixes a 'missing' AD user profile Link to comment Share on other sites More sharing options...
ivan Posted June 23, 2006 Share Posted June 23, 2006 (edited) Cool!!! An idea for a next version... It would be really neat if one could capture screens or regions of a non active or background window. I just read your reply to H.J.'s post regarding distribution, and I'd like to say that if I use this dll for commercial purposes or otherwise I will make sure you have the respective credits. Thanks again for such a nice tool! IVAN Edited June 23, 2006 by ivan Think out of the boxGrabber: Yet another WinInfo tool_CSVLib (still alpha)Dynamic html in au3 Link to comment Share on other sites More sharing options...
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