Leaderboard
Popular Content
Showing content with the highest reputation on 06/22/2014 in all areas
-
SDL UDF
JScript reacted to AdmiralAlkex for a topic
Ladies, gentlemens, nerds or whatever you are, I present to you, my SDL UDF! Q. So what is this then? A. It is a "wrapper" for the SDL.dll and some "help libraries" to make it easier to use in AutoIt. Q. WTF is SDL? A. As their webpage says: "Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer." Q. Can it really do all that? A. No. I have implemented many functions, but not all. I will update it on my own discretion. Q. So what does WORK? A. See the table below. Q. So how do I use it? A1. Read README.TXT in the archive. A2. There is a few examples in the download, study them. A3. Find any example or documentation for another language and translate it (shouldn't be to hard). Q. So where's the download? A. Next post.1 point -
The bumper thread of missing winapi examples.
argumentum reacted to JohnOne for a topic
As I look through _WinAPI_* entries in the help file there are many without examples. It's quite a task for any one person to undertake, so I propose anyone who can be bothered every now and then, figure one out and post an example here. I'd suggest not using the help forum as that defeats the object. I'll go first with an easy one from near the top. EDIT: (regarding guinness' below post) If you wish your example to be considered for help file entry, please follow his instructions. If you don't care then don't worry, just the example will do however you like. EDIT2: The links below are to the examples, not the online help. EDIT3: If anyone wants to modify any examples to be help file worthy you are most welcome to. _WinAPI_ArrayToStruct _WinAPI_AbortPath >_WinAPI_AdjustWindowRectEx >_WinAPI_GetDefaultUserProfileDirectory >_WinAPI_DeleteFile >_WinAPI_GetAsyncKeyState >_WinAPI_GetCurrentDirectory >_WinAPI_GetDefaultPrinter >_WinAPI_GetDeviceCaps >_WinAPI_GetDriveType >_WinAPI_GetErrorMessage >_WinAPI_GetFileType >_WinAPI_GetGraphicsMode >_WinAPI_GetGuiResources >_WinAPI_GetPEType >_WinAPI_GetPolyFillMode >_WinAPI_GetPriorityClass >_WinAPI_GetProcessHandleCount >_WinAPI_GetProcessIoCounters >_WinAPI_GetProfilesDirectory >_WinAPI_GetROP2 >_WinAPI_GetStartupInfo >_WinAPI_GetStdHandle >_WinAPI_GetSystemDEPPolicy >_WinAPI_GetSystemInfo >_WinAPI_GetSystemMetrics >_WinAPI_GetSystemTimes >_WinAPI_GetSystemWow64Directory >_WinAPI_GetTempFileName >_WinAPI_GetVersionEx >_WinAPI_GetWindowDC >_WinAPI_GetWindowFileName >_WinAPI_GetWindowHeight >_WinAPI_GetWindowWidth >_WinAPI_GlobalMemoryStatus >_WinAPI_HiByte >_WinAPI_InflateRect >_WinAPI_IsChild >_WinAPI_IsClassName >_WinAPI_IsElevated >_WinAPI_LoByte >_WinAPI_OpenProcess1 point -
6/3/2014: re-Uploaded a new SciTE4AutoIt3.exe installer with an updated SciTE v3.4.1 release. These are the major changes: - 6/3 Fixed several regressions. - Fixes for reported bugs in Au3Stripper. - Many other minor fixes. Enjoy, Jos Addition/Changes/Fixes in the current installer: -------------------------------------------------------------------------------------------------- 6/3/2014 *** Updated AutoIt3Wrapper 2.2.0.3 (Jos) - Reverted the changes made for Environment variables translation due to a regression when using the GUI. *** Updated Tidy v2.4.1.6 (Jos) - Fixes regression when Delim=0 in some occasions adding a extra "(" character. *** Updated Syntax files to latest production version (Jos) *** Updated several small Helpfile issues. *** Included the proper latest version of the totally re-written AutoItIndentFix.lua. -------------------------------------------------------------------------------------------------- 5/31/2014 *** Updated our version of SciTE v 3.4.1 by Neil Hodgson. (Jos) - Fixed hardcrash in case a very long error line is displayed without spaces. *** Totally re-written the logic used in AutoItIndentFix.lua to better handle Auto Indent corrections. *** Updated AutoIt3Wrapper 2.2.0.2 (Jos) - Added to option to add Environment variables to #AutoIt3Wrapper directives. *** Updated SciTEConfig v1.6.11.13 - Fixed issue with Save+Apply asking again to update the settings. (Jos) - Fixed issue with 3 Checkboxes causing a flicker of the Status field. (Jos) - Fixed issue in UCTManager. (Melba23) *** Updated Tidy v2.4.1.5 (Jos) - Several minor spacing fixes with new syntax variations. - Changed the logic to restore the Folds, Bookmarks, initial line displayed and caret position to make it work on multiple instances of SciTE and better restore the original layout. - Fixed bug when using more than 200 include files. - Fixed writing Indent characters in Commentblocks for empty lines. - Fixed writing ending CRLF in case End_With_NewLine=0 when in commentblock or on commentline. *** Updated Au3Stripper v1.2.1.0 (Jos) - Fixed lexing issue which was in some occasions stripping variables while being used. - Fixed issue when /MO is specified to ensure no other option is performed crippling the output script. - Fixed bug when using more than 200 include files. *** Updated SciTEJump to the latest version v2.18.103.243 (guinness) -------------------------------------------------------------------------------------------------- ==> ScitillaHistory page containing all SciTE/Scintilla updates. ==> Visit the SciTE4AutoIt3 Download page for the latest versions ==> Check the newly formatted online documentation for an overview of all extras you get with this installer.1 point
-
Compact a string to a certain number of characters left and right. #include <MsgBoxConstants.au3> MsgBox($MB_SYSTEMMODAL, '', _StringCompact(@ScriptFullPath, 15) & @CRLF) MsgBox($MB_SYSTEMMODAL, '', _StringCompact('This will display 15 characters left and right in a string.', 15) & @CRLF) ; #FUNCTION# ==================================================================================================================== ; Name ..........: _StringCompact ; Description ...: Compact a string to a certain number of characters left and right. ; Syntax ........: _StringCompact($sString[, $iChrsLeftAndRight = Default]) ; Parameters ....: $sString - A string to compact. Multi-lines aren't supported. ; $iChrsLeftAndRight - [optional] An integer value. Default is 0, original string. ; Return values .: Compacted string. ; Author ........: guinness. Idea by AZJIO. ; Example .......: Yes ; =============================================================================================================================== Func _StringCompact($sString, $iChrsLeftAndRight = Default) $iChrsLeftAndRight = Int($iChrsLeftAndRight) If StringLen($sString) > ($iChrsLeftAndRight * 2) Then $sString = StringRegExpReplace($sString, '(^.{' & $iChrsLeftAndRight & '}).*(.{' & $iChrsLeftAndRight & '})$', '$1...$2') EndIf Return $sString EndFunc ;==>_StringCompact#include <MsgBoxConstants.au3> MsgBox($MB_SYSTEMMODAL, '', _StringCompact(@ScriptFullPath, 15) & @CRLF) MsgBox($MB_SYSTEMMODAL, '', _StringCompact('This will display 15 characters left and right in a string.', 15) & @CRLF) ; #FUNCTION# ==================================================================================================================== ; Name ..........: _StringCompact ; Description ...: Compact a string to a certain number of characters left and right. ; Syntax ........: _StringCompact($sString[, $iChrsLeftAndRight = Default]) ; Parameters ....: $sString - A string to compact. Multi-lines are supported. ; $iChrsLeftAndRight - [optional] An integer value. Default is 0, original string. ; Return values .: Compacted string. ; Author ........: guinness. ; Example .......: Yes ; =============================================================================================================================== Func _StringCompact($sString, $iChrsLeftAndRight = Default) $iChrsLeftAndRight = Int($iChrsLeftAndRight) Local $sStringCompact = $sString If StringLen($sString) > ($iChrsLeftAndRight * 2) Then $sStringCompact = StringLeft($sString, $iChrsLeftAndRight) & '...' & StringRight($sString, $iChrsLeftAndRight) EndIf Return $sStringCompact EndFunc ;==>_StringCompact1 point
-
I created this to work with the constants of AnimateWindow and to animate the whole window and not just the client area. Please test and provide constructive feedback. #include <APISysConstants.au3> Example() Func Example() Local $hGUI = GUICreate('', 300, 200, @DesktopWidth - 320, @DesktopHeight - 270) _AnimateWindow($hGUI, $AW_HOR_NEGATIVE, 3) Sleep(1000) _AnimateWindow($hGUI, BitOR($AW_HOR_POSITIVE, $AW_HIDE), 2) EndFunc ;==>Example #cs $AW_ACTIVATE $AW_HIDE $AW_HOR_NEGATIVE $AW_HOR_POSITIVE $AW_VER_NEGATIVE $AW_VER_POSITIVE #ce Func _AnimateWindow($hWnd, $iFlags, $iSpeed = Default) Local $aWinGetPos = WinGetPos($hWnd) If Not @error Then Local Enum $WINGETPOS_XPOS, $WINGETPOS_YPOS, $WINGETPOS_WIDTH, $WINGETPOS_HEIGHT Local $iXAfter = $aWinGetPos[$WINGETPOS_XPOS], $iXBefore = $aWinGetPos[$WINGETPOS_XPOS], $iYAfter = $aWinGetPos[$WINGETPOS_YPOS], $iYBefore = $aWinGetPos[$WINGETPOS_YPOS] Local $fIsHide = BitAND($AW_HIDE, $iFlags) = $AW_HIDE If BitAND($AW_VER_POSITIVE, $iFlags) Then $iYAfter += $aWinGetPos[$WINGETPOS_HEIGHT] ElseIf BitAND($AW_VER_NEGATIVE, $iFlags) Then $iYBefore += $aWinGetPos[$WINGETPOS_HEIGHT] ElseIf BitAND($AW_HOR_POSITIVE, $iFlags) Then $iXAfter += $aWinGetPos[$WINGETPOS_WIDTH] ElseIf BitAND($AW_HOR_NEGATIVE, $iFlags) Then $iXBefore += $aWinGetPos[$WINGETPOS_WIDTH] EndIf If $iXBefore <> $iXAfter Or $iYBefore <> $iYAfter Then WinMove($hWnd, '', $iXBefore, $iYBefore, $aWinGetPos[$WINGETPOS_WIDTH], $aWinGetPos[$WINGETPOS_HEIGHT]) EndIf If Not $fIsHide Then GUISetState(((BitAND($AW_ACTIVATE, $iFlags) = $AW_ACTIVATE) ? @SW_SHOW : @SW_SHOWNOACTIVATE), $hWnd) EndIf If $iSpeed = Default Then $iSpeed = 5 WinMove($hWnd, '', $iXAfter, $iYAfter, $aWinGetPos[$WINGETPOS_WIDTH], $aWinGetPos[$WINGETPOS_HEIGHT], $iSpeed) If $fIsHide Then GUISetState(@SW_HIDE, $hWnd) EndIf EndIf EndFunc ;==>_AnimateWindow1 point
-
_WinAPI_GetCurrentDirectory #include <WinAPIFiles.au3> ConsoleWrite(_WinAPI_GetCurrentDirectory() & @LF) _WinAPI_GetDefaultPrinter #include <WinAPISys.au3> ConsoleWrite(_WinAPI_GetDefaultPrinter ( ) & @LF) Yes, I'm picking all the easy ones1 point
-
Sometimes you have a control label and a string (filepath) that you want to display, but it's just too long for that label. This is when such a function could be used.1 point
-
GUI events are being skipped in main loop
czardas reacted to AdmiralAlkex for a topic
Don't be hard on yourself! I don't think I've seen anyone use that trick on this forum. Yet you have to wonder, with so many clever people around... Why it isn't seen occasionally. It's such a small yet effective change. I just wanted to say that you are not alone1 point -
SndVol2000
jaberwacky reacted to AdmiralAlkex for a topic
No, not randomly. Open a dozen+ media players and see what I mean. If you stop growing at @DesktopWidth then the user can scroll to the many that doesn't fit the screen, which would be more comfortable than moving the window around to see the rest.1 point -
Complete script noob needs help
Palestinian reacted to JohnOne for a topic
Indeed there is. It's missing.1 point -
Multiple number input from user
InunoTaishou reacted to ghost11996 for a topic
Hi InunoTaishou GUICtrlCreateInput return Success value is the controlID of the control input If you want to read the values in the GUICtrlCreateInput, You need to use a function call GUICtrlRead : https://www.autoitscript.com/autoit3/docs/functions/GUICtrlRead.htm $InputValue1 = GUICtrlRead($inpFirst) $InputValue2 = GUICtrlRead($inpSecond) $InputValue3 = GUICtrlRead($inpThird) $InputValue4 = GUICtrlRead($inpFourth)1 point -
Of course there is the simple pedestrian way: use a For..Next loop with a single index used to read $Partial1DArray1, $Partial1DArray2 and write $Monster2DArray elements. #include <Array.au3> Local $Array1 = ["Chris","Brian","Daniel","Stephen","William", "Joseph", "Diana", "Thomas", "Jason", "Carol"] Local $Array2 = [3, 4, 2, 6, 7, 1, 9, 10, 5, 8] If UBound($Array1) <> UBound($Array2) Then MsgBox(0, "", "Big mistake") Else Local $Array[UBound($Array1)][2] For $i = 0 To UBound($Array1) - 1 $Array[$i][0] = $Array1[$i] $Array[$i][1] = $Array2[$i] Next ; optionally free both partial arrays $Array1 = 0 $Array2 = 0 _ArraySort($Array) _ArrayDisplay($Array, "Sorted in Alphabetical Order") EndIf1 point
-
Like UEZ said, like this: #include <Array.au3> Local $Array1 = [ _ ["Chris", 3], _ ["Brian", 4], _ ["Daniel", 2], _ ["Stephen", 6], _ ["William", 7], _ ["Joseph", 1], _ ["Diana", 9], _ ["Thomas", 10], _ ["Jason", 5], _ ["Carol", 8] _ ] _ArraySort($Array1) _ArrayDisplay($Array1, "Sorted in Alphabetical Order")1 point
-
Use a 2d array instead of 2x 1d arrays. Br, UEZ1 point
-
FYI for anyone else having similar issues ... I have found that since upgrading to v3.3.12.0, none of my scripts that include sqlite will compile anymore, although they run perfectly from within SciTE. Since I almost always use the /striponly option for Obfuscator, __SQLite_ConsoleWrite was being reported as an unknown function. Adding __SQLite_ConsoleWrite to line #2 of SQLite.au3 fixes the problem. #ignorefunc __SQLite_Inline_Version, __SQLite_Inline_Modified, __SQLite_ConsoleWrite1 point
-
Autoit DllCall and GhostScript issue
vipergts450 reacted to Danyfirex for a topic
Edit 1. I was Wrong. maybe if you try the C code. then can make it in autoit. Edit 2: $dResult = DllCall($hDll, "int", "gsapi_init_with_args", "ptr", $hInst, "int", UBound($aDllArgs), "str*", $aDllArgs) last dllcall argument should be a pointer to structure $p_varList. look: $dResult = DllCall($hDll, "int", "gsapi_init_with_args", "ptr", $hInst,"int",UBound($aDllArgs), "ptr", $p_varList) Saludos Edit 3 Your structure of pointers is wrong. Try something like this: Local $aDllArgs[9] = ["gswin32c", _ "-sDEVICE=pdfwrite", _ "-dNOPAUSE", _ "-dBATCH", _ "-dSAFER", _ "-dFirstPage=" & $aParseArgs[3], _ "-dLastPage=" & $aParseArgs[4], _ "-sOutputFile=""" & $sDestName & """", _ """" & $sPDFPath & """"] $varList = DllStructCreate("ptr[" & UBound($aDllArgs) & "]") $p_varList = DllStructGetPtr($varList) Local $tData[UBound($aDllArgs)] for $i= 1 to UBound($aDllArgs) $tData[$i-1]=DllStructCreate("char[" & StringLen($aDllArgs[$i-1])+1 & "]") DllStructSetData($varList,1,DllStructGetPtr($tData[$i-1]),$i) ;Debug Pointers ConsoleWrite(DllStructGetData($varList,1,$i) & @CRLF) DllStructSetData($tData[$i-1],1,$aDllArgs[$i-1]) next ;Debug Strings for $i=1 to UBound($aDllArgs) ConsoleWrite(DllStructGetData(DllStructCreate("char[" & StringLen($aDllArgs[$i-1])+1 & "]",DllStructGetData($varList,1,$i)),1) & @CRLF) Next Saludos1 point -
Me too, but we can encrypt the password For that purpose i have AutoItScript Add Debugger.1 point