-
Posts
402 -
Joined
-
Last visited
Content Type
Forums
Downloads
Forum Articles
Events
Everything posted by Rad
-
Weird, the upload must not have gone through. It doesn't matter though, that example you posted does exactly what I needed. Thanks!
- 2 replies
-
- stdoutread
- libcurl
-
(and 3 more)
Tagged with:
-
I'm using to upload a file to a server. After the upload the server returns a URL to that file. My program needs to give that URL to the user. libcURL is working fine and the upload is successful, and the HTML response needed is output to scite's console. I need the information put into the console to be stored in a variable, though, and I can't figure it out. I think I need to use stdout or stdread to do this. I have used these before when using a run() command but this library is using a dll (and is much cleaner than my previous version which used run commands). How do I record the output buffer of a DLL? (or whatever stdout is called). This attachment is what I'm testing it with, just open "playground.au3" and run it. It should spit a bunch of information to the console. The top listing of variables is all from curl_getdata(), the part with brackets and arrows is from my web server. I need the second part to be put into a variable. PS: The cURL process ID is stored as $__hcurl_process seangriffin's manages to accomplish this, it looks like the key is to use "DllCallbackRegister". I'm trying to plug this in to smartee's UDF but the two UDF's look like completely different languages. I don't think I will be able to figure this out on my own, but I'm going to keep trying. EDIT: You need to move the DLL's to the same folder as playground.au3, and edit "libcURL.au3" and change the #include to quotes instead of brackets. I packed it wrong.
- 2 replies
-
- stdoutread
- libcurl
-
(and 3 more)
Tagged with:
-
libcURL UDF - the multiprotocol file transfer library
Rad replied to smartee's topic in AutoIt Example Scripts
As someone who rarely uses autoit and doesn't understand how DLL's work, this made it much easier. I have this working with form fields and files which is all I need, but I'm wondering how do you get the data returned (currently prints to console) in a variable? The example "_curl_easy_getinfo.au3" requests an image, the return for that response is a bunch of binary data. I need everything after the "We recieved content-type: image/png" from this screenshot: http://screencast.com/t/NuIHoHRo920J EDIT: The answer lies within the dllcallback functionality, it's accomplished here: I do not have the ability to combine the two though. -
I am in need of a workaround, as the script does not support a few functions (especially _DeleteAllItems) if I use the classic function. I've searched for a UDF version of GUICtrlSetPos but couldn't find one. Google and autoit forum search didn't help. What can I do? Here is an example, clearly they both should move together: #include <GUIConstantsEx.au3> #include <GuiListView.au3> $gui = GUICreate("") $w = 50 $list1 = _GUICtrlListView_Create($gui, "Lol", 0, 0, $w, 50) $list2 = GUICtrlCreateListView("Lol", 0, 70, $w, 50) $btn1 = GuiCtrlcreatebutton("-", 0, 50, 20, 20) $btn2 = GuiCtrlcreatebutton("+", 20, 50, 20, 20) guisetstate() while 1 $msg = GUIGetMsg() if $msg = $GUI_EVENT_CLOSE then Exit if $msg = $btn1 then $w -= 10 GUICtrlSetPos($list1, 0, 0, $w, 50) GUICtrlSetPos($list2, 0, 70, $w, 50) EndIf if $msg = $btn2 then $w += 10 GUICtrlSetPos($list1, 0, 0, $w, 50) GUICtrlSetPos($list2, 0, 70, $w, 50) EndIf sleep(10) WEnd Also a video showing why this is so annoying! It appears to resize the control, but the visible frame is not resized. http://www.screencast.com/users/RadGH/folders/Jing/media/9dea81df-23ab-4b66-aea2-be2a8c7e80d5 EDIT: Same result with GUI resizing mode
-
EDIT: Nevermind, I forgot a single line of code: $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) ...Where is the delete button I'm going off the _GUICtrlListView_Create() example, trying to copy some code out of it and get it to work with my current script. But it's really long and has a LOT of random variables like $tNMHDR and such. I do not know where to begin for debugging... ugh! I can't find a way to decide what element was double-clicked on. So, I copied pieces from the help file and it works. But the data returned by WM_NOTIFY is always the same. Here is the appropriate code for declaring my list view, although it's not generated exactly like this: $filetree = _GUICtrlListView_Create($GUI,'',28,28,450,450) $filetree_column = _GUICtrlListView_AddColumn($filetree, "", $width - $width * 0.1) $file_list[$i][2] = _GUICtrlListView_AddItem($filetree, $file_list[$i][0]) And here is what I've gathered from the help file: Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo ;~ Local $tBuffer $hWndListView = $filetree If Not IsHWnd($filetree) Then $hWndListView = GUICtrlGetHandle($filetree) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Local $tagNMHDR, $vEvent Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_DBLCLK consoleWrite("-->hWndFrom:" & @TAB & $hWndFrom & @LF & _ "-->IDFrom:" & @TAB & $iIDFrom & @LF & _ "-->Code:" & @TAB & $iCode & @LF & _ "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @LF & _ "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _ "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _ "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _ "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _ "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _ "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _ "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @LF & _ "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags") & @CRLF) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc
-
Align input text to the right, differently than $ES_RIGHT
Rad replied to Rad's topic in AutoIt General Help and Support
The ellipsis thing is really nice. I've tried recreating that before, I didn't know it was a style option! But it doesn't seem to work inside an input and if it did it would limit the ability to manually edit the input (I assume I could remove the style when the user grants it focus, but... that would be weird). I'll just use Brewman's option. It looks like it would work, surprised I didn't think of it. Even when I mentioned moving the caret position, lol. Thanks! -
I have a text input control which shows a directory, like: [C:\My Folder\File.exe ] If the directory is long, it cuts off from the right: [C:\My Folder\Fi] I would rather it cuts off from the left, because you rarely need to know what folder/drive you are accessing, but rather what the file is. This is what I would prefer: [y Folder\File.exe] Normally if you were typing this into the input, because you type left-to-right, you would end up with this as a result. But if the script adds the text when you are done with the file browse dialog it won't do it that way. If there is a way to set the caret position of a control without giving the control focus, I could use that also. (But again, I couldn't find a way to do this in the help file) Is there a way to make text "flow" from the right instead of the left? I don't know the proper term... But align-right does not solve the issue. It aligns right until the text is cut off, and then it shows the string from the left first. I could probably write a way to remove excess characters if they scroll off the edge, but not without complicating the ability to manually edit the text input. /shrug If there is a built in option that I can't find, that is what I am looking for. Thanks.
-
FileGetSize() returning 0 in Windows Seven x64
Rad posted a topic in AutoIt General Help and Support
I've had this working program for quite a while now, but bought a new laptop with Windows Seven x64 (home premium). At first, the program would completely lock the system when I took screenshots with the _ScreenCapture_Capture() function (It would save the image with the bottom ~200pixels rendered, and would stop on the same pixel every time). So I ran the source code, and that problem is gone. The program worked almost fine... But the logic to downgrade the quality of the image no longer works. I used FileGetSize() to see if the file is under a certain amount, and if not I would convert it to a PNG, then to a JPG and continually downgrade it from there. This all worked fine on XP x32, and works fine for my friend running Vista x32. The rest of the code works as intended. The file gets uploaded, all of the windows look normal. The only thing that doesn't work is FileGetSize(). From the source code: global $MaxFilesize = 1024*400 func save_image($f) $bmp = $f&".bmp" if Not fileexists($bmp) then debug("Image does not exist for conversion ["&$bmp&"]") Else if FileGetSize($f) < $MaxFileSize then debug("Image does not need to be converted ["&$bmp&"]") if FileGetSize($f) = 0 then debug ("ERROR: Image filesize could not be determined ["&@WORKINGDIR&"\"&$bmp&"]") return -1 EndIf return $bmp EndIf EndIf ... This basically says "Does the file exist? Then is it smaller than XXX? Let's make sure it's not 0!". Now you can see the debug lines, heres what gets output to my console: Line 014 [11:30:51] Image was saved as [radshot 3testexe_2010-165-23-30-51-84.bmp] Line 015 [11:30:51] Image exists [radshot 3testexe_2010-165-23-30-51-84.bmp] Line 016 [11:30:51] Image does not need to be converted [radshot 3testexe_2010-165-23-30-51-84.bmp] Line 017 [11:30:51] ERROR: Image filesize could not be determined [C:\Users\Radley's G73J\Documents\Radshot VERSION 2.0\radshot 3testexe_2010-165-23-30-51-84.bmp] I will keep messing around with this, but is this a known issue? Is there a workaround? What should I try next? -
Get Width + Height of multiple monitors
Rad replied to Rad's topic in AutoIt General Help and Support
Yeah, that is the same code that I linked before, except it's the total resolution of multiple monitors. The dll call's return arrays, they might include separate monitor information... Just a guess, but I can't test it with just one monitor. I will try to figure this out some time when he has free time, but would love to make some progress before hand. -
My second monitor has been dead for a few weeks, and a friend of mine is urging me to make my program work with his second monitor. I plan to add a hotkey for a single monitor and separate hotkey for each monitor individually, as well as the entire desktop - but I figured that out. I have done some searching but could only find how to get the entire screenspace of a desktop. And I do not understand DLL's so I am unsure if that users32.dll would have what I am looking for to get each monitor's information. It would be great to have this in a 2d-array formatted like so: $Monitors[0][0] = 3 ;Number of monitors $Monitors[1][0] = 1024 ;First monitor's width $Monitors[1][1] = 1280 ;First monitor's height $Monitors[1][2] = 0 ;First monitor's X-origin $Monitors[1][3] = 0 ;First monitor's Y-origin $Monitors[2][0] = 1400 ;Second monitor's width $Monitors[2][1] = 1050 ;Second monitor's height $Monitors[2][2] = -1400 ;Second monitor's X-origin $Monitors[2][3] = 0 ;Second monitor's Y-origin $Monitors[3][0] = 800 ;Third monitor's width $Monitors[3][1] = 600 ;Third monitor's height $Monitors[3][2] = 1024 ;First monitor's X-origin $Monitors[3][3] = 0 ;First monitor's Y-origin This example would be 3 monitors side by side, with the first one in the middle and second on the left. All of them would be aligned to the top of the first monitor. If this were lined up physically, you would have the right monitor stacked on a few books and the middle monitor sitting on a magazine, provided the base is the same height. If there is already a way to get these values, please let me know. Can't find anything in the helpfile, and I do not have another monitor available so this i'll have to hope the code is right and have him test it for me.
-
Thanks for the reply, that seems to work and I am trying to fiddle with it. I don't understand why there is a need for graphics and also hbitmaps... Edit: Got it to work best using this function, haven't implemented the ability to change width and height yet but you should be able to figure it out with the $h and $w variables. Probably not an efficient way to do it, but it's actually a lot faster than the command line utility. Will tweak with it some more. I really think there should be GDI functions to just change the width height and quality. func image_quality($file, $quality, $name, $output) $hGUI3 = GUICreate("Scaled Down", 200, 150) GUISetState() _GDIPlus_Startup () $hImage = _GDIPlus_ImageLoadFromFile ($name) $h = _GDIPlus_ImageGetHeight($hImage) $w = _GDIPlus_ImageGetWidth($hImage) $sCLSID = _GDIPlus_EncodersGetCLSID ("JPG") $hGraphic3 = _GDIPlus_GraphicsCreateFromHWND ($hGUI3) $bitmap3 = _GDIPlus_BitmapCreateFromGraphics($w, $h, $hGraphic3) $image3 = _GDIPlus_ImageGetGraphicsContext($bitmap3) _GDIPlus_GraphicsDrawImageRectRect ($image3, $hImage, 0, 0, $w, $h, 0, 0, $w, $h) _GDIPlus_GraphicsDrawImageRect($hGraphic3, $bitmap3, 0, 0, $w, $h) $tParams = _GDIPlus_ParamInit (1) $tData = DllStructCreate("int Quality") DllStructSetData($tData, "Quality", 100) ;quality 0-100 $pData = DllStructGetPtr($tData) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) $pParams = DllStructGetPtr($tParams) _GDIPlus_ImageSaveToFileEx($bitmap3, $output, $sCLSID, $pParams) GUIDelete($hGUI3) _WinAPI_DeleteObject($bitmap3) _GDIPlus_GraphicsDispose($image3) _GDIPlus_GraphicsDispose ($hGraphic3) _GDIPlus_ImageDispose ($hImage) _GDIPlus_Shutdown () FileDelete($name) endfunc
-
Use the Autoit Window Info tool, which gets placed in the start menu folder for autoit. Highlight the button and look under the "Control" tab, press CTRL+ALT+F. Now use the ID under the Control tab along with the window title in the function ControlClick ( "title", "text", controlID [, button [, clicks [, x [, y ]]]] ) Example: ControlClick("Calculator", "", 82)
-
EDIT: Since there hasn't been a reply, I assume this functionality is unavailable in current release... or the thread become TLDR. Figured I should do the same as I did for uploading a form without IE, and find a command-line tool. I'm going to use G'MIC. I looked at imagemagick but it had an entire GUI thing and too many files to include. I just need to resize and change the quality I need two functions that should be simple, and I'm very surprised I don't see them in the help file. I just need this capability in it's most basic form, the quality function is very important, the scale is not but could add many features to my program. Maybe I have overlooked these, but if I knew enough to make these functions here is how I would use them: $hBMP = _ScreenCapture_Capture("") $hBMP = _GDIPlus_ImageResize($hBMP, 1024, 768, True) ;True would be for preserving aspect ratio, somehow _ScreenCapture_SaveImageQuality($hBMP, @scriptdir & "\file.jpg", 95) ; 95 being the image quality Now these might exist with a different name, but I don't see them. I used this function in the past but it's old code, there are a few errors when I try to compile and when I fix the errors the include file starts throwing more errors... Func __ScreenCapture_SaveImage($sFileName, $hBitmap, $fFreeBmp, $iQuality) Local $hClone, $sCLSID, $tData, $sExt, $hImage, $pParams, $tParams, $iResult, $iX, $iY If @error Then Return SetError(-1, -1, False) $sExt = StringUpper(_GDIPlus_ExtractFileExt($sFileName)) $sCLSID = _GDIPlus_EncodersGetCLSID($sExt) If $sCLSID = "" Then Return SetError(-2, -2, False) $hImage = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap) If @error Then Return SetError(-3, -3, False) Switch $sExt Case "BMP" $iX = _GDIPlus_ImageGetWidth($hImage) $iY = _GDIPlus_ImageGetHeight($hImage) $hClone = _GDIPlus_BitmapCloneArea($hImage, 0, 0, $iX, $iY, $giBMPFormat) _GDIPlus_ImageDispose($hImage) $hImage = $hClone Case "JPG", "JPEG" $tParams = _GDIPlus_ParamInit(1) $tData = DllStructCreate("int Quality") DllStructSetData($tData, "Quality", $iQuality) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, DllStructGetPtr($tData)) Case "TIF", "TIFF" $tParams = _GDIPlus_ParamInit(2) $tData = DllStructCreate("int ColorDepth;int Compression") DllStructSetData($tData, "ColorDepth", $giTIFColorDepth) DllStructSetData($tData, "Compression", $giTIFCompression) _GDIPlus_ParamAdd($tParams, $GDIP_EPGCOLORDEPTH, 1, $GDIP_EPTLONG, DllStructGetPtr($tData, "ColorDepth")) _GDIPlus_ParamAdd($tParams, $GDIP_EPGCOMPRESSION, 1, $GDIP_EPTLONG, DllStructGetPtr($tData, "Compression")) EndSwitch If IsDllStruct($tParams) Then $pParams = DllStructGetPtr($tParams) $iResult = _GDIPlus_ImageSaveToFileEx($hImage, $sFileName, $sCLSID, $pParams) _GDIPlus_ImageDispose($hImage) If $fFreeBmp Then _WinAPI_DeleteObject($hBitmap) Return SetError($iResult = False, 0, $iResult = True) EndFunc Trying another answer but keep getting the error Autoit3.exe has encountered an error... Is there something wrong with this code? No errors if I just save it as a jpg, only when I add params. $f = @scriptdir & "\file.jpg" $q = 75 $hBMP = _ScreenCapture_Capture("") _GDIPlus_Startup() $TParam = _GDIPlus_ParamInit(1) $Datas = DllStructCreate("int Quality") DllStructSetData($Datas, "Quality", $q) _GDIPlus_ParamAdd($TParam, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, DllStructGetPtr($Datas)) $clsid = _GDIPlus_EncodersGetCLSID("JPG") _GDIPlus_ImageSaveToFileEx($hBmp, $f, $clsid, DllStructGetPtr($TParam))
-
I have some good news, but I wish it were cleaner. If you improve this please post the changes, I'm not very good at detecting errors... You can read in from stderr (using STDErrRead($result) where $result is the stream from the Run command. To do this you need to store the actual result from the request to a file (aka the source code of the website). And for that, you add -o curl.tmp to the command. I don't know why it's stderr and not stdin, though I don't really know the difference regardless. Now, after the Run() you can use StderrRead() to get the "progress" of the file. If you run the command line in a console you can see how this is formatted. I made this function to collect the data. You will likely need to mess with it, I found a few times when the arrays were incorrect and tried to prevent them. #cs ==================================================================================================== Description: Takes the default stderrread() data of a curl.exe command converts it to a usable format Parameters: curlGetProgress($sStdErr) Returnvalues: Array { 0: Total % 1: Total Bytes 2: Download % 3: Download Bytes 4: Upload % 5: Upload Bytes 6: Download Rate 7: Upload Rate 8: Estimated Time 9: Time Elapsed 10: Time Left 11: Current Speed (Upload or Download, I assume) } Author: Rad Notes: This is only enabled if your curl command outputs a progress meter (NOT progress "bar"). From the curl documentation: "If you want a progress meter for HTTP POST or PUT requests, you needto redirect the response output to a file, using shell redirect (>), -o [file] or similar." ==================================================================================================== #ce func curlGetProgress($stream) local $regexp = stringregexp($stream, "[0-9\:\-]{1,}[a-zA-Z\:]{0,}", 3) local $err = @error local $array[12] if $err > 0 then ;The regexp had an error, which is likely caused by the formatting of the stream. seterror($err+1) return $err+1 Else if isarray($regexp) Then for $i = 0 to 11 $array[$i] = $regexp[$i] Next return $array Else ;The regexp didn't catch an error, but there was only one match seterror(1) return -1 EndIf EndIf EndFunc
-
Thanks for the suggestion! I was currently looking at wGet but I don't think it can do the 'send' portion. Your suggestion looks like what I need, but I'm not sure what to do with the source code. *snip* Edit: Using the cURL download wizard I was able to get a pre-compiled version of curl.exe, with SSL disabled (Not using it). I was able to upload my file AND include the username/password field using curl.exe -F "username=testuser" -F "password=testpass" -F "file=@C:\Documents and Settings\Administrator\My Documents\My Pictures\myimage.jpg" -F press=Upload http://url.com/submit.php Thanks for showing me this. I learned a bit and can finally finish my program without using a public ftp account. I also see potential for this cURL in my program for other things. It would be great if I could get a progress bar out of this. If I run it as a .bat, it displays transfer rate, amount transferred, percentage etc. It can also do a progress bar. Is there any way to make this (using RunWait()) to output this data in autoit-usable format? I will read the documentation some more, but you might already know...
-
Wondering if there are any ways to send a form, including a "file" input, without using Internet Explorer. Making a gallery that allows users to manage it via software and if I can get this to work and be sent back the raw text of the page (which will output errors, etc), thats all I will need. FTP is not an option though, I know game maker was able to do this - so I assume there is a DLL out there, but I have no experience with DLL's and don't even understand how they work. Searched the forum but... Don't know what to search for. I tried Ajax, but that returned a remote desktop script and a pure autoit webserver. Not what I am looking for... What I need to do, is send a form -- or some other type of data that will upload an image through http -- and submit a username and password. I figured storing sessions/cookies with autoit would be a hassle, and I would very much rather not using any of the IE functions.
-
I have made a program that lets me take screenshots and uploads them via FTP to my website [link]. I am starting a new version of this program, and am going to be testing a lot of theories I had so far, but would greatly appreciate any advice or suggestions to making this work under my circumstances. Three people are currently using this program, and I plan to expand that later. For now, I need to fix a major security problem. This is both an autoit problem, and a web design problem. I only have access to a web server, so writing a desktop application isn't an option. This makes it tricky to ask for help, I'm not sure if I should ask here or on a web design forum. What I have now - Single Public FTP account which all users share to upload files, causes timeouts and errors when multiple users upload a screenshot. - User system is very basic, you choose a username and the screenshots get uploaded to the server in a folder named after your username. (Example www.website.com/screenshots/RadGH/) - Insecurity, if they decompile the program they can find the FTP account and upload other files, including server scripts, to the server. - Server side, gallery is completely automated with PHP scripts What I need changed in the new version - User authentication. Preferably using a MySQL database, however, the server must know if the user is authenticated. - Sign in/Register ability through software, I can't directly access the MySQL database due to security issues as you saw with the FTP accounts - Ability to modify/delete images on the web, this I can handle - but the usernames/password should be the same as those used in the software. How can I register? I was thinking of a way to send a fake HTML form to a sign-in page on the website, but this must be fully automated and the user shouldn't know what is going on. How can I upload images? If the above form method worked, it's possible I could use a PHP upload script to do the same thing - though I'm not sure how I would attach a file to a form in Autoit. FTP is still an option, but I am very much new to web administration including FTP account access and restrictions. How will the user stay "logged in" through autoit? If the form method was used, what will keep the user logged in server side? I could add the users IP to the username and remove it after 5 minutes of being idle while using a periodic web request to avoid the timeout, but I would prefer a cleaner way.
-
So I made a program that lets me resize a game when its in windowed mode, but after I resize it the window just stops redrawing. I can fix this by using a program Ultramon to move it to my other monitor then move it back, I don't know how Ultramon does it, but that makes it start redrawing again. I don't know if autoit has any functions to fix this but I've tried just moving the window to the other monitor, even after waiting, and also tried using _WinAPI_RedrawWindow(). I also tried both _WinAPI_MoveWindow() and Winmove() Here is the important part of my code, making it have $WS_POPUP is one of the main reasons I am making this program. It is not any sort of cheat, I just prefer to run my games in "fake fullscreen" mode, which most games just half-ass windowed mode, except Blizzard games and Left 4 Dead. func NoBorder() $win = WinGetHandle($title) _WinAPI_SetWindowLong($win, $GWL_STYLE, $WS_POPUP) sleep(500) _WinAPI_MoveWindow($win, $x, $y, $width, $height, false) ;Winmove($title, '', $x, $y, 1000, 700) EndFunc
-
Problem with transparent window with a GIF being on top
Rad replied to Rad's topic in AutoIt General Help and Support
Oh whoops, lol! I clicked select file then thought the button next to it would upload, but that button says "Clear Selection" And I just got back too... I'm going to mess around with it some more for awhile EDIT: Commented out the $WS_EX_TRANSPARENT part inside the GUICreate() function, but still using it in the _WinAPI_SetWindowLong function, and it seems to stay on top. I think it's fixed for now. imageontop.zip -
Trying to make the image stay on top and be click through, but can't get the image to stay on top. There must be some problem redrawing the image with the $WS_EX_Transparent option but I can't find a way to fix it. Tried a few different ways to make the image too. Maybe someone who is more advanced can give me a suggestion? I remember seeing an example script that showed a wizard.gif or something and you could draw it outside of the window. Maybe this would be a workaround to the $WS_EX_TRANSPARENT problems. But I don't know. File uploaded to post #3
-
Use GDI+ with Screencaptue to save image at specific filesize
Rad replied to Rad's topic in AutoIt General Help and Support
Thanks for the help, making the filename into a blank string made everything work just fine. I didn't need to use the second script you provided. So all I changed was: $hBmp = _ScreenCapture_CaptureWnd('', $wnd) Thanks again. -
Use GDI+ with Screencaptue to save image at specific filesize
Rad replied to Rad's topic in AutoIt General Help and Support
Hi, thanks for the script - Your example works. I tried integrating it into my own script, however the quality does not degrade. I'm not sure what I'm missing. Here is the main piece of code from my script. It does not give any errors, the image just does not get degraded. It's probably something simple, I'll post this while I try some more things. $longtitle = $shorttitle&@YEAR&@MON&@MDAY&"-"&@HOUR&@MIN&@SEC&".jpg" $gdiname = @ScriptDir & "\"& $longtitle if $AltDown Then $hBmp = _ScreenCapture_CaptureWnd($gdiname, $wnd) Else $hBmp = _ScreenCapture_Capture($gdiname, 0, 0, -1, -1, false) EndIf $iQuality = 100 Do __ScreenCapture_SaveImage($gdiname, $hBmp, False, $iQuality) $iQuality -= 5 Until FileGetSize($gdiname) <= 1024*250 -
I need to take a screenshot and degrade the quality until it reaches 250kb. I had it take a screenshot, read the size, degrade quality and take another until the size was small enough, but that would cause it to take many screenshots and in many cases would delay for too long after you hit Print Screen. I need to take the file and change the quality of the JPG. The only option I see is _ScreenCapture_SetJPGQuality But I need to change the quality of an existing image - Not one as it is taken by screencapture. Unless you can degrade while it is in clipboard.
-
I thought it was simple, but I can't figure it out. Unfortunately the search results are either irrelevant or they are "How to make custom script icon". The example uses a .dll, but simply trying an EXE doesn't seem to work. Is there something I'm missing? GUICtrlCreateButton($files[$i][0], $x, $y, $form_icosz, $form_icosz, $BS_ICON) GUICtrlSetImage(-1, "C:\Program Files\App\App.exe") The same format above works when I specify an .ico file. Edit: was using the wrong array index... It was actually $files[$i][2] I should have waited to post :/ Also, I had to add a third parameter "1" to GUICtrlSetImage. ...Wish I could remove this post.
-
I have a problem right now, I have an excel spreadsheet with about 180 lines of data that I need to enter into an online form with each line being a new page. This is housing data, with rental costs and that sort of thing. I decided to use Autoit rather than do it manually so in the future I can automatically upload new housing lists automatically as well. Now heres where I'm stuck. My internet explorer does not work so I can't use the IE.au3, so I will just automatically move the mouse cursor and enter data in Firefox the old fashioned way. This will work fine as soon as I can get the data to work. I'm trying to use the ExcelCOM_UDF.au3 to read the data from the spreadsheet. The documentation is very vague and simply returns 0 for everything I try to do. I was reading in the thread but its so old that the first pages I bothered looking through used functions that have been changed, renamed, and removed even. I have a really simple task. Take one row at a time, starting at row two, and read columns A through U into my script. Here is what I am trying, but its returning 0's. Probably something stupid, but an error would be nice... #include <ExcelCOM_UDF.au3> $Book = _ExcelBookOpen(@DesktopDir & "\Houses Spreadsheet.xls", 0, "True") ; _ExcelBookOpen($sFilePath, $fVisible = 1, $fReadOnly = False, $sPassword = "", $sWritePassword = "") $Cell = _ExcelReadCell($Book, "A", "2") Msgbox(0, '', $Cell) ; _ExcelReadCell($oExcel, $sRangeOrRow, $iColumn = 1) ; _ExcelReadArray($oExcel, $iStartRow, $iStartColumn, $iNumCells, $iDirection = 0, $iIndexBase = 0) Like this, I get an error "The requested action with this object has failed." According to the comment on ExcelReadCell, $RangeOrRow should be a string. The way I remember it, rows were horizontal, which are numbered in Excel. Columns were vertical, the lettered ones. So I dont know why $sRangeOrRow is a string and $iColumn is an integer. If I change them around: $Cell = _ExcelReadCell($Book, "A", "2") The msgbox returns 0. I am using Excel 2007. Any ideas?