-
Posts
136 -
Joined
-
Last visited
Recent Profile Visitors
286 profile views
Sori's Achievements
-
_ScreenCapture_Capture change background color?
Sori replied to Sori's topic in AutoIt General Help and Support
Thank you for the advice. I thought about taking a screenshot of just the monitors and then stitching everything together... but, lazy For now, I actually just have all of my black backgrounds set to 0x010101 so it's almost black. It makes it easy to rip out the parts outside of the monitor, if I need to -
I'm running multiple monitors at different resolutions. When I take a screenshot, the areas that are captured outside of the monitors are automatically colored in black. Is there a way to change this behavior? Func TakeScreenshot() Local $hBmp, $date, $splitDate, $time, $splitTime Local $screenPosition = WinGetPos("[CLASS:Progman]", "") Local $minXposition, $minYposition, $screenSizeX, $screenSizeY $minXposition = $screenPosition[0] $maxYposition = $screenPosition[1] $screenSizeX = $screenPosition[2] $screenSizeY = $screenPosition[3] ;Remove / from date $splitDate = StringSplit(_NowDate(), "/") $date = $splitDate[1] & $splitDate[2] & $splitDate[3] ;Remove : from time $splitTime = StringSplit(_NowTime(5), ":") $time = $splitTime[1] & $splitTime[2] & $splitTime[3] ; Capture all screens, no cursor _ScreenCapture_SetBMPFormat(4) $hBmp = _ScreenCapture_Capture("", $minXposition, $maxYposition,($screenSizeX + $minXposition), ($screenSizeY + $maxYposition), 0) ; Save to file _ScreenCapture_SaveImage(@DesktopDir & "\" & $date & " " & $time & ".png", $hBmp) _WinAPI_DeleteObject($hBmp) EndFunc ;==>TakeScreenshot *attached image is all white backgrounds to show sample of monitors vs capture*
-
Not going to dump the code down because it's essentially a keylogger. <snip>
-
I'll try to remember that in the future. Looking up autoit and lines just gave me a lot of tutorials on how to draw lines. Thank you for the link. The solutions in that forum solved the problem.
-
I changed my default font in Autoit... Right after a bar appeared down the middle of my window. I've clicked on various View options, but none of them alleviate the issue. Anyone have any suggestions? https://gyazo.com/88f1aa391945029c1a9af260df8c1fe2
-
After ripping apart the program to nearly only the functions that were messing up. I have gotten it to work. Essentially... The function for telling the GDI to show had to be in it's own function, rather than being called whenever the Second Monitor's GDI was called. It's also necessary to call a redraw every time you hide the GUI window. So, my issue is fixed. If anyone should want the program, PM me or catch me on Skype
-
I stripped out all references to external programs and files. The program will still create a log file for debugging purposes. Be sure to change the picture folder to where your pictures are stored, otherwise you will receive an error message after launching. Fullscreen SS - Stripped.au3
-
I hate asking for help on this one, because there's so much code. I'll try to point out as best I can where the issue lies. I'm using the imageSearch.au3 library, which I can't find a link to. Though it can probably be disabled for the purpose of the fix. Some additional programs are also called, but these are also outside the scope of the glitch. (Firefox scripts are crashing when I try to add the code to the post) The issue is with the Mini Slideshow functions of the code. This relates to lines: GUI - 699 - 706 Image Modifications - 451-467, 487-503, GDI - 762-776 The GUI appears as it should, but does not display the image. It simply stays as a black screen. I'll answer as many questions as I can about the code. I understand it's a lot to read over. Thank you for any help you can offer. Fullscreen SS.au3 FSS.txt
-
AutoIt multiple Image searches
Sori replied to privatemonkey's topic in AutoIt General Help and Support
What about something like this, instead? #include <ImageSearch2015.au3> HotKeySet("{-}", "Terminate") While 1 While _ImageSearch("C:\USers\Daniel\Desktop\ImageSearch2015\u.png" = 1 Send("{U down}") Send("{U up}") WEnd While _ImageSearch("C:\USers\Daniel\Desktop\ImageSearch2015\H.png" = 1 Send("{H down}") Send("{H up}") WEnd While _ImageSearch("C:\USers\Daniel\Desktop\ImageSearch2015\z.png" = 1 Send("{Z down}") Send("{Z up}") WEnd While _ImageSearch("C:\USers\Daniel\Desktop\ImageSearch2015\J.png" = 1 Send("{J down}") Send("{J up}") WEnd WEnd Func Terminate() Exit 0 EndFunc ;==>Terminate -
excel udf - error variable must be of type object
Sori replied to lampel's topic in AutoIt General Help and Support
Have you tried running the AU3 file instead? It's usually much easier to find the error with Autoit, rather than an exe -
I made a program that changes certain keyboard keys to do different tasks than they are normally for. One of these is switching to Japanese IME using the right windows key. I figured, I could turn the Menu key into the Kanji switch. Unfortunately... The same code that works on all my other keys, doesn't work on that specific one. Temporary workaround, is I'm using BlockInputEx, but I would like to know if there's a more elegant solution. ;Caps Lock Redirects to Tab If $vkCode = 0x14 Then ;Caps Lock If $hkCapsLock = "Tab" Then Send("{TAB}") Return -1 ;Prevent trigger key from being sent EndIf ElseIf $vkCode = 0x5c Then ;Right Windows Key If $hkRWin = "JP" Then _keybd_event(0x12, "") ;Press alt _keybd_event(0xA0, "") ;Press left shift _keybd_event(0xA0, 0x0002) ;Release left shift _keybd_event(0x12, 0x0002) ;Release alt Return -1 EndIf ElseIf $vkCode = 0x5b Then ;Left Windows Key If $hkLWin = "Run" Then ;Run Command Run(@WindowsDir & "\explorer.exe shell:::{2559a1f3-21d7-11d4-bdaf-00c04f60b9f0}") Return -1 EndIf ElseIf $vkCode = 0x5D Then ;Right Menu Key If $keyboardLayout = "JPDV" Then _keybd_event(0x19, "") ;Press Kanji mode _keybd_event(0x19, 0x0002) ;Release Kanji mode Return -1 ;Does not function EndIf
-
My momma must have dropped me on my head xD The file I created is named, "firefox" so it's detecting itself. Where did the solved button go?
-
AutoItSetOption("WinTitleMatchMode", 2) ;If Firefox is not open, open it with a new tab If ProcessExists("Firefox.exe") = 0 Then Run('"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -new-tab about:newtab') Else ;Switch to Firefox WinActivate("Mozilla Firefox") EndIf Specifically, line 5. If I run the au3 file, it will open firefox. But, if I compile the script and run the exe, it won't. No issues with winactivate in either case. sidenote: Not a big issues, since I can still use the au3 with my keyboard buttons, but I'm curious as to a real fix. Firefox.au3
-
Surya reacted to a post in a topic: SAPI (Windows Speech Recognition API) recognition help
-
coffeeturtle reacted to a post in a topic: Basic Slideshow Wallpaper (Multiple Monitor)
-
While looking for a way to change my desktop background of only my secondary monitor, I found a few simple solutions that are built into Windows. But when you look up how to do such with a slideshow... You only find programs that cost money. So, I set out to make it myself.This is a pretty basic program. It simply displays an image in the center of the screen (scaled to fit screen) and uses a black background.The program does allow mouse passthrough, though you can't drag and drop over it, so it wouldn't really work well if you have icons on your second monitor. #include <File.au3> #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <EditConstants.au3> #include <Misc.au3> #include <Array.au3> #include <GDIPlus.au3> ;User Changeable Variables ;======================================================================== $pictureFolder = "D:\Wallpapers" $changeTime = 5 ;Seconds Global $smWidth = 1600 Global $smHeight = 900 Global $monitorPosition = "Right" ;Global $monitorPosition = "Left" ;======================================================================== Global $imageList = _FileListToArray($pictureFolder) Global $imageCount = $imageList[0] Global $imageHeight, $imageWidth, $pHeight, $pWidth, $pic, $gdiPic _GDIPlus_Startup() OnAutoItExitRegister("CloseProgram") $GUIStyle = BitOR($WS_POPUP, $WS_VISIBLE, $HWND_BOTTOM) ;Popup, Visible, Window on Bottom $GUIStyleEx = BitOR($WS_EX_TRANSPARENT, $WS_EX_TOOLWINDOW) ;Allow Passthrough, Hide from Alt+Tab $Parent = WinGetHandle('Program Manager', '') ;Sets parent to the program manager, allowing you to right click the desktop If $monitorPosition = "Right" Then $GUI = GUICreate("Secondary Wallpaper", $smWidth, $smHeight, @DesktopWidth, 0, $GUIStyle, $GUIStyleEx, $Parent) Else $GUI = GUICreate("Secondary Wallpaper", $smWidth, $smHeight, (-1 * @DesktopWidth), 0, $GUIStyle, $GUIStyleEx, $Parent) EndIf GUISetBkColor(0, $GUI) _WinAPI_SetWindowPos($GUI, $HWND_BOTTOM, 0, 0, 0, 0, BitOR($SWP_NOACTIVATE, $SWP_NOMOVE, $SWP_NOSIZE, $SWP_SHOWWINDOW)) ;Forces window to bottom of screen WinSetTrans($GUI, '', 255) ;Sets Window Visible Transparency: Required for mouse passthrough ChangeImage() GUISetState(@SW_SHOW) ;Show GUI While 1 Sleep($changeTime * 1000) ChangeImage() WEnd Func ChangeImage() $picName = Random(1, $imageCount, 1) ;Get Dimensions of image GetDimensions($imageList[$picName]) $imageHeight = $pHeight $imageWidth = $pWidth ;Turn them all into integers. (Fixes glitch that caused some images to skip resizing) $imageHeight = Int($imageHeight) $imageWidth = Int($imageWidth) $smHeight = Int($smHeight) $smWidth = Int($smWidth) ;Adjust the image size ;----------------------------------------------- ;If the image is bigger than the screen, adjust it If $imageWidth > $smWidth = 1 Or $imageHeight > $smHeight = 1 Then ;Calculate Aspect Ratio of image $aspectRatioX = $smWidth / $imageWidth $aspectRatioY = $smHeight / $imageHeight If $aspectRatioX < $aspectRatioY Then $scaleFactor = $aspectRatioX Else $scaleFactor = $aspectRatioY EndIf $imageHeight = $imageHeight * $scaleFactor $imageWidth = $imageWidth * $scaleFactor ;Else ;Image is smaller/same size as monitor EndIf ;Calculate Center of monitor ;(Monitor size - image size) / 2 $smCenterX = ($smWidth - $imageWidth) / 2 $smCenterY = ($smHeight - $imageHeight) / 2 ;Resize the image $hHBmp = $pictureFolder & "\" & $imageList[$picName] $gdiPic = _GDIPlus_BitmapCreateFromFile($hHBmp) ;convert GDI bitmap to GDI+ bitmap _GDIPlus_BitmapDispose($pic) $pic = _GDIPlus_ImageResize($gdiPic, $imageWidth, $imageHeight) ;resize image _GDIPlus_BitmapDispose($gdiPic) GUISetBkColor(0, $GUI) Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($GUI) ;create a graphics object from a window handle $gdiPic = _GDIPlus_BitmapCreateFromFile($pictureFolder & "\" & $imageList[$picName]) _GDIPlus_GraphicsDrawImage($hGraphics, $pic, $smCenterX, $smCenterY) ;display scaled image _GDIPlus_GraphicsDispose($hGraphics) ;Garbage Cleanup EndFunc ;==>ChangeImage Func GetDimensions($picName) Local $prop, $dArray, $fileSize, $imageDimensionsGDI $path = $pictureFolder & "\" & $picName $fileSize = FileGetSize($path) ;Save information to registry for faster access. Compare size of picture to verify changes to picture If $fileSize <> RegRead("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Size") Then ;File sizes do not match RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Size", "REG_SZ", $fileSize) $imageDimensionsGDI = _GDIPlus_ImageLoadFromFile($path) $pWidth = _GDIPlus_ImageGetWidth($imageDimensionsGDI) $pHeight = _GDIPlus_ImageGetHeight($imageDimensionsGDI) _GDIPlus_ImageDispose($imageDimensionsGDI) RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Width", "REG_SZ", $pWidth) RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Height", "REG_SZ", $pHeight) Else ;File sizes match $pWidth = RegRead("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Width") $pHeight = RegRead("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Height") If $pWidth = "-1" Or $pHeight = "-1" Then RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Size", "REG_SZ", $fileSize) $imageDimensionsGDI = _GDIPlus_ImageLoadFromFile($path) $pWidth = _GDIPlus_ImageGetWidth($imageDimensionsGDI) $pHeight = _GDIPlus_ImageGetHeight($imageDimensionsGDI) _GDIPlus_ImageDispose($imageDimensionsGDI) RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Width", "REG_SZ", $pWidth) RegWrite("HKEY_CURRENT_USER\Software\Secondary Wallpaper\Pictures", $picName & " Height", "REG_SZ", $pHeight) EndIf EndIf EndFunc ;==>GetDimensions Func CloseProgram() ;Garbage Cleanup _GDIPlus_GraphicsDispose($gdiPic) _GDIPlus_Shutdown() EndFunc ;==>CloseProgram Secondary Wallpaper.au3
-
- multiple monitor
- slideshow
-
(and 3 more)
Tagged with:
-
tourism123 reacted to a post in a topic: [solved] Desktop background slideshow pause and next image?
-
GDIPlus_ImageResize error 4... ok, so how do I fix it?
Sori replied to Sori's topic in AutoIt General Help and Support
Several hours later... Hasn't crashed yet. Next test is to compile it into an exe and run it again. But, I think it was a memory leak.