-
Posts
127 -
Joined
-
Last visited
Community Answers
-
tweakster2010's post in If Variable And Variable2 Etc Etc was marked as the answer
I wanted to give up an updated label for anyone else to have incase they end up doing the same thing I did and would like a simple solution.
The Button i have it tied to checks when tree item is selected and then labels them into the array 1/2/3. For me my next step is writing array1 into a category, 2 into a subcategory, and 3 into a class. (ticketing system)
Local $idItem $idItem = GUICtrlRead($idTreeview) $sText = GUICtrlRead($idItem, 1) ; Get the text of the treeview item If $sText == "" Then MsgBox($MB_SYSTEMMODAL, "Error", "Error while retrieving infos about item") Else MsgBox($MB_SYSTEMMODAL, "TreeView Demo", "Current item selected is: " & $sText & " " & _GUICtrlTreeView_GetTree($idTreeview)) EndIf Local $aArray = StringSplit(_GUICtrlTreeView_GetTree($idTreeview), '|', $STR_ENTIRESPLIT) ; Pass the variable to StringSplit and using the delimiter "|". MsgBox(0, "testing", $aArray[1] & " " & $aArray[2] & " " & $aArray[3]) Hope others might find this useful
EDIT: Just wanted to add this also reduces me needing to add a lot of If variable and variable that continues on and on. I was going about it completely wrong at first and made it way more complicated than it needed to be
-
tweakster2010's post in _isChecked AND (second option changes) was marked as the answer
Figured it out, I had to add another Case to read separate for the way I was doing it, I dont know if i should have or if its bad practice but its doing exactly what I want now.
I am sure shorter code is possible but for me this is a solid fix for now.
Case $Check If _IsChecked($check) And GuiCtrlRead($toporbottom) = "top" Then Local $combo1 = GUICtrlCreateCombo("", 75,375) GuiCtrlSetData($combo1,"1|2|3","") Local $combo2 = GuiCtrlCreateCombo("",75,410) GuiCtrlSetData($combo2, "a|b|c","") ElseIf _IsChecked($check) And GuiCtrlRead($toporbottom) = "bottom" Then Local $combo1 = GUICtrlCreateCombo("",75,375) GuiCtrlSetData($combo1,"4|5|6","") Local $combo2 = GuiCtrlCreateCombo("",75,410) GuiCtrlSetData($combo2, "a|b|c","") Else guictrlDelete($combo1) guictrlDelete($combo2) EndIf Case $toporbottom GuiCtrlRead($toporbottom) If _IsChecked($check) And GuiCtrlRead($toporbottom) = "bottom" Then guictrlDelete($combo1) Local $combo1 = GUICtrlCreateCombo("",75,375) GuiCtrlSetData($combo1,"1|2|3","") ElseIf _IsChecked($check) And GuiCtrlRead($toporbottom) = "bottom" Then guictrlDelete($combo1) Local $combo1 = GUICtrlCreateCombo("",75,375) GuiCtrlSetData($combo1,"4|5|6","") EndIf Fixed a typo in the example solution
-
tweakster2010's post in Unique error involving variables. was marked as the answer
Ok so the solution i used was to include the while loop in each if then statement.
My over all issue ended up being I was using defined variables from both sides but only 1 side had access to all of em. So thats where my variables tanked at . Thank you for the effort, was beating my head around this for 2 days lol.
-
tweakster2010's post in Odd Issue with MMC was marked as the answer
I just fixed the issue. It was right in my face the entire time!!!
$iPID = RunAs(GuiCtrlRead($Username), "domain", GuiCtrlRead($Pass), 1, "mmc C:\Windows\system32\printmanagement.msc") Changed the 0 to a 1 for the flag. I guess you can say it was a poor observation issue.
For your question though Boththose
Only using runas and command prompt mmc "C:\Windows\System32\printmanagement.msc" was having the issue. Shellexecute, right click run as different user or double click all work fine with UAC prompt and the credentials that applied. For my circumstances the flag was why it would wipe out data and give errors. no profile vs using profile.