Jump to content

fcg

Members
  • Posts

    15
  • Joined

  • Last visited

fcg's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thanks Danp2, That seems to have fixed it.
  2. Hello, I'm trying to create an application that automatically does random searches. However I get an intermittent "WEnd^ ERROR" error when running it. I believe it is related to the '_IEFormSubmit()" function but am not sure. I also tried with the "For..Next" loop with the same result. Any ideas on how to get rid of this error are greatly appreciated! #include <IE.au3> #include <String.au3> #include <File.au3> #include <Array.au3> Global $aArray1 Local $newarray[1] Local $oIE1 = _IECreate("http://www.news.google.com") $tempfile = FileOpen(@TempDir & "\tempdata.txt", 2) FileWrite($tempfile, _IEBodyReadHTML($oIE1)) FileClose($tempfile) For $x = 1 To _FileCountLines(@TempDir & "\tempdata.txt") $line = FileReadLine(@TempDir & "\tempdata.txt", $x) If StringInStr($line, ';ict=clu_bl"> ') > 0 Then $aArray1 = _StringBetween($line, 'ict=clu_bl"> ', '&nbsp') _ArrayAdd($newarray, $aArray1[0]) EndIf Next _IEQuit($oIE1) $newarray2 = _ArrayUnique($newarray) Local $oIE2 = _IECreate("http://www.bing.com") $count = 0 while $count <> 20 $r = Random(2, UBound($newarray2) - 1) Local $oForm = _IEFormGetCollection($oIE2, 0) Local $oQuery1 = _IEFormElementGetCollection($oForm, 0) _IEFormElementSetValue($oQuery1, $newarray2[$r]) _IEFormSubmit($oForm) Sleep(5000) $count = $count + 1 WEnd _IEQuit($oIE2)
  3. Thanks FreeBeing for the updates. I did confirm the "4" flag worked in both WinPE 3.x and 4, but still no create folder button. I will have to do without for now. I'm looking into adding IE and Explorer into WinPE to see if that works but I haven't found clear instructions on that process. My other option is possibly calling a VBS script and getting the return value to AutoIT. The problem again with that is VBS does not work by default in WinPE 3.x (Haven't tried 4 yet) I have to add it. Set objShell = CreateObject("Shell.Application") Set objFolder = objShell.BrowseForFolder(0, "Example", 1, "c:\Programs") If objFolder Is Nothing Then Wscript.Quit End If wscript.Echo "folder: " & objFolder.title & " Path: " & objFolder.self.path
  4. Update: I verified that the following syntax works in both WinPE 4 and 3.x FileSelectFolder("Choose your folder", "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}") However if you add an optional flag, the function no longer works. I am assuming it is because WinPE does not have Internet Explorer working natively in it. But you know what happens when you assume. >_< flag [optional] 1 = Show Create Folder Button (requires IE6.0 or later) 2 = Use New Dialog Style (requires IE5.0 or later) 4 = Show Edit Control (to type a folder name) I can live without the Create Folder Button but it would sure be nice to have. Any Ideas?
  5. Thank you both for the feedback I will try in WinPE 4.0
  6. Hi All, I know this topic is quite old now but I was wondering if there was ever a solution. I'm currently trying to use the FileSelectFolder function in WinPE 3.0 and it does not work properly. FileSaveDialog works fine but I really need the FileSelectFolder function for this project. I have tried adding IE into my WinPE enviorment thinking it is a prerequisite but that didnt work. Any help would be greatly appreciated.
  7. LarsJ, Thanks again for the quick reply. It works without any errors now. I saw your post AutoItObject example: Enumerating and Browsing the Desktop and its an awesome piece of code. I have been looking for ability to have a treeview in a listview, so thanks for that. Now I need to piece it all together and to get what I ultimately want to end up with, Something like this. Many thanks again. fcgnewbie
  8. LarsJ, Thank you for the response. I do get an error when running the updated code; See below. However, If I continue any way it returns exactly what I was looking for, Perfect thanks. I:\Autoit\forum.au3(41,54) : ERROR: _ArrayDisplay() called with expression on Const ByRef-param(s) _ArrayDisplay( GetChecked(), &quot;Checked items&quot; ) C:\Program Files (x86)\AutoIt3\Include\Array.au3(322,163) : REF: definition of _ArrayDisplay(). Func _ArrayDisplay(Const ByRef $avArray, $sTitle = &quot;Array: ListView Display&quot;, $iItemLimit = -1, $iTranspose = 0, $sSeparator = &quot;&quot;, $sReplace = &quot;|&quot;, $sHeader = &quot;&quot;) fcgnewbie
  9. Hi, I'm trying to return information from all the items that are checked in the treeview. I would like to return if the parent is checked and any children that are checked if the parent isnt checked, either postition (i.e Parent2|Child3|Sibling1 or 2,3,1) or text would work. Ive been trying various "_GUICtrlTree..." functions with little success. Any direction would be greatly appreciated. I did find this gem that automaticaly checks child items if the parent is selected. Much respect to Melba23 and Authenticity for that. I've posted the code that I'm working on. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <TreeViewConstants.au3> #include <GuiTreeView.au3> #include <ButtonConstants.au3> Local $hGUI, $Tree, $hTree, $hItems[40][2] = [[0]] $Form1_1 = GUICreate("Form1", 616, 532, 192, 124) $string = StringSplit("parent1,child1,child2,child3,sibling1,parent2,child1,child2,child3,sibling1",",") $button1 = GUICtrlCreateButton("Select", 40, 200, 100, 50) $List1 = GUICtrlCreateTreeView(40, 260, 530, 200, BitOR($GUI_SS_DEFAULT_TREEVIEW,$TVS_EDITLABELS,$TVS_CHECKBOXES), $WS_EX_CLIENTEDGE) GUISetState(@SW_SHOW) $hTree = GUICtrlGetHandle($List1) $hImage = _GUIImageList_Create(16, 16, 5, 3) _GUIImageList_AddIcon($hImage, "shell32.dll", 8) _GUIImageList_AddIcon($hImage, "shell32.dll", 166) _GUICtrlTreeView_SetNormalImageList($List1, $hImage) _GUICtrlTreeView_BeginUpdate($List1) For $x = 0 To ubound($string) - 1 if StringInStr($string[$x],"parent",0) > 0 Then $tree_disk = _GUICtrlTreeView_Add($List1, 0, $string[$x], 0) EndIf if StringInStr($string[$x],"child",0) > 0 Then $tree_Part = _GUICtrlTreeView_AddChild($List1, $tree_disk,$string[$x], 1,1) EndIf if StringInStr($string[$x],"sibling",0) > 0 Then $tree_logical = _GUICtrlTreeView_AddChild($List1,$tree_Part, $string[$x], 1, 1) EndIf Next _GUICtrlTreeView_EndUpdate($List1) GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $button1 MsgBox(0,"",_GUICtrlTreeView_GetCount($hTree)) EndSwitch WEnd Func _WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR Local $iPos, $iX, $iY, $tPt, $iHitTest, $fWasChecked Local $hItem $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hTree Switch $iCode Case $NM_CLICK $iPos = _WinAPI_GetMessagePos() $iX = BitAND($iPos, 0xFFFF) $iY = BitShift($iPos, 16) $tPt = DllStructCreate($tagPOINT) DllStructSetData($tPt, "X", $iX) DllStructSetData($tPt, "Y", $iY) _WinAPI_ScreenToClient($hTree, $tPt) $iX = DllStructGetData($tPt, "X") $iY = DllStructGetData($tPt, "Y") $tTVHTInfo = _GUICtrlTreeView_HitTestEx($hTree, $iX, $iY) If DllStructGetData($tTVHTInfo, "Flags") = $TVHT_ONITEMSTATEICON Then $hItem = DllStructGetData($tTVHTInfo, "Item") $fWasChecked = _GUICtrlTreeView_GetChecked($hTree, $hItem) If $fWasChecked Then _GUICtrlTreeView_BeginUpdate($hTree) _Uncheck($hItem) _GUICtrlTreeView_EndUpdate($hTree) Else _GUICtrlTreeView_BeginUpdate($hTree) _CallItemFunc($hItem) _Check($hItem) _GUICtrlTreeView_EndUpdate($hTree) EndIf EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc Func _Uncheck($hItem) Local $hParent, $hItemCur, $iLevel $iLevel = _GUICtrlTreeView_Level($hTree, $hItem) $hItemCur = _GUICtrlTreeView_GetFirstChild($hTree, $hItem) While $hItemCur And _GUICtrlTreeView_Level($hTree, $hItemCur) > $iLevel _GUICtrlTreeView_SetChecked($hTree, $hItemCur, False) $hItemCur = _GUICtrlTreeView_GetNext($hTree, $hItemCur) WEnd $hParent = _GUICtrlTreeView_GetParentHandle($hTree, $hItem) If $hParent Then While $hParent If $hParent <> $hItem Then _GUICtrlTreeView_SetChecked($hTree, $hParent, False) $hParent = _GUICtrlTreeView_GetParentHandle($hTree, $hParent) WEnd EndIf EndFunc Func _Check($hItem) Local $hParent, $hItemCur, $iLevel $iLevel = _GUICtrlTreeView_Level($hTree, $hItem) $hItemCur = _GUICtrlTreeView_GetFirstChild($hTree, $hItem) While $hItemCur And _GUICtrlTreeView_Level($hTree, $hItemCur) > $iLevel _GUICtrlTreeView_SetChecked($hTree, $hItemCur) _CallItemFunc($hItemCur) $hItemCur = _GUICtrlTreeView_GetNext($hTree, $hItemCur) WEnd $hParent = _GUICtrlTreeView_GetParentHandle($hTree, $hItem) While $hParent $hItemCur = _GUICtrlTreeView_GetFirstChild($hTree, $hParent) While $hItemCur If Not _GUICtrlTreeView_GetChecked($hTree, $hItemCur) And $hItemCur <> $hItem Then ExitLoop 2 $hItemCur = _GUICtrlTreeView_GetNextSibling($hTree, $hItemCur) WEnd _GUICtrlTreeView_SetChecked($hTree, $hParent) _CallItemFunc($hParent) $hParent = _GUICtrlTreeView_GetParentHandle($hTree, $hParent) WEnd EndFunc Func _WinAPI_GetMessagePos() Local $aResult = DllCall("user32.dll", "uint", "GetMessagePos") If @error Then Return SetError(@error, @extended, 0) Return $aResult[0] EndFunc Func _CallItemFunc($hItem) For $i = 1 To $hItems[0][0] If $hItem = $hItems[$i][0] Then Call($hItems[$i][1]) ExitLoop EndIf Next EndFunc
  10. Awesome, that works perfectly, many thanks again monoscout999
  11. After adding more data in the list I noticed that the value returned is always the same no matter which sub-item I select. I have tried different variations of the WM_NOTIFY function I have found in the forums but no luck. Sorry for seeing this in the original post. #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <DateTimeConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <ListBoxConstants.au3> #include <GuiListView.au3> Local $Company, $email, $phone, $build, $SRS_Ticket, $Ticket_Id, $ticket_select, $close, $update_tick, $update_cust, $ticket_info = 999999, $msg, $ticket_list $New_Ticket = GUICreate("View Tickets", 981, 753, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_TABSTOP)) $Menu_file = GUICtrlCreateMenu("File") $Menu_Create = GUICtrlCreateMenuItem("Create New Ticket", $Menu_file) $f_name = GUICtrlCreateInput("", 100, 37, 121, 21) $fn_srch = GUICtrlCreateButton("Search", 221, 37, 75, 21) $l_name = GUICtrlCreateInput("", 100, 77, 121, 21) $ln_srch = GUICtrlCreateButton("Search", 221, 77, 75, 21) $Company = GUICtrlCreateInput("", 100, 117, 121, 21) $comp_srch = GUICtrlCreateButton("Search", 221, 117, 75, 21) $phone = GUICtrlCreateInput("", 100, 157, 121, 21) $phon_srch = GUICtrlCreateButton("Search", 221, 157, 75, 21) $email = GUICtrlCreateInput("", 100, 197, 121, 21) $email_srch = GUICtrlCreateButton("Search", 221, 197, 75, 21) $product = GUICtrlCreateCombo("", 400, 37, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) $prod_srch = GUICtrlCreateButton("Search", 545, 37, 75, 21) $version = GUICtrlCreateCombo("", 400, 77, 40, 25) $version1 = GUICtrlCreateCombo("", 450, 77, 95, 25) $version_srch = GUICtrlCreateButton("Search", 545, 77, 75, 21) $build = GUICtrlCreateInput("", 400, 117, 145, 21) $build_srch = GUICtrlCreateButton("Search", 545, 117, 75, 21) $assigned = GUICtrlCreateCombo("", 400, 157, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) $assign_srch = GUICtrlCreateButton("Search", 545, 157, 75, 21) $SRS_Ticket = GUICtrlCreateInput("", 400, 197, 145, 21) $srs_srch = GUICtrlCreateButton("Search", 545, 197, 75, 21) $Date1 = GUICtrlCreateDate("", 730, 37, 145, 21, $DTS_SHORTDATEFORMAT) $date_srch = GUICtrlCreateButton("Search", 875, 37, 75, 21) $Ticket_Id = GUICtrlCreateInput("", 730, 77, 145, 21) $tick_srch = GUICtrlCreateButton("Search", 875, 77, 75, 21) $Cust_type = GUICtrlCreateCombo("", 730, 117, 145, 25) $cust_srch = GUICtrlCreateButton("Search", 875, 117, 75, 21) $reps = GUICtrlCreateCombo("", 730, 157, 145, 25) $assoc_srch = GUICtrlCreateButton("Search", 875, 157, 75, 21) $Extended = GUICtrlCreateCheckbox("Extended Support", 732, 200, 121, 17) $extend_srch = GUICtrlCreateButton("Search", 875, 197, 75, 21) $Priority = GUICtrlCreateCombo("", 100, 248, 121, 25) $Priority_srch = GUICtrlCreateButton("Search", 221, 247, 75, 21) $Status = GUICtrlCreateCombo("", 400, 248, 145, 25) $Status_srch = GUICtrlCreateButton("Search", 545, 247, 75, 21) $Created_by_combo = GUICtrlCreateCombo("", 730, 248, 145, 25) $created_by_srch = GUICtrlCreateButton("Search", 875, 247, 75, 21) $view_tick = GUICtrlCreateButton("View Ticket", 425, 310, 107, 25) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $reload_list = GUICtrlCreateButton("Reload List", 700, 310, 107, 25) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $new_tick = GUICtrlCreateButton("New Ticket", 150, 310, 107, 25) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $assign = GUICtrlCreateLabel("Assign To", 320, 160, 51, 17) $pdct = GUICtrlCreateLabel("Product", 320, 40, 41, 17) $ver = GUICtrlCreateLabel("Version", 320, 80, 39, 16) $bld = GUICtrlCreateLabel("Build", 320, 120, 75, 17) $SRS = GUICtrlCreateLabel("SRS Ticket #", 320, 200, 69, 17) $mail = GUICtrlCreateLabel("Email", 20, 200, 29, 17) $phon = GUICtrlCreateLabel("Phone #", 20, 160, 45, 17) $comp = GUICtrlCreateLabel("Company", 20, 120, 48, 17) $cus_type = GUICtrlCreateLabel("Customer Type", 650, 120, 75, 17) $rep = GUICtrlCreateLabel("Sales Associate", 650, 160, 79, 17) $name_l = GUICtrlCreateLabel("Last Name", 20, 80, 55, 17) $name_f = GUICtrlCreateLabel("First Name", 20, 40, 54, 17) $tick = GUICtrlCreateLabel("Ticket ID", 650, 77, 48, 17) $Label1 = GUICtrlCreateLabel("Date", 650, 37, 27, 17) $prior = GUICtrlCreateLabel("Priority", 20, 250, 35, 17) $Stat = GUICtrlCreateLabel("Status", 320, 250, 34, 17) $crt_by_lbl = GUICtrlCreateLabel("Created By", 650, 250, 70, 17) GUISetState(@SW_SHOW) _Reset_List() Func _Reset_List() $pos_tick = ControlGetPos("", "", $view_tick) $pos_gui = ControlGetPos("", "", $New_Ticket) If $pos_gui[2] == 987 Then $new_y_pos = $pos_tick[1] + 40 $new_width = $pos_gui[2] - 50 $new_height = $pos_gui[3] - 400 Else If $pos_gui[2] > 987 Then $new_y_pos = $pos_tick[1] + 55 $new_width = $pos_gui[2] - 60 $new_height = $pos_gui[3] - 500 EndIf EndIf $ticket_list = GUICtrlCreateListView("Ticket #", 24, $new_y_pos, $new_width, $new_height) GUICtrlCreateListViewItem("10001", $ticket_list) GUICtrlCreateListViewItem("10002", $ticket_list) GUICtrlCreateListViewItem("10003", $ticket_list) _GUICtrlListView_RegisterSortCallBack($ticket_list) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") EndFunc ;==>_Reset_List While true $msg = GUIGetMsg(1) Switch $msg[1] Case $New_Ticket Switch $msg[0] Case $ticket_list _GUICtrlListView_SortItems($ticket_list, GUICtrlGetState($ticket_list)) Case $view_tick $ticket_select = StringLeft(GUICtrlRead(GUICtrlRead($ticket_list)), 5) If $ticket_select <> 0 Then MsgBox(48, "Ticket Selected", $ticket_select) Else MsgBox(48, "No Ticket Selected", "Please select a ticket to view") EndIf Case $GUI_EVENT_CLOSE Exit EndSwitch Case $ticket_info Switch $msg[0] Case $update_tick MsgBox(0, "Ticket info", "Ticket information updated") Case $update_cust MsgBox(0, "Customer info", "Customer information updated") Case $GUI_EVENT_CLOSE ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $GUI_EVENT_CLOSE = ' & $GUI_EVENT_CLOSE & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console GUIDelete($ticket_info) EndSwitch EndSwitch WEnd Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam Local $hWndFrom, $iCode, $tNMHDR, $hWndListView, $tInfo $hWndListView = $ticket_list If Not IsHWnd($ticket_list) Then $hWndListView = GUICtrlGetHandle($ticket_list) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) $ticket_select = _GUICtrlListView_GetItemText($ticket_list, $tInfo) _test() EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func _test() MsgBox(0, "", $ticket_select) $ticket_info = GUICreate("Customer Ticket Information", 864, 639, -1, -1) $Tab_Set = GUICtrlCreateTab(8, 50, 844, 544) $TabSheet1 = GUICtrlCreateTabItem("Ticket Information") $TabSheet2 = GUICtrlCreateTabItem("Update Ticket") $update_tick = GUICtrlCreateButton("Update", 406, 560, 75, 25) $TabSheet3 = GUICtrlCreateTabItem("Edit Customer Information") $update_cust = GUICtrlCreateButton("Update", 406, 560, 75, 25) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) EndFunc ;==>_test
  12. Thank you, monoscout999, Zedna, and smashly for the help and tips, much appreciated!!
  13. Hi, I'm looking for a way to open a new window based on the item I have selected in the listview. I was able to get the doubleclick functionality to work and I can get a msgbox popup to function properly however, when I try to open a new window the application hangs. Any and all help or suggestion on this are greatly appreciated. #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <DateTimeConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include <ListBoxConstants.au3> #include <GuiListView.au3> Local $Company, $email, $phone, $build, $SRS_Ticket, $Ticket_Id, $ticket_select, $close, $update_tick, $update_cust, $ticket_info, $msg, $ticket_list $New_Ticket = GUICreate("View Tickets", 981, 753, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_TABSTOP)) $Menu_file = GUICtrlCreateMenu("File") $Menu_Create = GUICtrlCreateMenuItem("Create New Ticket", $Menu_file) $f_name = GUICtrlCreateInput("", 100, 37, 121, 21) $fn_srch = GUICtrlCreateButton("Search", 221, 37, 75, 21) $l_name = GUICtrlCreateInput("", 100, 77, 121, 21) $ln_srch = GUICtrlCreateButton("Search", 221, 77, 75, 21) $Company = GUICtrlCreateInput("", 100, 117, 121, 21) $comp_srch = GUICtrlCreateButton("Search", 221, 117, 75, 21) $phone = GUICtrlCreateInput("", 100, 157, 121, 21) $phon_srch = GUICtrlCreateButton("Search", 221, 157, 75, 21) $email = GUICtrlCreateInput("", 100, 197, 121, 21) $email_srch = GUICtrlCreateButton("Search", 221, 197, 75, 21) $product = GUICtrlCreateCombo("", 400, 37, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) $prod_srch = GUICtrlCreateButton("Search", 545, 37, 75, 21) $version = GUICtrlCreateCombo("", 400, 77, 40, 25) $version1 = GUICtrlCreateCombo("", 450, 77, 95, 25) $version_srch = GUICtrlCreateButton("Search", 545, 77, 75, 21) $build = GUICtrlCreateInput("", 400, 117, 145, 21) $build_srch = GUICtrlCreateButton("Search", 545, 117, 75, 21) $assigned = GUICtrlCreateCombo("", 400, 157, 145, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) $assign_srch = GUICtrlCreateButton("Search", 545, 157, 75, 21) $SRS_Ticket = GUICtrlCreateInput("", 400, 197, 145, 21) $srs_srch = GUICtrlCreateButton("Search", 545, 197, 75, 21) $Date1 = GUICtrlCreateDate("", 730, 37, 145, 21, $DTS_SHORTDATEFORMAT) $date_srch = GUICtrlCreateButton("Search", 875, 37, 75, 21) $Ticket_Id = GUICtrlCreateInput("", 730, 77, 145, 21) $tick_srch = GUICtrlCreateButton("Search", 875, 77, 75, 21) $Cust_type = GUICtrlCreateCombo("", 730, 117, 145, 25) $cust_srch = GUICtrlCreateButton("Search", 875, 117, 75, 21) $reps = GUICtrlCreateCombo("", 730, 157, 145, 25) $assoc_srch = GUICtrlCreateButton("Search", 875, 157, 75, 21) $Extended = GUICtrlCreateCheckbox("Extended Support", 732, 200, 121, 17) $extend_srch = GUICtrlCreateButton("Search", 875, 197, 75, 21) $Priority = GUICtrlCreateCombo("", 100, 248, 121, 25) $Priority_srch = GUICtrlCreateButton("Search", 221, 247, 75, 21) $Status = GUICtrlCreateCombo("", 400, 248, 145, 25) $Status_srch = GUICtrlCreateButton("Search", 545, 247, 75, 21) $Created_by_combo = GUICtrlCreateCombo("", 730, 248, 145, 25) $created_by_srch = GUICtrlCreateButton("Search", 875, 247, 75, 21) $view_tick = GUICtrlCreateButton("View Ticket", 425, 310, 107, 25) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $reload_list = GUICtrlCreateButton("Reload List", 700, 310, 107, 25) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $new_tick = GUICtrlCreateButton("New Ticket", 150, 310, 107, 25) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $assign = GUICtrlCreateLabel("Assign To", 320, 160, 51, 17) $pdct = GUICtrlCreateLabel("Product", 320, 40, 41, 17) $ver = GUICtrlCreateLabel("Version", 320, 80, 39, 16) $bld = GUICtrlCreateLabel("Build", 320, 120, 75, 17) $SRS = GUICtrlCreateLabel("SRS Ticket #", 320, 200, 69, 17) $mail = GUICtrlCreateLabel("Email", 20, 200, 29, 17) $phon = GUICtrlCreateLabel("Phone #", 20, 160, 45, 17) $comp = GUICtrlCreateLabel("Company", 20, 120, 48, 17) $cus_type = GUICtrlCreateLabel("Customer Type", 650, 120, 75, 17) $rep = GUICtrlCreateLabel("Sales Associate", 650, 160, 79, 17) $name_l = GUICtrlCreateLabel("Last Name", 20, 80, 55, 17) $name_f = GUICtrlCreateLabel("First Name", 20, 40, 54, 17) $tick = GUICtrlCreateLabel("Ticket ID", 650, 77, 48, 17) $Label1 = GUICtrlCreateLabel("Date", 650, 37, 27, 17) $prior = GUICtrlCreateLabel("Priority", 20, 250, 35, 17) $Stat = GUICtrlCreateLabel("Status", 320, 250, 34, 17) $crt_by_lbl = GUICtrlCreateLabel("Created By", 650, 250, 70, 17) GUISetState(@SW_SHOW) _Reset_List() Func _Reset_List() $pos_tick = ControlGetPos("", "", $view_tick) $pos_gui = ControlGetPos("", "", $New_Ticket) If $pos_gui[2] == 987 Then $new_y_pos = $pos_tick[1] + 40 $new_width = $pos_gui[2] - 50 $new_height = $pos_gui[3] - 400 Else If $pos_gui[2] > 987 Then $new_y_pos = $pos_tick[1] + 55 $new_width = $pos_gui[2] - 60 $new_height = $pos_gui[3] - 500 EndIf EndIf $ticket_list = GUICtrlCreateListView("Ticket #", 24, $new_y_pos, $new_width, $new_height) GUICtrlCreateListViewItem("10001", $ticket_list) _GUICtrlListView_RegisterSortCallBack($ticket_list) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") EndFunc ;==>_Reset_List While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $ticket_list _GUICtrlListView_SortItems($ticket_list, GUICtrlGetState($ticket_list)) Case $msg = $view_tick $ticket_select = StringLeft(GUICtrlRead(GUICtrlRead($ticket_list)), 5) If $ticket_select <> 0 Then MsgBox(48, "Ticket Selected", $ticket_select) Else MsgBox(48, "No Ticket Selected", "Please select a ticket to view") EndIf Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg, $iwParam Local $hWndFrom, $iCode, $tNMHDR, $hWndListView, $tInfo $hWndListView = $ticket_list If Not IsHWnd($ticket_list) Then $hWndListView = GUICtrlGetHandle($ticket_list) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button $tInfo = DllStructCreate($tagNMITEMACTIVATE, $ilParam) $ticket_select = _GUICtrlListView_GetItemText($ticket_list, $tInfo) _test() EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func _test() MsgBox(0, "", $ticket_select) $ticket_info = GUICreate("Customer Ticket Information", 864, 639, -1, -1) $Tab_Set = GUICtrlCreateTab(8, 50, 844, 544) $TabSheet1 = GUICtrlCreateTabItem("Ticket Information") $TabSheet2 = GUICtrlCreateTabItem("Update Ticket") $update_tick = GUICtrlCreateButton("Update", 406, 560, 75, 25) $TabSheet3 = GUICtrlCreateTabItem("Edit Customer Information") $update_cust = GUICtrlCreateButton("Update", 406, 560, 75, 25) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $update_tick MsgBox(0, "Ticket info", "Ticket information updated") Case $msg = $update_cust MsgBox(0, "Customer info", "Customer information updated") Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Exit EndFunc ;==>_test
×
×
  • Create New...