Leaderboard
Popular Content
Showing content with the highest reputation on 04/28/2016 in all areas
-
Sers, while working on another project I was in need of desktop notifications. I wanted an own implementation and from time to time the code grew and I thought about sharing it with the world. I know that there is a similar UDF out there but when my project got bigger an UDF was the best choice for me. As you can see the UDF's differ in usage and style of notifications. So, what do we have? The UDF offers the usage of permanent desktop notifications for your own script in a very easy way. Notifications are starting in the bottom right corner of your main screen and will be shown on top until there is no more space. Further notifications will be shown if previous ones are closed. The notifications have a nice minimalistic design in two colors. By default they match the look of the dark taskbar in Windows 10, but colors and other things can be set differently if wished (see example scripts). The UDF works for GUIOnEventMode activated and deactivated and detects it automatically. Show me! Each notification has its GUI, a title, the message, a seperating line, date label, time label and a closing button (and if activated, a border around the notification). The color of the title, message, seperating line, date, time and closing button (+ border if activated) have all the text color. Right now notifications have a fixed size. I thought about variable sizes but did not add it because I didn't need it so far. Some people may notice the shorter seperating line when border is activated, thats just because of better looks Notifications will be colored as the following: Windows 10: they match the design of the taskbar Windows 8/8.1: On most designs: they match the border color of active windows, else they are black with transparency (see screenshot) Windows 7 and earlier: black with transparency (sry aero) How do I use notifications in my script? include UDF call _Notifications_Startup() (after you determined if you want to use GUIOnEventMode or not) If GUIOneventMode deactivated: call _Notifications_CheckGUIMsg($__GUIMsg) in your main loop create a notification using _Notifications_Create($__title, $__message) Between step 2 and 3 you can set various options: _Notifications_SetAnimationTime _Notifications_SetBorder _Notifications_SetButtonText _Notifications_SetBkColor _Notifications_SetColor _Notifications_SetDateFormat _Notifications_SetSound _Notifications_SetTextAlign _Notifications_SetTimeFormat _Notifications_SetTransparency You can also set own functions to be called when notifications are clicked (see advanced example). And now? You can find more information in the UDF. There also are two example scripts to show the usage for GUIOnEventMode activated and deactivated. Another advanced example shows the usage of the Set-Functions. Thats it? Yup, have fun. Changelog Notifications.au3 ( v1.2) Notifications GUIMsg Example.au3 Notifications OnEvent Example.au3 Notifications Advanced Example.au32 points
-
hi guy how is possible reduce a timing of scanning ip ?? example i have a lan, i want scan for find open port 3356 , start 192.168.1.1 to 192.168.1.255 , how is possible reduce a probing time ?? of TCPConnect ??1 point
-
Can't get _excel_bookattach to work anymore
handofthrawn reacted to water for a topic
Glad it is again working now and that the problem was not caused by the Excel UDF (bug or whatever).1 point -
Give one of these a try. Use one or the other depending on the bit-ness of your script. #AutoIt3Wrapper_Run_After=""%ProgramFiles(x86)%\Windows Kits\8.0\bin\x64\signtool.exe" sign /t http://timestamp.comodoca.com/rfc3161 /a "%out%"" #AutoIt3Wrapper_Run_After=""%ProgramFiles(x86)%\Windows Kits\8.0\bin\x64\signtool.exe" sign /t http://timestamp.comodoca.com/rfc3161 /a "%outx64%"" Adam1 point
-
SetBitMap($TransparentButtonTest, $hImageButton, 192) will set the dragable image semi transparent.1 point
-
I bought the mug several years ago (arround ten I think). In this time, I remember there was a link on the forum for it (I think this one : http://www.cafepress.com/autoit )1 point
-
@Synapsee : using FileRead with the whole file, the script will crash with a big file. Instead, use _Crypt_HashFile, because it reads the file and hash the data gradually.1 point
-
1 point
-
1 point
-
Hi Synapsee There is no error message, but I have no sound and i can not exit. I have tried script and compiled version under Win 8.11 point
-
The problem is that the nircmdc.exe set al the audio volume for all autoit scripts. If u use Bass.dll for your project it will work a lot better. When I started this script all my scripts didn't work properly anymore, but by exmanine your script I realized that the command niccmdc take over every au3 script audio. I will check your script again (with the mouse wheel) and come back on it. EDIT: I've try'd it again but the same issue, program won't react and no sound (even with mousewheel) But now I didn't get the sound back and needed a system recovery to get it work again. For now I won't test it again until you get rid of nircmdc.1 point
-
#include <Array.au3> #include <MsgBoxConstants.au3> #include <FileConstants.au3> Global Const $CP_SHIFT_JIS = 932 Func _CodepageStructToString($tText, $iCodepage) Local $aResult = DllCall("kernel32.dll", "int", "MultiByteToWideChar", "uint", $iCodepage, "dword", 0, "struct*", $tText, "int", DllStructGetSize($tText), _ "ptr", 0, "int", 0) Local $tWstr = DllStructCreate("wchar[" & $aResult[0] & "]") $aResult = DllCall("Kernel32.dll", "int", "MultiByteToWideChar", "uint", $iCodepage, "dword", 0, "struct*", $tText, "int", DllStructGetSize($tText), _ "struct*", $tWstr, "int", $aResult[0]) Return DllStructGetData($tWstr, 1) EndFunc Func _ArrayAddColumns(ByRef $aArr, $iNumColToAdd = 1) If IsArray($aArr) = 0 Then Return SetError(1, 0, -1) ; Filter out non-array If $iNumColToAdd < 1 Then Return SetError(2, 0, -1) ; $iNumColToAdd must be greater than zero to add a column. If UBound($aArr, 0) > 2 Then Return SetError(3, 0, -1) ; Only allows a 1d or 2d array pass this line. If UBound($aArr, 0) = 1 Then ; ====== For 1d array ======== Local $aRet[UBound($aArr)][$iNumColToAdd + 1] ; Create new 2d array. For $r = 0 To UBound($aArr) - 1 $aRet[$r][0] = $aArr[$r] Next Else ; ======= For 2d array ============ Local $aRet = $aArr ; So that ByRef $aArr is not altered outside of function. ReDim $aRet[UBound($aRet)][UBound($aRet, 2) + $iNumColToAdd] ; ReDim 2d array only. EndIf Return $aRet EndFunc ;==>_ArrayAddColumns $text1 = "[1F010005300020FF]82CD0A[030005300020FF]8177[1F12010000E6300020FF]8178[1F030000300020FF]82F00A8A6F82A682DC82B582BD" $text2 = "[09020000390011300020FF]82BB82A482CB81428DC58CE382CC90B897EC82C60A8C5F96F182B782E9914F82C90C[1F090200003A0011300020FF]90D882E897A382B582BD82A082C682CC90A28A4582C982C282A282C40A92B282D782C482A882A282BD95FB82AA82A282A282ED82CB" $text3 = "814581458145[090200003B0011300020FF]82B182EA82CD8145814581450A88C8914F82E682E88C8382B582AD82C882C182C482A282C882A282A98148" ;v1 without @CRLF $file = "test without crlf.txt" $text = $text1 & $text2 & $text3 MainFunc($text, $file) ;v2 with @CRLF $file = "test with crlf.txt" MainFunc($text1, $file) FileWrite ($file, @CRLF) FileClose ($file) MainFunc($text2 , $file) FileWrite ($file, @CRLF) FileClose ($file) MainFunc($text3, $file) FileWrite ($file, @CRLF) FileClose ($file) Func MainFunc($text, $file) $split = StringSplit($text,"[]") $Str = "" $fill = "" $split = _ArrayAddColumns($split) ;_ArrayDisplay($split) if StringInStr($text, "[") = 1 Then $y = 3 Else $y = 1 EndIf For $i = $y-1 To Ubound($split) - 1 $split[$i][1] = "[" & $split[$i][0] & "]" $i=$i+1 $split[$i][1] = Binary("0x" & $split[$i][0]) ;msgbox(0,"Output",$split[$i][1]) Local $tInp = DllStructCreate("byte[" & BinaryLen($split[$i][1]) & "]") DllStructSetData($tInp, 1, $split[$i][1]) Local $Str = _CodepageStructToString($tInp, $CP_SHIFT_JIS) $Str = StringRegExpReplace($Str ,@CRLF,"<cf>") $Str = StringRegExpReplace($Str ,@LF,"<lf>") $Str = StringRegExpReplace($Str ,@CR,"<cr>") $split[$i][1] = $Str Next ;_ArrayDisplay($split) $fill = "" For $i = 1 to Ubound($split) - 1 $fill = $fill & "" & $split[$i][1] Next ;msgbox(0,"Output",$fill) FileWrite ($file, $fill) FileClose ($file) EndFunc1 point
-
I think you should take a look here: https://www.autoitscript.com/wiki/User_Defined_Functions#Hardware1 point
-
; You can use your own COMErrorHandler instead internal ADO.au3 UDF COMError Handler - _ADO_COMErrorHandler _ADO_ComErrorHandler_UserFunction(_ErrFunc) MsgBox(0, 'Last COM Error description:', _ErrDescription()) Func _ErrFunc($oError) ConsoleWrite( _ @ScriptName & " (" & $oError.scriptline & ") : ==> COM Error intercepted !" & _ "$oError.description is: " & @TAB & $oError.description & @CRLF & _ "$oError.windescription: " & @TAB & $oError.windescription & @CRLF & _ "$oError.number is: " & @TAB & Hex($oError.number, 8) & @CRLF & _ "$oError.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _ "$oError.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _ "$oError.source is : " & @TAB & $oError.source & @CRLF & _ "$oError.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _ "$oError.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF _ ) _ErrDescription($oError.description) ; store description to use it outsided UDF in your own function EndFunc ;==>_ErrFunc Func _ErrDescription($sDescription = Default) Local Static $sDescription_static = '' If $sDescription <> Default Then $sDescription_static = $sDescription Return $sDescription_static EndFunc EDIT: Welcome to the fourm @Vitorio.1 point
-
One is a string of bytes and the other a handle?1 point
-
Or #include <Excel.au3> Global $oExcel = _Excel_Open() Global $oWorkbook = _Excel_BookOpen($oExcel, "C:\Users\TEaston\Desktop\Abacus List.xls")1 point
-
Use Shellexcecute instead run, Saludos1 point
-
Made a udf to rysiora's webcam example, Webcam.au3 (the udf) #include <WindowsConstants.au3> #include-once $WM_CAP_START = 0x400 $WM_CAP_UNICODE_START = $WM_CAP_START +100 $WM_CAP_PAL_SAVEA = $WM_CAP_START + 81 $WM_CAP_PAL_SAVEW = $WM_CAP_UNICODE_START + 81 $WM_CAP_UNICODE_END = $WM_CAP_PAL_SAVEW $WM_CAP_ABORT = $WM_CAP_START + 69 $WM_CAP_DLG_VIDEOCOMPRESSION = $WM_CAP_START + 46 $WM_CAP_DLG_VIDEODISPLAY = $WM_CAP_START + 43 $WM_CAP_DLG_VIDEOFORMAT = $WM_CAP_START + 41 $WM_CAP_DLG_VIDEOSOURCE = $WM_CAP_START + 42 $WM_CAP_DRIVER_CONNECT = $WM_CAP_START + 10 $WM_CAP_DRIVER_DISCONNECT = $WM_CAP_START + 11 $WM_CAP_DRIVER_GET_CAPS = $WM_CAP_START + 14 $WM_CAP_DRIVER_GET_NAMEA = $WM_CAP_START + 12 $WM_CAP_DRIVER_GET_NAMEW = $WM_CAP_UNICODE_START + 12 $WM_CAP_DRIVER_GET_VERSIONA = $WM_CAP_START + 13 $WM_CAP_DRIVER_GET_VERSIONW = $WM_CAP_UNICODE_START + 13 $WM_CAP_EDIT_COPY = $WM_CAP_START + 30 $WM_CAP_END = $WM_CAP_UNICODE_END $WM_CAP_FILE_ALLOCATE = $WM_CAP_START + 22 $WM_CAP_FILE_GET_CAPTURE_FILEA = $WM_CAP_START + 21 $WM_CAP_FILE_GET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 21 $WM_CAP_FILE_SAVEASA = $WM_CAP_START + 23 $WM_CAP_FILE_SAVEASW = $WM_CAP_UNICODE_START + 23 $WM_CAP_FILE_SAVEDIBA = $WM_CAP_START + 25 $WM_CAP_FILE_SAVEDIBW = $WM_CAP_UNICODE_START + 25 $WM_CAP_FILE_SET_CAPTURE_FILEA = $WM_CAP_START + 20 $WM_CAP_FILE_SET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 20 $WM_CAP_FILE_SET_INFOCHUNK = $WM_CAP_START + 24 $WM_CAP_GET_AUDIOFORMAT = $WM_CAP_START + 36 $WM_CAP_GET_CAPSTREAMPTR = $WM_CAP_START + 1 $WM_CAP_GET_MCI_DEVICEA = $WM_CAP_START + 67 $WM_CAP_GET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 67 $WM_CAP_GET_SEQUENCE_SETUP = $WM_CAP_START + 65 $WM_CAP_GET_STATUS = $WM_CAP_START + 54 $WM_CAP_GET_USER_DATA = $WM_CAP_START + 8 $WM_CAP_GET_VIDEOFORMAT = $WM_CAP_START + 44 $WM_CAP_GRAB_FRAME = $WM_CAP_START + 60 $WM_CAP_GRAB_FRAME_NOSTOP = $WM_CAP_START + 61 $WM_CAP_PAL_AUTOCREATE = $WM_CAP_START + 83 $WM_CAP_PAL_MANUALCREATE = $WM_CAP_START + 84 $WM_CAP_PAL_OPENA = $WM_CAP_START + 80 $WM_CAP_PAL_OPENW = $WM_CAP_UNICODE_START + 80 $WM_CAP_PAL_PASTE = $WM_CAP_START + 82 $WM_CAP_SEQUENCE = $WM_CAP_START + 62 $WM_CAP_SEQUENCE_NOFILE = $WM_CAP_START + 63 $WM_CAP_SET_AUDIOFORMAT = $WM_CAP_START + 35 $WM_CAP_SET_CALLBACK_CAPCONTROL = $WM_CAP_START + 85 $WM_CAP_SET_CALLBACK_ERRORA = $WM_CAP_START + 2 $WM_CAP_SET_CALLBACK_ERRORW = $WM_CAP_UNICODE_START + 2 $WM_CAP_SET_CALLBACK_FRAME = $WM_CAP_START + 5 $WM_CAP_SET_CALLBACK_STATUSA = $WM_CAP_START + 3 $WM_CAP_SET_CALLBACK_STATUSW = $WM_CAP_UNICODE_START + 3 $WM_CAP_SET_CALLBACK_VIDEOSTREAM = $WM_CAP_START + 6 $WM_CAP_SET_CALLBACK_WAVESTREAM = $WM_CAP_START + 7 $WM_CAP_SET_CALLBACK_YIELD = $WM_CAP_START + 4 $WM_CAP_SET_MCI_DEVICEA = $WM_CAP_START + 66 $WM_CAP_SET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 66 $WM_CAP_SET_OVERLAY = $WM_CAP_START + 51 $WM_CAP_SET_PREVIEW = $WM_CAP_START + 50 $WM_CAP_SET_PREVIEWRATE = $WM_CAP_START + 52 $WM_CAP_SET_SCALE = $WM_CAP_START + 53 $WM_CAP_SET_SCROLL = $WM_CAP_START + 55 $WM_CAP_SET_SEQUENCE_SETUP = $WM_CAP_START + 64 $WM_CAP_SET_USER_DATA = $WM_CAP_START + 9 $WM_CAP_SET_VIDEOFORMAT = $WM_CAP_START + 45 $WM_CAP_SINGLE_FRAME = $WM_CAP_START + 72 $WM_CAP_SINGLE_FRAME_CLOSE = $WM_CAP_START + 71 $WM_CAP_SINGLE_FRAME_OPEN = $WM_CAP_START + 70 $WM_CAP_STOP = $WM_CAP_START + 68 #include <GUIConstants.au3> $avi = DllOpen("avicap32.dll") $user = DllOpen("user32.dll") ;=============================================================================== ; ; Description: Open's a webcam preview screen in your gui ; Syntax: _WebcamOpen($sHwnd, $sLeft, $sTop, $sWidth, $sHeight, $sPort=0) ; Parameter(s): $sHwnd - The handle of the gui ; $sLeft - Left coord. of the preview screen ; $sTop - Top coord. of the preview screen ; $sWidth - Width of the preview screen ; $sHeight - Height of the preview screen ; $sPort - Specify wich webcam port you want to use (for multiple webcams) ; Requirement(s): A webcam ; Return Value(s): On Success - Returns id needed for other controls ; On Failure - Returns -1 ; Author(s): Ludocus ; Note(s): If a black/blank screen shows up, try using different $sPort's (0 to 3) ; ;=============================================================================== Func _WebcamOpen($sHwnd, $sLeft, $sTop, $sWidth, $sHeight, $sPort=0) $cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,$WS_VISIBLE), "int", $sLeft, "int", $sTop, "int", $sWidth, "int", $sHeight, "hwnd", $sHwnd, "int", 1) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", $sPort, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_SCALE, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_OVERLAY, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEW, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEWRATE, "int", 1, "int", 0) if @error then return -1 return $cap[0] EndFunc ;=============================================================================== ; ; Description: Creates a Snapshot from a webcam ; Syntax: _WebcamSnap($sId, $sFile) ; Parameter(s): $sId - Id (returned from _WebcamOpen) ; $sFile - File to save the snapshot to (*.bmp) ; Requirement(s): A webcam ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; Author(s): Ludocus ; Note(s): None ; ;=============================================================================== Func _WebcamSnap($sId, $sFile) DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_SET_CALLBACK_FRAME, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_GRAB_FRAME_NOSTOP, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_FILE_SAVEDIBA, "int", 0, "str", $sFile) if @error Then return 0 Else return 1 EndIf EndFunc ;=============================================================================== ; ; Description: Closes the preview screen created with _WebcamOpen ; Syntax: _WebcamClose($sId) ; Parameter(s): $sId - Id (returned from _WebcamOpen) ; Requirement(s): A webcam ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; Author(s): Ludocus ; Note(s): None ; ;=============================================================================== Func _WebcamClose($sId) DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_END, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_DRIVER_DISCONNECT, "int", 0, "int", 0) DllClose($user) if @error Then return 0 Else return 1 EndIf EndFunc ;=============================================================================== ; ; Description: Starts recording the webcam to a file ; Syntax: _WebcamRecordStart($sFile, $sId) ; Parameter(s): $sId - Id (returned from _WebcamOpen) ; $sFile - File to save the movie to (*.avi) ; Requirement(s): A webcam ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; Author(s): Ludocus ; Note(s): Stop recording by: _WebcamRecordStop($Id) ; ;=============================================================================== Func _WebcamRecordStart($sFile, $sId) DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_FILE_SET_CAPTURE_FILEA, "int", 0, "str", $sFile) DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_SEQUENCE, "int", 0, "int", 0) if @error Then return 0 Else return 1 EndIf EndFunc ;=============================================================================== ; ; Description: Stops recording. ; Syntax: _WebcamRecordStop($sId) ; Parameter(s): $sId - Id (returned from _WebcamOpen) ; Requirement(s): A webcam ; Return Value(s): On Success - Returns 1 ; On Failure - Returns 0 ; Author(s): Ludocus ; Note(s): None ; ;=============================================================================== Func _WebcamRecordStop($sId) DllCall($user, "int", "SendMessage", "hWnd", $sId, "int", $WM_CAP_STOP, "int", 0, "int", 0) if @error Then return 0 Else return 1 EndIf EndFunc thnx to rysiora with his great example!1 point
-
Run(@comspec & ' /c start ' & $file, '', @SW_HIDE)1 point