Jump to content

problem with GUIGetMsg


Sl4yer
 Share

Recommended Posts

What are you truing to do?

$state = WinGetState ("wnd title")
msgbox(0, "", $state)
hi Zedna,

i'm within a function and i created a new window which i want to closed when clicked on the x button on the right top corner but the window doesn't return the $GUI_EVENT_CLOSE

Edited by Sl4yer
Link to comment
Share on other sites

Your code:

;msgbox(0, "", WinGetState ("Suchergebnis"))
                       ;_ArrayDisplay(GUIGetMsg(1))

                                                While GUIGetMsg(1) <> $GUI_EVENT_CLOSE
                            local $getCurSelection = _GUICtrlListViewGetCurSel($reslistView)
                                                        If _GUICtrlListViewGetCurSel($reslistView) = 1 Then
                                $curSelectedItemText = _GUICtrlListViewGetItemText($reslistView, _GUICtrlListViewGetSelectedIndices($reslistView), 1)
                                RunWait(@ComSpec & ' /c explorer "' & $curSelectedItemText & '\"', "", @SW_HIDE)
                                _GUICtrlListViewSetItemSelState ($reslistView, _GUICtrlListViewGetSelectedIndices($reslistView), 0, 0)
                            EndIf
                        WEnd

Correct code:

;msgbox(0, "", WinGetState ("Suchergebnis"))
                       ;_ArrayDisplay(GUIGetMsg(1))

                                                While 1
  $msg2 = GUIGetMsg(1)
  if $msg2[0] = $GUI_EVENT_CLOSE     And $msg2[1] = $resWnd Then
    GuiDelete($resWnd)
    ExitLoop
End If

                            local $getCurSelection = _GUICtrlListViewGetCurSel($reslistView)
                                                        If _GUICtrlListViewGetCurSel($reslistView) = 1 Then
                                $curSelectedItemText = _GUICtrlListViewGetItemText($reslistView, _GUICtrlListViewGetSelectedIndices($reslistView), 1)
                                RunWait(@ComSpec & ' /c explorer "' & $curSelectedItemText & '\"', "", @SW_HIDE)
                                _GUICtrlListViewSetItemSelState ($reslistView, _GUICtrlListViewGetSelectedIndices($reslistView), 0, 0)
                            EndIf
                        WEnd
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...