Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/27/2019 in all areas

  1. Jos

    Registry (let start!).

    Could me my (lack off) sense of humor, but I find it pretty annoying having seen somebody posting BS for 40+ post now aboth making portable applications and messing with the registry and than producing the above code. Anybody that really wanted to be taken seriously would have done effort to produce something that would generate trust and trigger others to participate. Jos
    3 points
  2. seems like a blind person that doesn't want to learn braille.
    2 points
  3. Jos

    Scite and UDF support

    Maybe something should be added here: https://www.autoitscript.com/wiki/Adding_UDFs_to_AutoIt_and_SciTE ?
    2 points
  4. Jos

    Registry (let start!).

    This is the page in the SciTE helpfile that descibes the setup: https://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/SciTE4AutoIt3-UserCallTips.html Jos
    1 point
  5. Jos

    Registry (let start!).

    Have you added the directory path to your SciteUser.properties? Something like this is required where the latter part needs to contain the fully qualified path to your private includes: openpath.$(au3)=$(SciteDefaultHome)\..\include;C:\Program Files (x86)\AutoIt3\Include_prive Jos
    1 point
  6. Werty

    Registry (let start!).

    Look at this! said the blind to the deaf.
    1 point
  7. Werty

    Registry (let start!).

    Because he's funny ? *gets more popcorn...*
    1 point
  8. Jos

    Registry (let start!).

    When this is your actual current "best" code then I would urge you to spent time and do learn the language basics or else please stop bugging use with these posts trying to lure us in coding it for you. I am sorry, but you have not shown any interest in learning, and actually stated as such in the first post, so why should we even bother reading these posts? Jos
    1 point
  9. Hehe I asked this to you because the answer seems easy and obvious... but it is not ... and also because I had to fight a little to find it. There are certainly other ways but I like this one #Include <Array.au3> $txt = "Encounter Info: NL some different data HOSPITAL " & @crlf & _ "Encounter Info: NL still some different data HOSPITAL " & @crlf & _ "Other line: NL more different data " & @crlf & _ "Other line: NL more different data HOSPITAL " & @crlf & _ "Encounter Info: NL more different data HOSPITAL " & @crlf & _ "Encounter Info: NL different data here " & @crlf & _ "Encounter Info: NL HOSPITAL and something more, keep this ! " & @crlf & _ "Encounter Info: NL and different data HOSPITAL " & @crlf & _ "Encounter Info: NL HOSPITAL " & @crlf & _ "Encounter Info: NL and more different data here " ;$res = StringRegExp($txt, '(?m)^Encounter Info:.*(?<!HOSPITAL)\s*$', 3) ; case 1, fire lines ending with HOSPITAL + anything else ;$res = StringRegExp($txt, '(?m)^Encounter Info:(?|.*HOSPITAL(*SKIP)(*F)|.*)$', 3) ; case 2, fire lines ending with HOSPITAL + "0 or more white spaces" only $res = StringRegExp($txt, '(?m)^Encounter Info:(?|.*HOSPITAL\h*$(*SKIP)(*F)|.*$)', 3) _ArrayDisplay($res)
    1 point
  10. Rename the computer with this: ;================================================================================================== ; Sets computer name without restart (but restart is required for name to be in effect) ; Author: JScript - Snippet Version No. = 1.0 ; Snippet was Created Using AutoIt Version = 3.3.8.1, Creation Date = 28/05/12. ;================================================================================================== Func _SetComputerName($sCmpName) Local $sLogonKey = "HKLMSOFTWAREMicrosoftWindows NTCurrentVersionWinlogon" Local $sCtrlKey = "HKLMSYSTEMCurrentControlSet" Local $aRet ; RagsRevenge -> http://www.autoitscript.com/forum/index.php?showtopic=54091&view=findpost&p=821901 If StringRegExp($sCmpName, '|/|:|*|?|"|<|>|.|,|~|!|@|#|$|%|^|&|(|)|;|{|}|_|=|+|[|]|x60' & "|'", 0) = 1 Then Return 0 ; 5 = ComputerNamePhysicalDnsHostname $aRet = DllCall("Kernel32.dll", "BOOL", "SetComputerNameEx", "int", 5, "str", $sCmpName) If $aRet[0] = 0 Then Return SetError(1, 0, 0) RegWrite($sCtrlKey & "ControlComputernameActiveComputername", "ComputerName", "REG_SZ", $sCmpName) RegWrite($sCtrlKey & "ControlComputernameComputername", "ComputerName", "REG_SZ", $sCmpName) RegWrite($sCtrlKey & "ServicesTcpipParameters", "Hostname", "REG_SZ", $sCmpName) RegWrite($sCtrlKey & "ServicesTcpipParameters", "NV Hostname", "REG_SZ", $sCmpName) RegWrite($sLogonKey, "AltDefaultDomainName", "REG_SZ", $sCmpName) RegWrite($sLogonKey, "DefaultDomainName", "REG_SZ", $sCmpName) RegWrite("HKEY_USERS.DefaultSoftwareMicrosoftWindows MediaWMSDKGeneral", "Computername", "REG_SZ", $sCmpName) ; Set Global Environment Variable RegWrite($sCtrlKey & "ControlSession ManagerEnvironment", "Computername", "REG_SZ", $sCmpName) ; http://msdn.microsoft.com/en-us/library/ms686206%28VS.85%29.aspx $aRet = DllCall("Kernel32.dll", "BOOL", "SetEnvironmentVariable", "str", "Computername", "str", $sCmpName) If $aRet[0] = 0 Then Return SetError(2, 0, 0) ; http://msdn.microsoft.com/en-us/library/ms644952%28VS.85%29.aspx $iRet2 = DllCall("user32.dll", "lresult", "SendMessageTimeoutW", "hwnd", 0xffff, "dword", 0x001A, "ptr", 0, _ "wstr", "Environment", "dword", 0x0002, "dword", 5000, "dword_ptr*", 0) If $iRet2[0] = 0 Then Return SetError(2, 0, 0) Return 1 EndFunc ;==>_SetComputerName
    1 point
  11. @xcaliber13 This should fit your needs: '(?m)^Encounter Info:.*(?<!HOSPITAL)$' Basically, the pattern means: (?m): Modifier. ^ and $ anchors match start and end of line; ^: start of the line; Encounter Info: literally that string, case sensitive; .*: every character, from 0 to unlimited; (?<!HOSPITAL): negative lookbehind. It asserts that the line doesn't have HOSPITAL (case sensitive) at the end of the line; $: end of the line.
    1 point
  12. Jos

    Registry (let start!).

    That's how we all started. That is the wrong attitude to get this project going .... Either have the urge to learn or simply don't bother.
    1 point
  13. Subz

    Scite and UDF support

    The one I mentioned is the latest version of AutoIt, here are the full steps: Click: Tools > Scite Config Click: Other Tools Tab Click: Run User CallTip Manager Browse to your personal include folder Select the UDF from the drop down list If you have included headers for your functions select "Header Mode" otherwise select "Direct Mode" (Just uses the parameters) Click: Parse button Click: Add or Skip to add the call tips Close and restart Scite
    1 point
  14. Subz

    Scite and UDF support

    You will need to create your own udf and then use the following in the Full Scite Tools > Scite Config > Run User Call Tip Manager
    1 point
  15. it's possible, yes. will I write it for you? not so much. you want to create an app that sits in the tray and waits for your click. start with searching the forums for that. also, read the help file that comes with AutoIt and start to play with the samples of the functions you will need to do your task. I hope you put together some code to post here for more help.
    1 point
  16. Jos

    laptop battery

    Anything to promote that site she claimed to bought something for but actually are spamming for ..... but that's now gone.
    1 point
  17. TheXman

    FileCopy

    The short answer is because it would be the wrong macro. A longer answer is because @HomePath resolves to the same location as the %HOMEPATH% environment variable. So unless your script/exe is in the %HOMEPATH% folder, using that macro is WRONG. If you would have spent a little more time in the Help file as others have suggested, you may have come across another macro named @ScriptDir which, as it is named, refers to the folder in which the script/exe is running.
    1 point
  18. Sidley

    FileCopy

    Why not use DirCopy? @ScriptDir will refer to the directory the script is called from.
    1 point
  19. Your IniRead is wrong for one of the parameters. $user = IniRead ("read.ini", "uid ", "uid", "default") ; This should be like this $user = IniRead ("read.ini", "uid ", "User ID", "default") If that doesn't work, remove the space in the key for User ID and rewrite the IniRead above. Let us know if that worked.
    1 point
  20. DixkG, Example 3 on the GUICtrlCreateDate page of the Help file shows how to use GUICtrlSendMsg to send a $DTM_SETFORMATW style to a date control - that allows you to use whatever format you wish for the display, like this: #include <DateTimeConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() GUICreate("My GUI get date", 200, 200, 800, 200) Local $idDate = GUICtrlCreateDate("", 10, 10, 185, 20) ; to select a specific default format Local $sStyle = "HH:mm" ; Just display hours and minutes <<<<<<<<<<<<<<<<<<<<<<<<<<<< GUICtrlSendMsg($idDate, $DTM_SETFORMATW, 0, $sStyle) GUISetState(@SW_SHOW) ; Loop until the user exits. While GUIGetMsg() <> $GUI_EVENT_CLOSE WEnd MsgBox($MB_SYSTEMMODAL, "Time", GUICtrlRead($idDate)) EndFunc ;==>Example M23
    1 point
  21. Try this: ;Coded by UEZ 2013 -> This program requires AutoIt version 3.3.9.21 or higher! #include <GDIPlus.au3> #include <Memory.au3> _GDIPlus_Startup() Global $sFile = StringReplace(@AutoItExe, "autoit3.exe", "Examples\GUI\msoobe.jpg") Global $hImage = _GDIPlus_ImageLoadFromFile($sFile) Global $hBitmap = _GDIPlus_ImageResize($hImage, 10, 7) Global $bImage = _GDIPlus_StreamImage2BinaryString($hBitmap) ConsoleWrite("Error: " & @error & @LF) ConsoleWrite(BinaryLen($bImage) & @CRLF) MsgBox(0, "Binary", $bImage) _GDIPlus_ImageDispose($hImage) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_Shutdown() Func _GDIPlus_StreamImage2BinaryString($hBitmap, $sFormat = "JPG", $iQuality = 80, $bSave = False, $sFilename = @ScriptDir & "\Converted.jpg") ;coded by UEZ 2013 build 2014-01-25 (based on the code by Andreik) Local $sImgCLSID, $tGUID, $tParams, $tData Switch $sFormat Case "JPG" $sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat) $tGUID = _WinAPI_GUIDFromString($sImgCLSID) $tData = DllStructCreate("int Quality") DllStructSetData($tData, "Quality", $iQuality) ;quality 0-100 Local $pData = DllStructGetPtr($tData) $tParams = _GDIPlus_ParamInit(1) _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) Case "PNG", "BMP", "GIF", "TIF" $sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat) $tGUID = _WinAPI_GUIDFromString($sImgCLSID) Case Else Return SetError(1, 0, 0) EndSwitch Local $hStream = _WinAPI_CreateStreamOnHGlobal() ;http://msdn.microsoft.com/en-us/library/ms864401.aspx If @error Then Return SetError(2, 0, 0) _GDIPlus_ImageSaveToStream($hBitmap, $hStream, DllStructGetPtr($tGUID), DllStructGetPtr($tParams)) If @error Then Return SetError(3, 0, 0) Local $hMemory = _WinAPI_GetHGlobalFromStream($hStream) ;http://msdn.microsoft.com/en-us/library/aa911736.aspx If @error Then Return SetError(4, 0, 0) Local $iMemSize = _MemGlobalSize($hMemory) If Not $iMemSize Then Return SetError(5, 0, 0) Local $pMem = _MemGlobalLock($hMemory) $tData = DllStructCreate("byte[" & $iMemSize & "]", $pMem) Local $bData = DllStructGetData($tData, 1) _WinAPI_ReleaseStream($hStream) ;http://msdn.microsoft.com/en-us/library/windows/desktop/ms221473(v=vs.85).aspx _MemGlobalFree($hMemory) If $bSave Then Local $hFile = FileOpen($sFilename, 18) If @error Then Return SetError(6, 0, $bData) FileWrite($hFile, $bData) FileClose($hFile) EndIf Return $bData EndFunc ;==>_GDIPlus_StreamImage2BinaryString It will return a binary string which can be saved.
    1 point
×
×
  • Create New...