Jump to content

airwilf

Members
  • Posts

    5
  • Joined

  • Last visited

airwilf's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Aipion Thanks for that im going to tweak your code to get what im after. Just out of interest you stated earlier "If a radio button is empty the value returned by the function will be "4" otherwise if it is checked it will be "1"." is there a list that i can see exactly what values mean what? I have looked on the help but jsut seem to be going around in circles. Thanks Water and Melba23 for your advice
  2. Water I have had a look at the helpfile but this does not give me the answer i need,in the help from what i can see each radio button is statically assigned $radio1 ="", $radio2 = "", when done this way i can see how to check what button is being pressed. However my script is in a loop and creates buttons depending on a variable value, because i dont have $radio1 etc to enter in to GUICtrlRead i am struggling to determine what is being pressed. Thanks
  3. Aipion How do i determine the controlid of the buttons? As i dont have $radio1 = GUICtrlCreateRadio("button1", 48, 100, 300, 33) $radio2 = GUICtrlCreateRadio("button2", 48, 200, 300, 33) and so on. Could you show me an example of using what you have suggested within my script? Thanks
  4. Hi The below script is the gui im having the issue with. At the moment my script will create a different radio button for whatever the value of $x is. This part works fine, the problem is determining which button is being pressed. As the amount of radio buttons is a variable i cant use $radio1, $radio2 so i am struggling to find the answer. #include <GUIConstantsEx.au3> $Form1 = GUICreate("Form1", 615, 438, 192, 124) $Label1 = GUICtrlCreateLabel("Please choose the drive you would like to back your data upto", 48, 16, 520, 28) GUICtrlSetFont(-1, 16, 400, 0, "MS Sans Serif") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $x = 0 Dim $start = 32 do $x = $x +1 GUICtrlCreateRadio($x, 48, $start + $start * $x, 300, 33) until $x = 5 While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd
  5. Tested the following against fixed and removable drives, outputs the drive letter along with the model. All USB connected devices have "USB Device" at the end of the string.$strComputer = @ComputerName Dim $objWMIService = objget("winmgmts:\\" & $strComputer & "\root\cimv2") Dim $colDevices = $objWMIService.ExecQuery ("Select * From Win32_logicaldisktopartition") For $objDevice in $colDevices $strDeviceName = $objDevice.antecedent $strdrive = $objDevice.dependent $strQuote = Chr(34) $strDriveName = StringReplace($strDrive, $strQuote, "") $arrDriveNames = stringSplit($strDriveName, "=") $strDeviceName = StringReplace($strDeviceName, $strQuote, "") $arrDeviceNames = stringSplit($strDeviceName, "=") $split = stringsplit($arrDeviceNames[2],",") $replace = Stringtrimleft($split[1], 6) Dim $colUSBDevices = $objWMIService.ExecQuery("Select * From Win32_diskdrive Where index = '" & $replace & "'") For $objUSBDevice in $colUSBDevices msgbox(0,"",$arrDriveNames[2] & "drive " & " is" & @lf & $objUSBDevice.caption) Next Next
×
×
  • Create New...