Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/25/2019 in Posts

  1. I think that you should consider having functions that create the task object and have users use functions to edit the task object's properties before finally registering it... Maybe something like this: ;"Create the task" Local $oTask = _Task_Create() ;"Schedule the task for once every day at 5pm" _Task_ScheduleDaily($oTask, 17) ;"Run asap if missed" _Task_RunIfMissed($oTask, True) ;"Register the task" _Task_Register($oTask) Edit: I suggest this to avoid having a HUGE param list like in Allow2010's... though he did a really nice job, his function is just ugly
    2 points
  2. The Microsoft Windows Task Scheduler offers a lot of features. The two existing UDFs are a bit "complex" to use and miss help files and examples for each function. Based on a discussion on the german forum we would like to create a new UDF based on the existing "template" UDFs. Which functions do you miss in the existing UDFs? Should there be more examples? Should there be a help file? Should there be a wiki entry explaining the concepts? Which functions should be made easier to use? What else? Basic conditions Only Task Scheduler 2.0 will be supported (>= Windows Vista, Windows Server 2008). The UDF will use COM; neither AT.exe nor SCHTASKS.exe will be used. It will support as many of the objects and parameters as sensible. The UDF should be useable for everyone (beginners and experts) to suit their needs. Completed functions (fully documented including examples) - last changed: 2019-12-03 Planned functions (functions we are working on) - last changed: 2019-10-25 Suggested functions (we need to discuss if they schould be implemented) - last changed: 2025-01-25 Postponed functions (we will discuss this functions when the need arises) - last changed: 2019-09-30
    1 point
  3. AoRaToS

    s!mpL3 LAN Messenger

    s!mpL3 LAN Messenger as the name suggests is a messenger designed and developed to offer chat communication over Local Area Networks while being as simple to use as possible. This project started way back in 2008 with only basic functionality and is regularly updated with new features in order to make it more useful and user friendly. What I wanted was a simple, small, serverless program that would work without installation cause that was the ideal combination for my workplace back then, so I ended up with this! I have attached some images from various versions: Check the rest below! (from various versions) More than 10.000 downloads! s!mpL3 LAN Messenger version 2.9.9.1 - [04/07/2019] - s!mpL3 LAN Messenger.zip 1. Fixed an issue that would occur when blocking another user and they would re-appear in the TreeView. 2. Updated File Transfers to make long file names shorter if they were too long to appear in the tray tip. 3. Removed notifications when checking for updates at application startup if there is no update available. You can view/download the full change log here: ChangeLog.txt Tested and working on both 32bit and 64 bit editions of Windows XP, Windows Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10. Things you need to know before trying it: 1. Start the program, select one or more connections from what's available and click Connect (If a firewall notice comes up, click 'Allow' or 'Add Exception') When someone else on your network does the same, they will appear in your Tree-view and you will appear in theirs, double click their name and chat! 2. s!mpL3 LAN Messenger does not require a server to be running, it's standalone. 3. On the first run an .ini file is created at @LocalAppDataDir\s!mpL3 LAN Messenger which stores the settings so that they are used every time you run the application. If you delete the .ini file it will be created again (with default settings at program startup or with your selected settings if you press Save from the Preferences window). 4. All communication is encrypted using AES so it's quite secure against Network sniffers. 5. You can send files and folders by dragging and dropping them in a conversation window. Folders are compressed before being sent. You can also drop multiple items to be sent. 6. There is a "Hide" button located in the tray right click context menu that will hide all open windows. You can assign a Hotkey combination from Preferences. The default combination is Ctrl+H. 7. s!mpL3 LAN Messenger uses port 60000 by default. You can change the port used by adding "Port=****" (without quotes, stars represent numbers) to the Config file described above. Communication is UDP. 8. There is an Updater feature you can use to always have the latest available version, you only need an internet connection for that to work. You might need to clear your Internet Explorer Temporary Files in order for it to find an updated version. 9. You can Hide + Lock s!mpL3 LAN Messenger so it'll require a password in order to "Appear". To enable this, go to the Security Preferences. 10. Note that versions after 2.9.8.1 are not compatible with previous versions due to the encryption used being changed. I recommend using the latest version, or at least use the same version over the LAN. Important Notice: I will not be releasing the source code, however, I might share some parts of code if requested... If you choose to de-compile this software, don't release the source code.
    1 point
  4. *Note: I am putting this here because I couldn't find any recent walk-through posts on the topic and didn't want to revive an old thread. #cs Notice: This script is coded in a way that most enperienced coders will scoff at... But it is a valid starting point for anyone to get an idea of how to achieve the end result. This is a walk-though on creating a simple and effective invisible update process for your software. There are many ways to do this. This is as simplified as it comes to achieve the desired end result. ---- Your srcipt will check the version number of your local target exe file and it will check version.txt on your server. [if] version.txt is higher than your local exe version [then] the update file is downloaded, the original file is deleted, and the update file is renamed to the original exe file name. ---- *Note- In my own software builds I tend to run 2 exe's... One is my gui (that contains my update script) and the other is the actual exe that does the real work. This allows me to update my underlying program code without the user needing to do anything on his side. *You can run 2 copies of this script (names/vars changed) so that you can also version check/update your main gui exe as well. (This will require a little different approach and will not be covered here.) I included message boxes along the way to help you visualize the process - You will want to remove those for a production environment. #ce #include <MsgBoxConstants.au3> #include <IE.au3> #include <INet.au3> #include <WinAPIFiles.au3> ;global vars have to be above all code - Global vars are frowned upon in general, but for this example they do what is needed Global $serverVersionFile = "https://yourdomain.com/version.txt";create a txt file in your webhosting account and only include your software version in it, for example: 2.0.0.0 Global $UpdatePathIs = @ScriptDir & "\update.exe"; This is the local path where you want your update to be downloaded into. Global $serverUpdateExe = "http://yourdomain.com/update.exe"; This is the path to the update.exe file on your server. Global $ToBeReplacedPathIs = @ScriptDir & "\original.exe"; This is the path to your original program that you want to update. Global $doDownload Global $updateFailed Global $retryornot ; ---- These are the two main functions to run GetCurrentSoftwareVersion() doVersionCheck() ;---- Func GetCurrentSoftwareVersion() ; Retrieve the file version of the target/original executable. | Retrieve the version number contained in your version.txt file. Global $localEXEversion = FileGetVersion($ToBeReplacedPathIs) Global $remoteEXEversion = _INetGetSource($serverVersionFile) EndFunc ;==>GetCurrentSoftwareVersion Func doVersionCheck() ;check if local version is lower than server version - if server version higher than local version then push update If $localEXEversion < $remoteEXEversion Then MsgBox(0,"","server version higher - lets update it") Global $doDownload = InetGet($serverUpdateExe, $UpdatePathIs, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND); This goes and downloads our update.exe file (forces a fresh download) ;The 'do' statment below forces the script to wait until the download has completed to continue. Do Sleep(250) Until InetGetInfo($doDownload, $INET_DOWNLOADCOMPLETE) MsgBox(0,"","download completed") DownloadDeleteRename() Else MsgBox(0,"","server version lower than current local verison - no action needed"); we do "lower" so that when you are working on updates locally and testing, your script doesn't force you to update. EndIf EndFunc;doVersionCheck Func DownloadDeleteRename() FileDelete($ToBeReplacedPathIs); this will delete the original exe file FileMove($UpdatePathIs,$ToBeReplacedPathIs,1); this will rename your update.exe to whatver your original exe file name was so that you have replaced the original exe with the updated exe ; lets check to make sure our update was successful - We do this by checking the local and remote file versions again... If the update was successful, then the local exe file and the remote version.txt file will be the same number. GetCurrentSoftwareVersion() MsgBox(0,"",$localEXEversion & $remoteEXEversion) If $localEXEversion = $remoteEXEversion Then ;all is good - the update was successful Global $updateFailed = false; this means the update did not fail ConsoleWrite($updateFailed) Else $retryornot = MsgBox(16 + 5,"Update error detected","Likely cause: Firewall/Antivirus prevented the download. ") ;this tells us what button the user clicked on msgbox... cancel = 2, and retry = 4 Global $updateFailed = true; this means the update failed ConsoleWrite($updateFailed) EndIf ; with the if statement below we are telling the software to simply close if the user rejected our update instead of retrying. If $retryornot = 4 Then GetCurrentSoftwareVersion() doVersionCheck() Else ;close application ;Exit (remove this text and uncomment 'exit' to make the program actually close) EndIf EndFunc;DownloadDeleteRename
    1 point
  5. @Tosyk Tell us what's the end-goal of the script you want to make, and we'll help you out
    1 point
  6. I will add requirements from the posts to thread #1 so we have everthing at a single place.
    1 point
  7. Gianni

    Get Pixel Color from Image

    since the _GDIPlus_BitmapGetPixel() function in new versions of AutoIt has already been included in the <GDIPlus.au3> udf, you have to delete it from your listing, otherwise you have a duplicate function, and all should works as expected.
    1 point
  8. @jaxclain There are for sure many other ways to do whatever you're trying to do, instead of using ImageSearch. What kind of application are you trying to automate?
    1 point
  9. You're looping through the colors array which has 26 elements total... (from 0 to 25), but your loop also tries 26, which doesn't exist I find it's much easier to use the size of the array... like this: ;~ "For each array element (UBound returns 26, and you need 0 to 25, so we subtract 1)" For $i=0 to UBound($array) - 1 ;~ "Your array code" Next
    1 point
  10. and one more, that introduces new and fun edge cases #include <Array.au3> Local $Array[9][10] = [ _ [9], _ ["", 'A'], _ ["B", 1], _ ["", 'B', 2], _ ["C", 1, 2], _ ["", "", ""], _ [""], _ ["D", 1, 2, 3]] local $a[0][ubound($Array , 2)] _ArrayAdd($a , StringRegExpReplace(_ArrayToString($Array) , "\R\|{" & ubound($Array , 2) - 1 & "}" , "")) _ArrayDisplay($a)
    1 point
  11. Here a starting point: #include <AutoItConstants.au3> #include <GUIConstantsEx.au3> Global $hGUI = GUICreate("Test") GUISetState() Global $aPos = WinGetPos($hGUI) SplashTextOn("Title", "Message goes here.", 400, 100, $aPos[0], $aPos[1] + $aPos[3], BitOR($DLG_MOVEABLE, $DLG_TEXTLEFT), "", 24) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE
    1 point
  12. Your "security officer" urgently needs one or more of: brain surgery, basic education, brain software update, getting fired. (S)he shoots hundreds of ammunitions to anything in sight that shows the slightest move, gets sure the thing is dead, then gets close and shouts "You souldn't have moved!" at the dead body. I wouldn't have liked to be a fellow soldier of your "genocide officer". As the lengthy thread already mentionned shows, the culprit is the one who choose an under-par AV (another "security officer" perhaps?), not the employee using AutoIt for the benefit of the company.
    1 point
  13. If you have the correct code, and as everyone's suggestions are "useless", there is no need for this thread to remain open.
    1 point
  14. Sorry, I've overseen that you have used the wrong function. Here the corrected one: $hBmp = _GDIPlus_BitmapCreateFromMemory(InetRead(_ArrayToString($dImg, ""))) ;to load an image from the net in GDI+ format $hBitmap_Scaled = _GDIPlus_ImageResize($hBmp, 150, 222) ; Resizing the image to 150 x 222 pixels $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_Scaled) ; This should convert the GDI+ to a GDI image GUICtrlSendMsg($idPic1, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap) ; Should show pic in pic controle $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap_Scaled) -> $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_Scaled). Example: #include <GDIplus.au3> #include <GUIConstantsEx.au3> #Include <Memory.au3> Opt("MustDeclareVars", 1) _GDIPlus_Startup() Global $hImage = _GDIPlus_BitmapCreateFromMemory(InetRead("https://www.autoitscript.com/forum/cdn/images/logo_autoit_210x72.png")) ;to load an image from the net Global $iWidth = _GDIPlus_ImageGetWidth($hImage) Global $iHeight = _GDIPlus_ImageGetHeight($hImage) Global $hBitmap_Scaled = _GDIPlus_ImageResize($hImage, $iWidth * 2, $iHeight * 2) ; Resizing the image to 150 x 222 pixels Global $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_Scaled) ; This should convert the GDI+ to a GDI image Global $hWnd = GUICreate("Display image from memory by UEZ 2010", 2 * $iWidth, 2 * $iHeight) GUISetBkColor(0x264869) Global $iPic = GUICtrlCreatePic("", 0, 0, 2 * $iWidth, 2 * $iHeight) GUICtrlSendMsg($iPic, 0x0172, $IMAGE_BITMAP, $hBitmap) ; Should show pic in pic control GUISetState(@SW_SHOW) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _WinAPI_DeleteObject($hBitmap) _GDIPlus_ImageDispose($hBitmap_Scaled) _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() GUIDelete($hWnd) Exit EndSwitch WEnd
    1 point
  15. UEZ

    Splash Image?

    You can use GDI+ to simulate the Splash function: #include <WindowsConstants.au3> #include <GDIPlus.au3> Opt("MustDeclareVars", 1) Opt("GUIOnEventMode", 1) Global $hWnd, $hGraphic, $file, $hImage Global $iX, $iY $file = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\AutoIt v3\AutoIt", "InstallDir") & "\Examples\GUI\torus.png" If Not FileExists($file) Then Exit MsgBox(16, "Error", $file & " not found!", 10) _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile($file) $iX = _GDIPlus_ImageGetWidth($hImage) $iY = _GDIPlus_ImageGetHeight($hImage) $hWnd = GUICreate("GDI+: Simple Splash Screen by UEZ", $iX, $iY, -1, -1, $WS_BORDER + $WS_SYSMENU + $WS_POPUP, $WS_EX_TOPMOST) WinSetTrans($hWnd, "", 0) GUISetState() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd) _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 0, 0, $iX, $iY) GUIRegisterMsg(0x000F, "WM_PAINT") ;$WM_PAINT = 0x000F GUIRegisterMsg(0x0014 , "WM_ERASEBKGND") ;WM_ERASEBKGND = 0x0014 GUISetOnEvent(-3, "_Exit") For $i = 0 To 255 Step 2 WinSetTrans($hWnd, "", $i) Sleep(10) Next Sleep(5000) For $i = 255 To 0 Step -2 WinSetTrans($hWnd, "", $i) Sleep(5) Next GUIDelete($hWnd) _Exit() Func _Exit() GUIRegisterMsg(0x000F, "") GUIRegisterMsg(0x0014, "") _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() Exit EndFunc Func WM_PAINT() _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 0, 0, $iX, $iY) Return "GUI_RUNDEFMSG" EndFunc ;==>WM_PAINT Func WM_ERASEBKGND() _GDIPlus_GraphicsDrawImageRect($hGraphic, $hImage, 0, 0, $iX, $iY) Return "GUI_RUNDEFMSG" EndFunc Br, UEZ
    1 point
  16. _IsPressed involves a lot of "included code" for such a simple request. Outshynd pointed out a good way for the OP's specific code since it uses: While $i <= 9999 This sample code should work no matter what expression is driving the loop: HotKeySet("{ESC}", "dummy") While 1 Sleep(100) ToolTip("Looping") If @HotKeyPressed = "{ESC}" Then ExitLoop WEnd Func dummy() EndFunc ;==>dummy
    1 point
×
×
  • Create New...