Leaderboard
Popular Content
Showing content with the highest reputation on 09/29/2011 in all areas
-
LAST VERSION - 3.8 03-Jul-12 This library contains the WinAPI functions are not included for unknown reasons to the native AutoIt WinAPI library. I use this UDF in nearly all of my programs, and decided to share it with the AutoIt community. I agree that over time some of these functions will be part of the native AutoIt library, but still... The library includes some undocumented, but useful functions (eg _WinAPI_GetFontResourceInfo()). The library also contains all the necessary constants to work with the appropriate functions. Most functions from this UDF intended for experienced users, but beginners will find the same lot of useful information for yourself. I will be to periodically add new functions to the library. The archive contains WinAPIEx library, and as usual an excellent examples from me. Some examples I took from this forum and to simplify them for better understanding. For those who use SciTE (full version) I have prepared the au3.userudfs.properties and au3.user.calltips.api files to highlight functions from this UDF in your scripts. Just copy this files to ...SciTEProperties and ...SciTEAPI, respectively. I hope this UDF will be useful for many as for me. I look forward to any feedback and suggestions. Maybe somebody wants to add new WinAPI functions? Credits Available functions Files to download WinAPIEx UDF v3.8 for AutoIt 3.3.6.1 Previous downloads: 27953 WinAPIEx UDF v3.8 for AutoIt 3.3.8.x Previous downloads: 148501 point
-
Hello everyone! I know there are many programs (including freeware) for this purpose, but the best ones are paid (very expensive), only give you 5 minutes section... I thought about: Why not in AutoIt? So I did! Is not full, there is still a few things to be done, but it is quite functional! What already does: 1 - Remote Viewing (of course) 2 - Control by mouse, clicks, 2 clicks, scrolling (MouseWheel) 3 - Control by keyboard, now is complete! 4 - Supports all languages, currently English and Portuguese 5 - ChatBox conversation 6 - Save the current image into file 7 - Two types of compression: LZMA (level 2) and LZNT native 8 - Show remote cursor (Yes, you can use!) 9 - Capture only the window that is active (very fast, recommended!) What left to do: 1 - Save the section on avi movie (in progress) 2 - Send and receive files in a simple gui 3 - Drag & Drop files and folders to remote computer (in progress) 4 - Need more? Here are some sample images: Update (02/10/2011 - 11:57) Download: DVI-Remote_(RedirectLink).html 2.09k (Previous downloads: 817) I have tested on: Product: VMware® Workstation Version: 7.1.0 build-261024 Network Adapter: Bridged (Connected directly to the physical network) and: Two real PCs (in different networks) Credits: ProgAndy: Keyboard and Mouse functions. Yashied: WinAPIEx.au3, NotifyBox.au3 trancexx: _LZNTCompress.au3 Ward: LZMA Compression Machine Code UDF Free Software João Carlos.1 point
-
Hello all you beautiful AutoIt scripting gurus - LOL. I really need some help here because I have not used AutoIt before, but that is definitely going to change because it has come so far and its functionality trumps that of vbs and kixtart I feel. Anyway, here is a script that I found and it works absolutely fantastic, however, I need just a tad little tweak to tell it to check if the current screen resolution is higher than 1280 x 1064, if it is, then exit, but if the screen resolution is lower than 1280 x 1064, then run the script. Here is the code that works great that needs to be modified and thank you all in advance, I really do appreciate you: ========================================================================================================== ; Define screen resolution $Width = 1280 $Height = 1064 $BitsPerPixel = 32 $RefreshRate = 60 ; Define and set resolution _ChangeScreenRes(1024,768,32,60) Func _ChangeScreenRes($i_Width = @DesktopWidth, $i_Height = @DesktopHeight, $i_BitsPP = @DesktopDepth, $i_RefreshRate = @DesktopRefresh) Local Const $DM_PELSWIDTH = 0x00080000 Local Const $DM_PELSHEIGHT = 0x00100000 Local Const $DM_BITSPERPEL = 0x00040000 Local Const $DM_DISPLAYFREQUENCY = 0x00400000 Local Const $CDS_TEST = 0x00000002 Local Const $CDS_UPDATEREGISTRY = 0x00000001 Local Const $DISP_CHANGE_RESTART = 1 Local Const $DISP_CHANGE_SUCCESSFUL = 0 Local Const $HWND_BROADCAST = 0xffff Local Const $WM_DISPLAYCHANGE = 0x007E If $i_Width > "" Or $i_Height > "" Then Exit ElseIf $i_Width = "" Or $i_Width = -1 Then $i_Width = @DesktopWidth ; default to current setting EndIf ElseIf $i_Height = "" Or $i_Height = -1 Then $i_Height = @DesktopHeight ; default to current setting EndIf ElseIf $i_BitsPP = "" Or $i_BitsPP = -1 Then $i_BitsPP = @DesktopDepth ; default to current setting Endif ElseIf $i_RefreshRate = "" Or $i_RefreshRate = -1 Then $i_RefreshRate = @DesktopRefresh ; default to current setting EndIf Local $DEVMODE = DllStructCreate("byte[32];int[10];byte[32];int[6]") Local $B = DllCall("user32.dll", "int", "EnumDisplaySettings", "ptr", 0, "long", 0, "ptr", DllStructGetPtr($DEVMODE)) If @error Then $B = 0 SetError(1) Return $B Else $B = $B[0] EndIf If $B <> 0 Then DllStructSetData($DEVMODE, 2, BitOR($DM_PELSWIDTH, $DM_PELSHEIGHT, $DM_BITSPERPEL, $DM_DISPLAYFREQUENCY), 5) DllStructSetData($DEVMODE, 4, $i_Width, 2) DllStructSetData($DEVMODE, 4, $i_Height, 3) DllStructSetData($DEVMODE, 4, $i_BitsPP, 1) DllStructSetData($DEVMODE, 4, $i_RefreshRate, 5) $B = DllCall("user32.dll", "int", "ChangeDisplaySettings", "ptr", DllStructGetPtr($DEVMODE), "int", $CDS_TEST) If @error Then $B = -1 Else $B = $B[0] EndIf Select Case $B = $DISP_CHANGE_RESTART $DEVMODE = "" Return 2 Case $B = $DISP_CHANGE_SUCCESSFUL DllCall("user32.dll", "int", "ChangeDisplaySettings", "ptr", DllStructGetPtr($DEVMODE), "int", $CDS_UPDATEREGISTRY) DllCall("user32.dll", "int", "SendMessage", "hwnd", $HWND_BROADCAST, "int", $WM_DISPLAYCHANGE, _ "int", $i_BitsPP, "int", $i_Height * 2 ^ 16 + $i_Width) $DEVMODE = "" Return 1 Case Else $DEVMODE = "" SetError(1) Return $B EndSelect EndIf EndFunc ;==> _ChangeScreenRes1 point
-
AutoSam, No help at all - I have absolutely no idea what the URL is supposed to look like from that! Can you just give me a couple of examples? As to the exclusion problem, you can do this: Global $aArray[3] = [ _ "http://designenvy.aiga.org/solar-bikini-andrew-schneider/", _ "http://designenvy.aiga.org/about/solar-bikini-andrew-schneider/", _ "http://designenvy.aiga.org/?order/solar-bikini-andrew-schneider/"] For $i = 0 To 2 $iRet = StringRegExp($aArray[$i], "(about\/|contact\/|faq\/|popular\/|tutorials\/|\?order\/|search\/)") If $iRet Then ConsoleWrite("URL " & $aArray[$i] & " is Wrong" & @CRLF) Else ConsoleWrite("URL " & $aArray[$i] & " is OK" & @CRLF) EndIf Next Note the use of the "|" to act as an "OR" operator. M231 point
-
Well I found that chrome windows did not receive focus when I activated them, as in I could get the window to show, but keystrokes were not received by chrome. So I get the position of the chrome window then try to click the window in a safe place to give it focus. $winpo becomes an array where $winpo[0] is the x cord of the chrome window, [1]y, [2]width, [3]height. However y or $winpo[1] was not the top cord, lets just say I do not understand that. I did not want to click all the browsers, so I added a click yes or no element to the browserlist[x][1] array. Then when the chrome browser is found the program knows to click it because 2 is chrome in the browserlist[2][0] and browserlist[2][1] is set to 1. I didn't set the other [x][1] elements to anything because I want them to be zero and when Autoit made the array it set all the elements to NULL or "", which is a empty string and mathematically zero here in Autoit. Oh god, I hope that makes sence. here is where I set the array, and where I check if I should click the window. It is just a stripped down version of the code earlier, useful only for this example. $browserlist[0][0]= "[CLASS:MozillaWindowClass]"; use 'autoit window info' tool to aquire these values from each browser $browserlist[1][0]= "[CLASS:IEFrame]" $browserlist[2][0]= "[CLASS:Chrome_WidgetWin_0]" $browserlist[2][1]= 1; set to 1 to tell lines below to click this browse type if $browserlist[$i][1]= 1 Then; click window to focus $winpo= WinGetPos($browserlist[$i][0]) mouseclick("left", $winpo[0]+10, $winpo[1]+10, 1, 0) endif; end if click to target window1 point
-
russell, You really need to learn about arrays and loops! Take a look at this and see if you can follow: #include <GUIConstants.au3> ; Set the HotKeys HotKeySet("1", "rest1") HotKeySet("2", "rest2") HotKeySet("3", "rest3") HotKeySet("4", "rest4") HotKeySet("5", "rest5") HotKeySet("6", "rest6") HotKeySet("7", "rest7") ; Create some arrays to hold the variables Global $aLabel[7], $aTime[7], $aLoop[7] ; Set the timer variables $iStart_Mins = 60 ; in mins $iRenew = 59 $iCheck_Time = TimerInit() ; This is used to change the time every second $hGUI = GUICreate("Tray Warming Timer", 1000, 800, 0, 0) ; Loop For $i = 0 To 6 ; Create the labels, storing their controlIDs in the array $aLabel[$i] = GUICtrlCreateLabel($iStart_Mins & ":00", 1, 8 + (110 * $i), 950, 152) GUICtrlSetFont(-1, 80, 400, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x00FF00) ; And set the time delay in another array $aTime[$i] = $iStart_Mins * 60 Next GUISetState() ; Set the top timer to 10 secs for testing <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $aTime[0] = 10 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch ; Every second, run this section If TimerDiff($iCheck_Time) > 1000 Then ; Reset the timer to run this section $iCheck_Time = TimerInit() ; Loop through the arrays For $i = 0 To 6 ; Remove a sec from the timer $aTime[$i] -= 1 ; If the timer is below 0 If $aTime[$i] < 0 Then ; Set the label to "Tray" in RED GUICtrlSetData($aLabel[$i], "Tray") GUICtrlSetColor($aLabel[$i], 0xFF0000) Else ; If not then set the label to the time remaining ; Note the use of StringFormat to get a leading 0 if required $iNew_Min = StringFormat("%02i", Floor($aTime[$i] / 60)) $iNew_Sec = StringFormat("%02i", Mod($aTime[$i], 60)) GUICtrlSetData($aLabel[$i], $iNew_Min & ":" & $iNew_Sec) EndIf Next EndIf WEnd Func rest1() ; Reset the timer to the full value $aTime[0] = $iStart_Mins * 60 $aLoop[0] = 1 ;null marker EndFunc ;==>rest1 Func rest2() $aTime[1] = $iStart_Mins * 60 $aLoop[1] = 1 ;null marker EndFunc ;==>rest2 Func rest3() $aTime[2] = $iStart_Mins * 60 $aLoop[2] = 1 ;null marker EndFunc ;==>rest3 Func rest4() $aTime[3] = $iStart_Mins * 60 $aLoop[3] = 1 ;null marker EndFunc ;==>rest4 Func rest5() $aTime[4] = $iStart_Mins * 60 $aLoop[4] = 1 ;null marker EndFunc ;==>rest5 Func rest6() $aTime[5] = $iStart_Mins * 60 $aLoop[5] = 1 ;null marker EndFunc ;==>rest6 Func rest7() $aTime[6] = $iStart_Mins * 60 $aLoop[6] = 1 ;null marker EndFunc ;==>rest7 The <<<<<<<<<<< line is just for testing so you do not have to wait an hour for the colour to change! If you have any questions on anything in the script, please ask. M231 point
-
1 point
-
Hi! The reason I have not already done that is; 1. People seldom have much trouble with such hooks. 2. Getting the names of those hooks is trickier... They reside in multiple files... I feel a slight urge to look into this again though... ...but it will not happen in a flash... PM me to keep me on my toes. /Manko1 point
-
Variable scopes - Test script
Unsigned reacted to AdmiralAlkex for a topic
Also don't use Dim. Use Local or Global so you know where things are.1 point -
Try this $sSrc = "whatever method you are using to get the page source" $aSRE = StringRegExp($sSrc, "(?i)id=\x22apppanel_123192_canvas.+src=\x22(http:.+?)\x22", 1) If NOT @Error Then MsgBox(4096, "Result", $aSRE[0]) EndIf1 point