doestergaard Posted May 11, 2014 Posted May 11, 2014 I am having some hickups with getting the full file path from a wim file, which has been populated into a combo box $select_os the following way: global $wim_path = "z:\images\" local $wim_list = _filelistToArray($wim_path, "*.wim") _arraysort($wim_list, 0, 1) for $wim_file = 1 to ubound($wim_list) -1 $objwim.source = "z:\images\" & $wim_list[$wim_file] $objwim.imageindex = 1 $objwim.getimageinfo guictrlsetdata($select_os, $objwim.imagename) next $objwim = 0 When you afterwards select the image file you want, how do i get the full path to the image file being selected from the combo box? Kinda the same process as above but reversed Thank you in advance!
MHz Posted May 11, 2014 Posted May 11, 2014 Just GuiCtrlRead the ID of the combo control. I see no reason to reverse anything.
MHz Posted May 11, 2014 Posted May 11, 2014 A return of 0 is failure. A wild guess is that you are deleting the control or the whole gui before using GuiCtrlRead as that would cause failure and return 0. Very basic example of reading a path from a combo with GuiCtrlRead GUICreate('test') $select_os = GUICtrlCreateCombo(@ComSpec, 5, 5) GUISetState() $result = GUICtrlRead($select_os) MsgBox(0, 'result', $result) Outputs --------------------------- result --------------------------- C:\Windows\system32\cmd.exe --------------------------- OK --------------------------- Seems fine. So check and make sure GuiCtrlRead reads the control while it exists.
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