Leaderboard
Popular Content
Showing content with the highest reputation on 11/09/2014 in all areas
-
Look: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #include <GuiListView.au3> #include <GuiImageList.au3> $hGUI = GUICreate("ListView example", 300, 200) $hListView = _GUICtrlListView_Create($hGUI, "Items|SubItems", 10, 10, 280, 150, $LVS_REPORT, $WS_EX_CLIENTEDGE) _GUICtrlListView_SetExtendedListViewStyle($hListView, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT, _ $LVS_EX_SUBITEMIMAGES, $LVS_EX_INFOTIP)) Local $sVar = RegRead('HKEY_CLASSES_ROOT\.avi','') Local $svar2 = RegRead ('HKEY_CLASSES_ROOT\'&$sVar&'\DefaultIcon','') Local $asIcon=StringSplit($svar2,",") $hImage = _GUIImageList_Create(16, 16, 5, 3) _GUIImageList_AddIcon($hImage,StringReplace($asIcon[1],'"',''), Int($asIcon[2])) _GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 131) _GUICtrlListView_SetImageList($hListView, $hImage, 1) _GUICtrlListView_AddItem($hListView, "Test item") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Saludos1 point
-
Obviously the number of lines must be a multiple of 3 To avoid troubles the best way should be to use the integrated ini funcs #include <Array.au3> #include <File.au3> Global $sections = IniReadSectionNames("settings.ini") Global $tArray[$sections[0]][2] For $i = 1 to $sections[0] $tArray[$i-1][0] = IniRead("settings.ini", $sections[$i], "Name", "Default") $tArray[$i-1][1] = IniRead("settings.ini", $sections[$i], "Number", "Default") Next _ArrayDisplay($tArray)1 point
-
Here is a simple solution for CMD piping. ; Example of piping in AutoIt ; define commands to pipe $sCmd1 = "dir " & @SystemDir & "\*.*" ; display all files of system directory $sCmd2 = "find /I "".exe""" ; select all EXE files $sCmd3 = "find /I ""di""" ; select all files with 'di' as substring ; run commands concurrent $iPID1 = Run(@ComSpec & " /C " & $sCmd1, "", @SW_HIDE, 9) ; $STDIN_CHILD(1) + $STDERR_MERGED(8) $iPID2 = Run(@ComSpec & " /C " & $sCmd2, "", @SW_HIDE, 9) ; $STDIN_CHILD(1) + $STDERR_MERGED(8) $iPID3 = Run(@ComSpec & " /C " & $sCmd3, "", @SW_HIDE, 9) ; $STDIN_CHILD(1) + $STDERR_MERGED(8) ; pipe output of first command as input to second command While Sleep(10) $sTmp = StdoutRead($iPID1, False, True) If @error Then ExitLoop StdinWrite($iPID2) StdinWrite($iPID2, $sTmp) WEnd ; pipe output of second command as input to third command While Sleep(10) $sTmp = StdoutRead($iPID2, False, True) If @error Then ExitLoop StdinWrite($iPID3) StdinWrite($iPID3, $sTmp) WEnd ; display output of third command MsgBox(Default, Default, StdoutRead($iPID3), 0)1 point
-
That's an odd way of doing what "it looks like" you're attempting, I think I'd use the built in functions myself. Subscript error generally means you don't have enough memory (dimensions) allocated. Your example shows you're going to the max of $tPage, you always need one more dimension in the declaration of the array. So either this: Global $tArray[$tPage][2] Should be: Global $tArray[$tPage + 1][2] Or this: For $cPage = 0 to $tPage Should be: For $cPage = 0 to $tPage - 1 Dividing the lines by 3, you're bound to get an odd number of lines, and not the results you would expect. Example (run this): Local $n_lines = 11 Local $n_dimensions = $n_lines / 3 Local $a_array[$n_dimensions] ConsoleWrite("n_dimensions = " & $n_dimensions & @CRLF & _ "Ubound of array dimensions = " & UBound($a_array) & @CRLF)1 point
-
It's because in the For loop you redeclare (then reinitialize) $tArray Remove these Globals and it will work Edit BTW remove also $cPage += 1 BTW2 #include <Array.au3> #include <File.au3> Global $tPage = (_FileCountLines ("settings.ini")/3) Global $tArray[$tPage][2] For $cPage = 0 to $tPage-1 $tArray[$cPage][0] = IniRead("settings.ini", "Search" & $cPage, "Name", "Default") $tArray[$cPage][1] = IniRead("settings.ini", "Search" & $cPage, "Number", "Default") Next _ArrayDisplay($tArray)1 point
-
You are Great Bro..........Thank You very much bro............1 point
-
The callback: Global Enum $RASCS_OpenPort = 0, $RASCS_PortOpened, $RASCS_ConnectDevice, $RASCS_DeviceConnected, $RASCS_AllDevicesConnected, _ $RASCS_Authenticate, $RASCS_AuthNotify, $RASCS_AuthRetry, $RASCS_AuthCallback, $RASCS_AuthChangePassword, $RASCS_AuthProject, _ $RASCS_AuthLinkSpeed, $RASCS_AuthAck, $RASCS_ReAuthenticate, $RASCS_Authenticated, $RASCS_PrepareForCallback, _ $RASCS_WaitForModemReset, $RASCS_WaitForCallback, $RASCS_Projected, _ $RASCS_StartAuthentication, _ $RASCS_CallbackComplete, _ $RASCS_LogonNetwork, _ $RASCS_SubEntryConnected, _ $RASCS_SubEntryDisconnected, _ $RASCS_ApplySettings, _ $RASCS_Interactive = 0x1000, _ $RASCS_RetryAuthentication, _ $RASCS_CallbackSetByCaller, _ $RASCS_PasswordExpired, _ $RASCS_InvokeEapUI, _ $RASCS_Connected = 0x2000, _ $RASCS_Disconnected Local $hHandle = DllCallbackRegister("RasDialFunc", "none", "UINT;lparam;wparam") Func RasDialFunc($iMsg, $rasconnstate, $dwError) If $dwError Then Local $aRet = DllCall("Rasapi32.dll", "dword", "RasGetErrorStringW", "uint", $dwError, "wstr", "", "dword", 256) ConsoleWrite("!" & $aRet[2] & @CRLF) Return EndIf Switch $rasconnstate Case $RASCS_OpenPort ConsoleWrite("Opening port..." & @CRLF) Case $RASCS_PortOpened ConsoleWrite("Port Opened..." & @CRLF) Case $RASCS_ConnectDevice ConsoleWrite("Connecting device..." & @CRLF) Case $RASCS_DeviceConnected ConsoleWrite("Device connected..." & @CRLF) Case $RASCS_AllDevicesConnected ConsoleWrite("All devices connected..." & @CRLF) Case $RASCS_Authenticate ConsoleWrite("Authenticating..." & @CRLF) Case $RASCS_AuthNotify ConsoleWrite("Authentication notify..." & @CRLF) Case $RASCS_AuthRetry ConsoleWrite("Retrying authentication..." & @CRLF) Case $RASCS_AuthCallback ConsoleWrite("Authentication callback..." & @CRLF) Case $RASCS_AuthChangePassword ConsoleWrite("Change password..." & @CRLF) Case $RASCS_AuthProject ConsoleWrite("Projection phase started..." & @CRLF) Case $RASCS_AuthLinkSpeed ConsoleWrite("Negotiating speed..." & @CRLF) Case $RASCS_AuthAck ConsoleWrite("Authentication acknowledge..." & @CRLF) Case $RASCS_ReAuthenticate ConsoleWrite("Retrying Authentication..." & @CRLF) Case $RASCS_Authenticated ConsoleWrite("Authentication complete..." & @CRLF) Case $RASCS_PrepareForCallback ConsoleWrite("Preparing for callback..." & @CRLF) Case $RASCS_WaitForModemReset ConsoleWrite("Waiting for modem reset..." & @CRLF) Case $RASCS_WaitForCallback ConsoleWrite("Waiting for callback..." & @CRLF) Case $RASCS_Projected ConsoleWrite("Projection completed..." & @CRLF) Case $RASCS_StartAuthentication ConsoleWrite("Starting authentication..." & @CRLF) Case $RASCS_CallbackComplete ConsoleWrite("Callback complete..." & @CRLF) Case $RASCS_LogonNetwork ConsoleWrite("Logon to the network..." & @CRLF) Case $RASCS_SubEntryConnected ConsoleWrite("Subentry connected..." & @CRLF) Case $RASCS_SubEntryDisconnected ConsoleWrite("Subentry disconnected..." & @CRLF) Case $RASCS_Connected ConsoleWrite("Connection completed." & @CRLF) Case $RASCS_Disconnected ConsoleWrite("Disconnecting..." & @CRLF) Case Else ConsoleWrite("Unknown Status = " & $rasconnstate & @CRLF) EndSwitch EndFunc ;==>RasDialFunc Saludos1 point
-
brother If you want the callback code let me know it. Saludos1 point
-
;Danyfirex Global Const $RAS_MaxAreaCode = 10 Global Const $RAS_MaxPhoneNumber = 128 Global Const $RAS_MaxDeviceType = 16 Global Const $RAS_MaxDeviceName = 128 Global Const $RAS_MaxPadType = 32 Global Const $RAS_MaxX25Address = 200 Global Const $RAS_MaxFacilities = $RAS_MaxX25Address Global Const $RAS_MaxUserData = $RAS_MaxFacilities Global Const $RAS_MaxDnsSuffix = 256 Global Const $RAS_MaxEntryName = 256 Global Const $WM_RASDIALEVENT = 0xCCCD Global Const $RASCS_DONE = 0x2000 Global Const $WAIT_OBJECT_0 = 0 Global $hConection = 0 ;Danyfirex Local Const $DNLEN =15 ;Danyfirex Global $tagRASCONNSTATUS = "dword dwSize;dword rasconnstate;wchar szDeviceType[" & $RAS_MaxDeviceType & "];wchar szDeviceName[" & $RAS_MaxDeviceName & "];" & _ "wchar szPhoneNumber[" & $RAS_MaxPhoneNumber & "];dword localEndPoint;byte[16];word[8];dword remoteEndPoint;byte[16];word[8];dword rasconnsubstate" ;Danyfirex Global Const $tagRASDIALPARAMS = "dword dwSize;wchar szEntryName["& $RAS_MaxDnsSuffix +1 &"];wchar szPhoneNumber["& $RAS_MaxDeviceName +1 &"];wchar szCallbackNumber["& $RAS_MaxDeviceName +1 & "];wchar szUserName[" & $RAS_MaxDnsSuffix +1 & "];wchar szPassword["& $RAS_MaxDnsSuffix + 1 & "];wchar szDomain["&$DNLEN +1 &"];dword dwSubEntry;ULONG_PTR dwCallbackId;dword dwIfIndex" ; Only structure By Starstar ;Danyfirex Local $tRASDIALPARAMS = DllStructCreate($tagRASDIALPARAMS) $tRASDIALPARAMS.dwSize = DllStructGetSize($tRASDIALPARAMS) DllStructSetData($tRASDIALPARAMS, "szEntryName", "HM-LINK") DllStructSetData($tRASDIALPARAMS, "szPhoneNumber", "") DllStructSetData($tRASDIALPARAMS, "szCallbackNumber", "") DllStructSetData($tRASDIALPARAMS, "szUserName", "PPP455") DllStructSetData($tRASDIALPARAMS, "szPassword", "455") DllStructSetData($tRASDIALPARAMS, "szDomain", "") Local $FilePath=@AppDataDir & "\Microsoft\Network\Connections\Pbk\rasphone.pbk" Local $iRet = DllCall("Rasapi32.dll", "dword", "RasDialW", "ptr", 0,"wstr",$FilePath, "ptr",DllStructGetPtr($tRASDIALPARAMS), "dword", 0, "ptr", Null, "handle*", NULL) MsgBox(0,"",$iRet[0]) If $iRet[0] Then Local $Ret = DllCall("Rasapi32.dll", "dword", "RasGetErrorStringW", "uint", $iRet[0], "wstr", NULL, "dword", 256) ConsoleWrite( $Ret[2] & @CRLF) $hConection = $iRet[6] Else ConsoleWrite("Rasdial OK" & @CRLF) $hConection = $iRet[6] EndIf ;Danyfirex Special Thanks to Danyfirex. I could never solve it without your help Danyfirex...........Thanks a lot of you. May God Bless you....1 point
-
GlyphDesigner v1.00
mesale0077 reacted to Biatu for a topic
Infinity.GlyphDesigner v2.00a -Complete Rewrite of code -Added curves -Use Shift key to continue lines/curves Controls: LeftClick=Place ControlPoint Shift+LeftClick=Place Consecutive ControlPoints LeftClick+Drag=Draw Line Shift+LeftClick+Drag=Draw Consecutive Lines/Curve 1 Key=Line Mode 2 Key=Curve Mode ...Currently working on Undo/Clear Functions. (Ctrl+Z,Ctrl+N) Downloads: 32Bit: https://drive.google.com/file/d/0B8M7MDYfpD20aC1FRmUtT1h6aUE/view?usp=sharing 64Bit: https://drive.google.com/file/d/0B8M7MDYfpD20V3lnMXBJeHZPTHc/view?usp=sharing1 point -
First, you're looking in the wrong registry key. To find the program that is associated with a certain extension you need to look in HKCR. Lets take an example from my system (Windows 7 x64). File extension is .mp3. The first key you look in is: HKEY_CLASSES_ROOT.mp3 Then you look at the Default value of this file extension, on my computer it's listed as VLC.mp3 because VLC is the default program used to open mp3 files. Next you look in the key HKEY_CLASSES_ROOTVLC.mp3Shell The default value here tells you the default action to take when you double click on the file type, in my computer the default verb (action) is Open. So now we know what the default Verb is, we look in this key HKEY_CLASSES_ROOTVLC.mp3ShellOpenCommand Sometimes the default Verb isn't listed in the Shell key, the default Verb when it's not listed as default is usually Open, so even if it's blank, your best bet is to look in OpenCommand Inside the Command Key the default value listed is 99% of the time the program used to open it, and it's path to the program, on my computer the HKEY_CLASSES_ROOTVLC.mp3ShellOpenCommand default value is ""C:Program Files (x86)VideoLANVLCvlc.exe" --started-from-file "%1"" the part listed in red is the path and program name used in the Open verb to point to what opens this type of file.1 point
-
GUISetAccelerators sets hotkeys, associated to some specific control(s) (here, is use a Dummy control). So when the use presses the affected keys, the equivalent of a click is sent to the specified control. Look at the help page for an example1 point