Jump to content

Leaderboard

Popular Content

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

  1. You are quickly making a less than desirable name for yourself on this forum. There is no need for you to stomp on someone asking a question just because you think it is an easy answer. You have asked more than a few questions during your tenure here that more experienced coders could have been derisive about, but I have as yet seen no one post sniping, childish comments. How about extending other forum members the same courtesy.
    2 points
  2. Moriba

    Android UDF

    Hello, I created this UDF last year for my Orient Myanmar Language System. This UDF can control any Android devices. So used it wisely. ; #CURRENT# ===================================================================================================================== ; _Android_Call ; _Android_CommandExists ; _Android_Connect ; _Android_Dial ; _Android_FileExists ; _Android_Flash ; _Android_ForceStopPackage ; _Android_GetBatteryHealth ; _Android_GetBatteryLevel ; _Android_GetBatteryPlugType ; _Android_GetBatteryStatus ; _Android_GetBatteryTechnology ; _Android_GetBatteryTemperature ; _Android_GetBatteryVoltage ; _Android_GetDeviceID ; _Android_GetExternalStorageDirectory ; _Android_GetLegacyExternalStorageDirectory ; _Android_GetNetworkClass ; _Android_GetNetworkCountryISO ; _Android_GetNetworkOperator ; _Android_GetNetworkOperatorName ; _Android_GetNetworkType ; _Android_GetNetworkTypeName ; _Android_GetPackageInfo ; _Android_GetPhoneType ; _Android_GetProperty ; _Android_GetSerialNumber ; _Android_GetSIMCountryISO ; _Android_GetSIMOperator ; _Android_GetSIMOperatorName ; _Android_GetSIMState ; _Android_GetState ; _Android_HasBusyBox ; _Android_HasRootAccess ; _Android_Install ; _Android_IsAirplaneModeOn ; _Android_IsBatteryCharged ; _Android_IsBatteryLow ; _Android_IsBatteryPresent ; _Android_IsBootloader ; _Android_IsNetworkRoaming ; _Android_IsOffline ; _Android_IsOnline ; _Android_IsScreenOn ; _Android_Pull ; _Android_Push ; _Android_Reboot ; _Android_Remount ; _Android_Send ; _Android_SendSMS ; _Android_Shell ; _Android_StartActivity ; _Android_TakeSnapshot ; _Android_Uninstall ; _Android_WaitForDevice ; _Android_Wake ; _Android_WipeDataCache ; =============================================================================================================================== Download Android UDF (11.22.2014) Download ADB, Fastboot & AAPT Here I will accept whatever your suggestion. Can improve my UDF. I love AutoIt. It's so easy and powerful.
    1 point
  3. Ever wondered of passing on variables or words to other windows well there is a udf ready for it you can easily pass on variables words etc to other windows (non-autoit) and as well as recieve them.Basic functions and examples are provided with the UDF.The function allows two complied scripts to communicate with each other directly. UDF available here : Download Transpond UDF.zip Version updated [Current :2.0.1] ------- [Changelog] --------- * Fixed bugs * Fixed errors in help
    1 point
  4. Summary following this discussion in the GUI H&S forum: this UDF attempts to provide an easy fix for the issue in Windows 10 Snap feature, that wrongly resizes a window when dragged way off-screen. the issue is apparent for non-resizable windows, when the Snap feature is turned OFF. How To Test on a Windows 10 machine (also tested on a VM), disable the Snap feature (right-click the desktop > Display settings > Multitasking). download the UDF and the example into the same folder, and run the example. it will create 4 windows which you can drag around to see how they react (and a MsgBox you can confirm to close the example script): 1. "Default" - drag this over the top of the screen (use the "drag" label) and see that it is being incorrectly resized. 2. "SnapFix" - this window uses the UDF to demonstrate that the issue is resolved. 3. "SnapFix_NoTitleBar" - this window demonstrates that the issue is resolved even for windows without a title bar 4. "SnapFix_PopUp" - this window demonstrates that the $WS_POPUP style alone is NOT WORKING properly! must be combined with $WS_BORDER or $WS_THICKFRAME to work. How To Use first, the UDF needs to be included and initialized. add this at the top of your script: #include <SnapFix.au3> _SnapFix_Init() to enable the UDF for you GUI (multiple GUI's supported, not all your GUI's must be fixed), add this line after creating a GUI: _SnapFix($hGUI)where $hGUI is the GUI handle as returned by GUICreate() The UDF SnapFix.au3 SnapFix_Example.au3 What Next as described above, $WS_POPUP alone is not working. an override is suggested, but perhaps a solution exists. the UDF sets some global conditions: it changes the default GUI resize mode, and registers the window message WM_SIZE, so if your script registers the WM_SIZE message for its own purposes, then in your registered function, you must call the internal UDF function __SnapFix_WM_SIZE(), like this: Func MY_WM_SIZE($hWnd, $iMsg, $wParam, $lParam) __SnapFix_WM_SIZE($hWnd, $iMsg, $wParam, $lParam) ; your original function contents here EndFunc ;==>MY_WM_SIZE the global conditions are not thoroughly tested, so use with caution!
    1 point
  5. Gianni

    Html tag inside Html tag

    i think that that html source has some syntax problems...
    1 point
  6. Gianni

    Html tag inside Html tag

    check if the title of the window of the browser is exactly "WindowTitle"...? try also this variation #include <ie.au3> $oIE = _IEAttach("WindowTitle") ; <- check the window title of your browser $oFrames = _IEFrameGetCollection($oIE) For $oFrm In $oFrames If $oFrm.id = "frConteudo" Then ExitLoop Next If IsObj($oFrm) Then ConsoleWrite("debug: get iframe obj OK" & @CR) Else ConsoleWrite("debug: get iframe obj error" & @CR) EndIf $oObj = _IEGetObjByName($oFrm, "cboTpTRN") If IsObj($oFrm) Then ConsoleWrite("debug: get cboTpTRN obj OK" & @CR) Else ConsoleWrite("debug: get cboTpTRN obj error" & @CR) EndIf
    1 point
  7. Gianni

    Html tag inside Html tag

    try to use _IEGetObjByName() istead of _IEGetObjById() #include <ie.au3> $oIE = _IEAttach("WindowTitle") $oFrm = _IEFrameGetObjByName($oIE, "frConteudo") If IsObj($oFrm) Then ConsoleWrite("debug: get iframe obj OK" & @CR) Else ConsoleWrite("debug: get iframe obj error" & @CR) EndIf $oObj = _IEGetObjByName($oFrm, "cboTpTRN") If IsObj($oObj) Then ConsoleWrite("debug: get cboTpTRN obj OK" & @CR) Else ConsoleWrite("debug: get cboTpTRN obj error" & @CR) EndIf
    1 point
  8. Gianni

    Html tag inside Html tag

    Hi Yuji, In presence of iframe, you have to deal with nested documents, have a look to the _IEFrameGetObjByName() function that allows you to get reference to the nested iframe from the main page. have a look also to this link for an explanation.
    1 point
  9. water

    problems opening Word?

    @error = 1 means: $oAppl is not an object It looks like _Word_Create already returned an error. I suspect there is no MS Word installed on your machine.
    1 point
  10. backwards is fine, it's still the same range (but as singles or range in all my efforts, it sorts and prints them in ascending order)
    1 point
  11. Of course: just replace every occurence of \d+ by 0*[1-9]\d*. I bet more validation belongs to the step where every subrange is validated (e.g. against allowable bounds). Now merging non-disjoint subranges to avoid duplication of output is yet another story: "1-3, 43,2-17, 38-51"
    1 point
  12. or 0,X I think it can be handled by jchd's regexp with minimal adjustment. Since I suck, I would add the additional check as well Local $valid = StringRegExp($sRange , "0\z|0,.*|0-.*") ? FALSE : StringRegExp($sRange, "^(\d+(-\d+)?)(,(?1))*$" )
    1 point
  13. http://sourceforge.net/projects/x3270/ you probably can rebuild in AutoIT In the past with RationalRobot I automated a system like this with some advanced screenscraping Approach (in about 5000 lines of code a very powerfull automation system) sounds clumsy but in the end it worked fully in a very stable way 1. Make sure you can read x and y position of the cursor in the statusbar 2. Make sure you can go with home key or other key to a "known" position on the screen 3. Automate the screen by numbering fields. So first you do home key and you are in field 1, with tab you are in field 2 4. Make sure you have a select all / copy all to clipboard (which you can read in AutoIT in a string) 5. Count fields on a screen by a. get start x and y from status bar. b. sending tab key and count tabs until you are back at starting x and y 6. In Excel we then made just about 50 lines (for each field 1 line) and enduser could type a description column and a value column (internally it was just a field number ref)
    1 point
  14. it took me more about 1200000 milisegundos ;Danyfirex 06/09/2015 #include <Array.au3> #include <WinAPI.au3> Opt("MustDeclareVars", 1) Global Const $DIRECTORY_QUERY = 0x0001 Global Const $DIRECTORY_TRAVERSE = 0x0002 Global Const $sTagUNICODESTRING = "USHORT Length;USHORT MaximumLength;PTR Buffer;" Global Const $sTagOBJECT_ATTRIBUTES = "ULONG Length;HANDLE RootDirectory;PTR ObjectName;ULONG Attributes;PTR SecurityDescriptor;PTR SecurityQualityOfService" Local $aSubObject = 0 Local $aObjects = _GetObjects() _ArrayDisplay($aObjects, "\", Default, Default, Default, "Name|Type|SymLink") If IsArray($aObjects) Then For $i = 0 To UBound($aObjects) - 1 If $aObjects[$i][1] = "Directory" Then $aSubObject = _GetObjects($aObjects[$i][0]) If IsArray($aSubObject) Then _ArrayDisplay($aSubObject, $aObjects[$i][0], Default, Default, Default, "Name|Type|SymLink") EndIf EndIf Next EndIf Func _GetObjects($sSource = "\") If $sSource <> "\" Then $sSource = "\" & $sSource Local $tNameSource = _tName($sSource) Local $tUnicodeString = _RtlInitUnicodeString($tNameSource) Local $pUnicodeString = DllStructGetPtr($tUnicodeString) Local $tObject_Attributes = _InitializeObjectAttributes($pUnicodeString) Local $pObject_Attributes = DllStructGetPtr($tObject_Attributes) Local $hDirectory = _NtOpenDirectoryObject($pObject_Attributes, BitOR($DIRECTORY_TRAVERSE, $DIRECTORY_QUERY)) Local $tData = 0 Local $tName = 0 Local $tType = 0 Local $index = 0 Local $bytes = 0 Local $tBuffer = 0 Local $aArcName[0] Local $taName = 0 Local $tStr = 0 Local $tAttr = 0 Local $hLink = 0 Local $taTarget = 0 Local $tTarget = 0 Local $tSTarget = 0 $tBuffer = DllStructCreate("byte Data[32767]") Local $aRet = DllCall("Ntdll.dll", "LONG", "NtQueryDirectoryObject", "HANDLE", $hDirectory, "ptr", DllStructGetPtr($tBuffer), "ULONG", 32767, "BOOL", False, "BOOL", True, "ULONG*", 0, "ULONG*", 0) If @error Or $aRet[0] < 0 Then Return $index = $aRet[6] $bytes = $aRet[7] ConsoleWrite("!index: " & $index & " $bytes: " & $bytes & @CRLF) For $i = 0 To $index - 1 $tData = DllStructCreate($sTagUNICODESTRING & $sTagUNICODESTRING, DllStructGetPtr($tBuffer) + ($i * 16)) $tName = DllStructCreate("wchar wNameString[" & DllStructGetData($tData, 1) & "]", DllStructGetData($tData, 3)) $tType = DllStructCreate("wChar wTypeString[" & DllStructGetData($tData, 4) & "]", DllStructGetData($tData, 6)) $taName = _tName($tName.wNameString) $tStr = _RtlInitUnicodeString($taName) $tAttr = _InitializeObjectAttributes(DllStructGetPtr($tStr), 0, $hDirectory) $hLink = _NtOpenSymbolicLinkObject(DllStructGetPtr($tAttr), $GENERIC_READ) ConsoleWrite("+$hLink: " & $hLink & @CRLF) $taTarget = _tName("") $tTarget = _RtlInitUnicodeString($taTarget) $tTarget.MaximumLength = 512 _NtQuerySymbolicLinkObject($hLink, $tTarget) $tSTarget = DllStructCreate("wchar wString[" & DllStructGetData($tTarget, 1) & "]", DllStructGetData($tTarget, 3)) ReDim $aArcName[UBound($aArcName) + 1][3] $aArcName[UBound($aArcName) - 1][0] = $tName.wNameString $aArcName[UBound($aArcName) - 1][1] = $tType.wTypeString $aArcName[UBound($aArcName) - 1][2] = (IsDllStruct($tSTarget) = 1) ? $tSTarget.wString : "" ;~ ConsoleWrite(">" & $i + 1 & @TAB & $tName.wNameString & @TAB & $tType.wTypeString & @TAB & $tSTarget.wString & @CRLF) $tType = 0 $tName = 0 $tData = 0 $tSTarget = 0 _WinAPI_CloseHandle($hLink) Next Return $aArcName EndFunc ;==>_GetObjects Func _RtlInitUnicodeString($tSourceString) Local $tUnicodeString = DllStructCreate($sTagUNICODESTRING) DllCall("Ntdll.dll", "NONE", "RtlInitUnicodeString", "struct*", $tUnicodeString, "struct*", $tSourceString) If @error Then SetError(@error, 0, 0) Return $tUnicodeString EndFunc ;==>_RtlInitUnicodeString Func _tName($String) Local $t = DllStructCreate("wchar String[512]") DllStructSetData($t, 1, $String) Return $t EndFunc ;==>_tName Func _InitializeObjectAttributes($pObjectName, $ulAttributes = 0, $hRootDirectory = Null, $pSecurityDescriptor = Null) Local $tObject_Attributes = DllStructCreate($sTagOBJECT_ATTRIBUTES) DllStructSetData($tObject_Attributes, 1, DllStructGetSize($tObject_Attributes)) DllStructSetData($tObject_Attributes, 2, $hRootDirectory) DllStructSetData($tObject_Attributes, 3, $pObjectName) Return $tObject_Attributes EndFunc ;==>_InitializeObjectAttributes Func _NtQuerySymbolicLinkObject($hLinkHandle, $tLinkTarget) Local $aRet = DllCall("Ntdll.dll", "LONG", "NtQuerySymbolicLinkObject", "HANDLE", $hLinkHandle, "struct*", $tLinkTarget, "ULONG*", 0) If @error Then SetError(@error, 0, 0) If $aRet[0] <> 0 Then SetError(1, 0, 0) EndFunc ;==>_NtQuerySymbolicLinkObject Func _NtOpenDirectoryObject($pObjectAttr, $AccessMask) Local $aRet = DllCall("Ntdll.dll", "LONG", "NtOpenDirectoryObject", "HANDLE*", 0, "ULONG", $AccessMask, "PTR", $pObjectAttr) If @error Then SetError(@error, 0, 0) If $aRet[0] < 0 Or $aRet[1] = 0 Then SetError(1, 0, 0) Return $aRet[1] EndFunc ;==>_NtOpenDirectoryObject ;~ Retur hLink Func _NtOpenSymbolicLinkObject($pObjectAttr, $AccessMask) Local $aRet = DllCall("Ntdll.dll", "LONG", "NtOpenSymbolicLinkObject", "HANDLE*", 0, "ULONG", $AccessMask, "PTR", $pObjectAttr) If @error Then Return SetError(@error, 0, 0) If $aRet[0] < 0 Or $aRet[1] = 0 Then Return SetError(1, 0, 0) Return $aRet[1] EndFunc ;==>_NtOpenSymbolicLinkObject Saludos
    1 point
  15. I know it is solved, but like I said, you can also use ProcessWaitClose : While 1 ProcessWaitClose("wmplayer.exe") If RegRead("HKCU\Software\Microsoft\MediaPlayer\Preferences", "HoverTransportsEnabled") = 1 Then RegWrite("HKCU\Software\Microsoft\MediaPlayer\Preferences", "HoverTransportsEnabled", "REG_DWORD", "0") Sleep(100) WEnd
    1 point
  16. OTOH there is a huge advantage with that: a zero-byte program is provably both non malicious and bug-free. Keep positive!
    1 point
  17. LarsJ

    Rubik's Cube

    The picture shows Rubik's Cube in the middle of a rotation, wherein the layer is rotated 90 degrees. New version for AutoIt 3.3.10 The scripts were flawed. Fixed in this update. 08-01-2013: First post In the Cubes menu there are six cubes from 2*2*2 to 7*7*7: Pocket Cube, Rubik's Cube, Rubik's Revenge, Professor's Cube, V-Cube 6 and V-Cube 7. See http://en.wikipedia.org/wiki/Rubik's_Cube. The Scramble menu scrambles the cube. In the input field in the statusbar you can set the number of scramble steps. The Solve menu automatically solves the cube. In this version it just plays back the undo log. The Build menu shows how the cubes are created. It also shows how the rotation of a layer is simulated. The Scramble, Solve and Build menus puts the program into a Scramble, Solve and Build mode. To leave the Scramble and Solve modes click the menu once more. To leave the Build mode uncheck the menu. The program mode or state appears in the statusbar. See the Help menu for more information about the menus. Rotating a layer in the cube Click an edge of the layer with the left mouse button and hold the button downMove the mouse in the direction you want to rotate the layerRelease the left mouse buttonThe rotating layer in the picture has probably been clicked somewhere on the blue edge. You can't rotate a layer in Scramble, Solve and Build modes. The mouse buttons can be switched in the Options. Rotating the entire cube Click in the window with the right mouse button and hold the button downMove the mouse in the direction you want the cube to rotateRelease the right mouse buttonThe description of the mouse rotations can be found in the Help menu. Using the keyboard Use the arrow keys or <A,a>, <W,w>, <S,s>, <Z,z> to rotate the cube. Use <Home> or <H,h> to place the cube in the start position. Use <Page Up> or <I,i> and <Page Down> or <O,o> to zoom in and out. Use Num 1-6 or 1-6 to show the 6 sides of the cube. The program Inspiration for the program is from this site: http://rubiksim.sourceforge.net/. The graphics is generated with old style OpenGL 1.1. Some OpenGL globals and functions are copied from this thread http://www.autoitscript.com/forum/index.php?showtopic=83581 by trancexx. Especially globals and functions for creating an OpenGL window and a rendering context. Zipfile The zipfile contains a number of files: RubiksCube.au3 - GUI and main loop, run this fileMenuFncs.au3 - implements the menu systemMenuWins.au3 - creates menu system windowsKeyboard.au3 - code for shortcut keysOGLconsts.au3 - OpenGL constantsOGLfuncs.au3 - OpenGL functionsCubes.au3 - creates the cubesTurnLayer.au3 - rotate a layerRotateCube.au3 - rotate the cubeScramble.au3 - scramble functionSolveCube.au3 - solve functionsBuild.au3 - build functionsUtilities.au3 - calculations(The files are edited with Notepad++ with a tabwidth of 2. This doesn't match the default settings in Scite.) 21-01-2013: Update #1 Fixed some errors in the Build menu. Added a log to see the colors of all sides at one time. See picture in post #5. RubiksCube3.3.10.7z Testet on XP 32 bit and Win 7 32/64 bit. Previous versions for AutoIt 3.3.8
    1 point
  18. Melba23

    unordered listview

    Phenom, There are BIG differences between a List and a ListView. A List has only one element per line, no headers and cannot be sorted dynamically - all of which a ListView can do. You need to be careful not to mix the two - they are very different beasts. Your List will sort automatically because the default styles for a List include $LBS_SORT - you need to redeclare the styles without it to prevent sorting: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $hGUI = GUICreate("Test", 500, 500) $hLV = GUICtrlCreateList("",10, 10, 400, 450, BitOr($WS_BORDER, $WS_VSCROLL)) For $i = 1 To 20 GUICtrlSetData($hLV, Chr(Random(65, 90, 1))) Next GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndAs to scrolling to the last entry in a ListView, you need to use the GUIListView UDF like this: #include <GUIConstantsEx.au3> #include <GuiListView.au3> $hGUI = GUICreate("Test", 500, 500) $hLV = GUICtrlCreateListView("Header", 10, 10, 400, 250) GUISetState() For $i = 1 To 20 GUICtrlCreateListViewItem(Chr(Random(65, 90, 1)), $hLV) _GUICtrlListView_EnsureVisible($hLV, $i - 1) Sleep(500) ; Just so you can see it happening before your very eyes! Next While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndThere are loads of very interesting functions in the GUIListView UDF, but many of them require you to create the ListView with the UDF functions rather than the built-in commands. However, as you can see here, some work either way. All clear now? M23
    1 point
×
×
  • Create New...