Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/12/2015 in all areas

  1. Try this: #include <GDIplus.au3> #include <WinAPIRes.au3> $hGUI = GUICreate("" , 260 ,260 , -1 , -1 , -1 ) GUISetState(@SW_SHOW) _GDIPlus_Startup() Local $hW = 60 , $hH = 60 $hBitmap = _GDIPlus_BitmapCreateFromScan0($hW, $hH) $g_hGfxCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap) $hPen = _GDIPlus_PenCreate(0xFF0F0F0F , 2) $hX = $hW / 2 - $hW / 2 + 15 $hY = $hH / 2 - $hW / 2 + 15 _GDIPlus_GraphicsDrawRect($g_hGfxCtxt , $hX , $hY , 30 ,30 , $hPen) _GDIPlus_PenSetColor($hPen, 0x99FF0000) _GDIPlus_GraphicsDrawRect($g_hGfxCtxt , 60 / 2 , 60 / 2 , 1 ,1 , $hPen) $icon = _GDIPlus_HICONCreateFromBitmap($hBitmap) Local $hPrev = _WinAPI_CopyCursor(_WinAPI_LoadCursor(0, 32512)) _WinAPI_SetSystemCursor($icon, 32512) Do Until GUIGetMsg() = -3 _WinAPI_SetSystemCursor($hPrev, 32512) _WinAPI_DestroyCursor($icon) _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($g_hGfxCtxt) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_Shutdown() GUIDelete()
    2 points
  2. trancexx

    WinHTTP functions

    The other day mikeytown2 posted one post in HTTP UDF's thread that got me thinking if there is better (different) method to send requests through the HTTP protocol to HTTP servers. There is Winhttp.dll that ships with windows and that is its main purpose. I couldn't find any examples of using this dll in AutoIt, so I came up with this. Microsoft about Windows HTTP Services: Microsoft Windows HTTP Services (WinHTTP) provides developers with an HTTP client application programming interface (API) to send requests through the HTTP protocol to other HTTP servers... .. blah, blah, and so on... This is an example of getting page header: #include "WinHttp.au3" Opt("MustDeclareVars", 1) ; Open needed handles Local $hOpen = _WinHttpOpen() Local $hConnect = _WinHttpConnect($hOpen, "msdn.microsoft.com") ; Specify the reguest: Local $hRequest = _WinHttpOpenRequest($hConnect, Default, "en-us/library/aa384101(VS.85).aspx") ; Send request _WinHttpSendRequest($hRequest) ; Wait for the response _WinHttpReceiveResponse($hRequest) Local $sHeader = _WinHttpQueryHeaders($hRequest) ; ...get full header ; Clean _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) ; Display retrieved header MsgBox(0, "Header", $sHeader)Everything you need to be able to use this UDF can be found at WinHttp site. Remember, basic understanding of the HTTP protocol is important to use this interface. ProgAndy, trancexx WinHttp.au3 is completely free and no one has right to charge you for it. That's very important. If you feel WinHttp.au3 was helpful to you and you wish to support my further work you can donate to my personal account via PayPal address: trancexx at yahoo dot com I will appreciate that very much. Thank you in advance! :kiss:
    1 point
  3. Jon

    Where is au3record.exe?

    It has been removed from the main installer from v3.3.14.1 as it triggers many AV false positives. You can find an old version here: https://www.autoitscript.com/autoit3/files/archive/autoit/ autoit-v3.3.14.0.zip A little explanation of the rather strange link above: If we give you a direct link to the file (or the zip file which includes it) the site gets flagged as hosting malware (yes really!) - so what you have is a link to the AutoIt archive page and the name of the zip file you need to download from it.
    1 point
  4. Please be more specyfic. What is your question ?
    1 point
  5. You can simple create a Dummy Button. Program1 #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Program1", 260, 109, 192, 124) $Button1 = GUICtrlCreateButton("Change Color", 88, 48, 73, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Local $hWin=WinGetHandle("[TITLE:Program2]") ControlClick($hWin,"","Button1") EndSwitch WEnd Program2 #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Program2", 285, 116, 192, 124) $Label1 = GUICtrlCreateLabel("Danyfirex", 88, 32, 95, 27) GUICtrlSetFont(-1, 14, 400, 0, "Lucida Sans Unicode") GUICtrlSetColor(-1, 0x000000) $btn=GUICtrlCreateButton("Dummy",100,70,80,30) GUICtrlSetState(-1,$GUI_HIDE) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btn GUICtrlSetBkColor($Label1,ColorConvert( Random(0,255,1)+256*Random(0,255,1)+256*256*Random(0,255,1) )) EndSwitch WEnd Func ColorConvert($iColor) Return BitOR(BitAND($iColor, 0x00FF00), BitShift(BitAND($iColor, 0x0000FF), -16), BitShift(BitAND($iColor, 0xFF0000), 16)) EndFunc Saludos
    1 point
  6. Something like this. But you definitely need to learn how Autoit works. Especially arrays. There are very good tutorials in the wiki #include <File.au3> ; List all the files in the directory Local $aFileList = _FileListToArray(@ScriptDir, "*.txt") For $i = 1 To $aFileList[0] Replace($aFileList[$i]) Next Func Replace($sFile) $sText = FileRead($sFile) $sText = StringReplace($sText, "old text", "new text") FileDelete($sFile) FileWrite($sFile, $sText) EndFunc ;==>Replace
    1 point
  7. Hi, Just a small error for calculating the average: Return $Ave / $i ; Send back the value, dividing total by # of numbers added together --> averageShould be: Return ($Ave / ($i-1)) ; Send back the value, dividing total by # of numbers added together --> averageCram... Edit: I had to edit because I am noob !!!! :-)
    1 point
  8. For Ffmpeg I tend to use the following Run(@ComSpec & " /c " & 'ffmpeg.exe ' & $parameters, $ffmpegdir, @SW_SHOW)And while troubleshooting, I use /k instead of /c which then keeps your console window open.
    1 point
  9. mLipok

    Error - My Script

    Just check @error $read = _StringBetween(_INetGetSource($url), $first, $end) If @error Then MsgBox(0, '@error', @error)
    1 point
  10. Hello, I wanted to create a personal reddit news tag for internal use and to become better with autoit. I would really appreciate some other eyes on my pretty much search copy code I have found various places in the forums(I know its not clean or pretty, maybe you can help?) What can I/We do to make it more simple and maybe faster, any help? Also I'm having a problem deleting lines that pretty much will become dynamic after each change log The code #include <INet.au3> #include <String.au3> ;File Delete FileDelete("c:\test.txt") sleep(100) ;Get News feed exploded by php script $version =_INetGetSource("http://wazer.dk/rod/csgo_version_changelog.php") ;Get csgo version number from API $csversion =_INetGetSource("http://wazer.dk/rod/csgo_version.php") $csversion = StringRegExpReplace($csversion,"^(\r\n)+|(\r\n)+$","") ; Remove blank lines at start or end of data ;Read Changelog Date between 'for' AND '</a>' $aArray1 = _StringBetween($version, 'for', '</a>') ;Read Changelog LINK between "'<a href="' AND '">' $aArray2 = _StringBetween($version, '<a href="', '">') ;Generate First Line with all the above variables $first = ("Counter-Strike: Global Offensive update v." & $csversion & $aArray1[0] & @CRLF & @CRLF & "Via [CS:GO Blog:](" & $aArray2[0] & ")" & @CRLF & @CRLF) ;Generate File 1st line FileWrite("c:\test.txt", $first) ;Search and Add different reddit tags(like bbcode) $aSearch = StringSplit("[", ",", 2) $aReplace = StringSplit("**[** ", ",", 2) $sStr = $version For $i = 0 To Ubound($aSearch) -1 $sStr = StringReplace($sStr, $aSearch[$i], $aReplace[$i]) $bSearch = StringSplit("]", ",", 2) $bReplace = StringSplit(" **]** ", ",", 2) For $i = 0 To Ubound($bSearch) -1 $sStr = StringReplace($sStr, $bSearch[$i], $bReplace[$i]) $cSearch = StringSplit("&#8211;", ",", 2) $cReplace = StringSplit("* ", ",", 2) For $i = 0 To Ubound($cSearch) -1 $sStr = StringReplace($sStr, $cSearch[$i], $cReplace[$i]) next next next ;Clean up code output for different charecters, spaces and what not! $sStr = StringRegExpReplace($sStr,"\n( |\t)+",@LF) ; Remove whitespace at the start of lines $sStr = StringRegExpReplace($sStr,"(?s)<[^>]*?>",@CRLF) ; Remove < and > and all the text in between $sStr = StringRegExpReplace($sStr,"(\r\n)+",@CRLF) ; Remove blank lines in data $sStr = StringRegExpReplace($sStr,"^(\r\n)+|(\r\n)+$","") ; Remove blank lines at start or end of data ;Check console if its OK consolewrite($sStr) ;Generete Final output. FileWrite("c:\test.txt", $sStr) Todays output if we take the current changelog for CSGO news feed if we run the script as it is now. Counter-Strike: Global Offensive update v.13506 10/8/2015 Via [CS:GO Blog:](http://blog.counter-strike.net/index.php/2015/10/12739/) Release Notes for 10/8/2015 8 Oct 2015 - **[** GAMEPLAY **]** * Adjusted player flashbang reaction animation so the raised arm matches first-person blindness. **[** MISC **]** * Players will no longer get the default weapon in a loadout slot when the game server loses connection to the GC. * Bots no longer get stuck in a crab-walk after a rare failure during crouch-jump. **[** MAPS **]** Cobblestone * Fixed some areas where players could look through model backfacesNow i would like to get line 6 and 8 totally deleted/whipped out. Release Notes for 10/8/20158 Oct 2015 - But the thing is they will change when a new changelog comes out. So what can I do there? Kindly regards.
    1 point
  11. Jos

    C++/Autoit code conversion

    Happy to share the knowledge i have on this. All you need to do is: Create a program which can be ran on the target host as a service and will be able to shell your commands.Create an RPC call to the target host which will transfer this program and create a service under which it will run.Create a cleanup process for this service and program after you are done.Ensure the whole setup is safe and not creating a backdoor vulnerability. .. or simply use the binaries available you know will work and you simply have to do an Run() or ShellExecute() for, which is my advice to you. Good luck with your endeavor. Jos
    1 point
  12. Is there a reason this example needs administrator right? Why not HKCU instead of HKLM?
    1 point
  13. 1 point
  14. Jon

    More Win10 issues

    I really wouldn't disable UAC. It's not just an admin/nag thing it also turns off file and registry virtualization which some older apps might be relying on. Under Windows 10 it also prevents universal/modern apps from running. On Windows 8 this wasn't a problem because the modern apps were the toy versions. But in Win 10 there are loads of them that are now modern apps. Calc, paint, etc. Half of them won't run with UAC off. I'd also strongly recommend that you enable UAC on any development machine. It saves getting caught out when you write scripts/code and they work fine until you test them on a default UAC-enabled machine. I heard that changing the EnableLUA (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System) policy in the registry was the only way to completely disable UAC on Win8+ - apparently the slider doesn't completely do it. But I've not explored that because I have UAC enabled on all my workstations. All that said, I recall you had loads of unusual win10 problems in another topic and it could just be a bad upgrade. I've got a Nividia enabled win10 games machine and that updates the drivers/profiles quite happily with none of the startup problems you mention.
    1 point
  15. It was pretty simple once I got it working. Hopefully the Antivirus Vendors do their jobs now. ;-) I just checked my email and I have many replys from the AV Vendors. They all say that the files are clean. So it looks like it worked well. Thanks! This will come in handy for sure.
    1 point
  16. Nice. Curious; has it done any good? That is, do the AV vendors actually pay attention to submissions? I'm not familiar with that sort of thing.
    1 point
×
×
  • Create New...