Lakai[NL] Posted March 9, 2005 Posted March 9, 2005 Alright, Im working on a new program that will have many functions, one of them being displaying the serial, of a drive that you choose, by inputting the drive name, ex a:\, or C:\. The problem I am having is, you can enter the name of the drive, but when u hit the Get Serial button, nothing happends. Heres my code: #include <GUIConstants.au3> Opt("GUIOnEventMode", 1) $mainwindow = GUICreate("PC Tools v1", 300, 500) $driveserialinput = GUICtrlCreateInput("C:\", 15, 25, 25, 20) $serialnumber = GUICtrlCreateButton("Get Drive Serial", 45, 22, 90) GUISetState(@SW_SHOW) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $serialnumber Then $driverserialinput = String(GUICtrlRead($driveserialinput)) $var = DriveGetSerial("$driveserialinput") MsgBox(4096, "Serial Number: ", $var) EndIf WEnd Thanks, Lakai
Valik Posted March 9, 2005 Posted March 9, 2005 You're using GUIOnEventMode but you didn't set up the events, so your message loop doesn't do anything. Either set up the callback events with GUISetOnEvent/GUICtrlSetOnEvent or don't use event mode.
Lakai[NL] Posted March 9, 2005 Author Posted March 9, 2005 ALright thanks, that is what the problem was, I accidently used part of another script for this one, now the problem is, when i push the button in, it returns the number 1 instead of the serial number, that is the result of all the drives, the number 1 instead of the serial
Lakai[NL] Posted March 9, 2005 Author Posted March 9, 2005 bump, i know there has to be a way to fix this
Lakai[NL] Posted March 9, 2005 Author Posted March 9, 2005 Admin or mod can lock this, i got it resloved, stupid mistake ><
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now