Jump to content

MarkLee

Members
  • Posts

    16
  • Joined

  • Last visited

Everything posted by MarkLee

  1. @Nine Your code is great. Thank you for helping. You rock!.
  2. I'm trying to fix my code but still not working. #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #include <GuiListView.au3> Global $idListview, $idItem1, $mON, $mOFF, $mEdit, $mAdd, $mDel $iLVStyle = BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS) $iLVExtStyle = BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT) Example() Func Example() GUICreate("listview items", 220, 250, -1, -1, -1, $WS_EX_ACCEPTFILES) GUISetBkColor(0x00E0FFFF) ; will change background color $idListview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150, $iLVStyle, $iLVExtStyle) ;,$LVS_SORTDESCENDING) $idItem1 = GUICtrlCreateListViewItem("item1|col22|ON", $idListview) Local $idItem2 = GUICtrlCreateListViewItem("item2|col12|OFF", $idListview) Local $idItem3 = GUICtrlCreateListViewItem("item3|col32|ON", $idListview) Local $idItem4 = GUICtrlCreateListViewItem("item4|col14|OFF", $idListview) $Menu = GUICtrlCreateContextMenu($idListview) $mDel = GUICtrlCreateMenuItem("Delete", $Menu) ;~ GUICtrlSetState(-1, $GUI_DISABLE) $mEdit = GUICtrlCreateMenuItem("Edit", $Menu) ;~ GUICtrlSetState(-1, $GUI_DISABLE) $mAdd = GUICtrlCreateMenuItem("Add", $Menu) ;~ GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateMenuItem("", $Menu) $mON = GUICtrlCreateMenuItem("ON", $Menu) ;~ GUICtrlSetState(-1, $GUI_DISABLE) $mOFF = GUICtrlCreateMenuItem("OFF", $Menu) ;~ GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop ;~ EndSwitch WEnd EndFunc ;==>Example Func ListView_RClick() Local $sSelLine = _GUICtrlListView_GetSelectedIndices($idListview, True) If $sSelLine[0] = 1 Then GUICtrlSetState($mON, _GUICtrlListView_GetItemText($idListview, $sSelLine[1], 2) = "ON" ? $GUI_DISABLE : $GUI_ENABLE) GUICtrlSetState($mOFF, _GUICtrlListView_GetItemText($idListview, $sSelLine[1], 2) = "OFF" ? $GUI_DISABLE : $GUI_ENABLE) ElseIf $sSelLine[0] > 1 Then GUICtrlSetState($mEdit, $sSelLine[0] > 1 ? $GUI_DISABLE : $GUI_ENABLE) Else GUICtrlSetState($mDel,$sSelLine[0] = 0 ? $GUI_DISABLE: $GUI_ENABLE) GUICtrlSetState($mEdit,$sSelLine[0] = 0 ? $GUI_DISABLE : $GUI_ENABLE) GUICtrlSetState($mON, $sSelLine[0] = 0 ? $GUI_DISABLE: $GUI_ENABLE) GUICtrlSetState($mOFF,$sSelLine[0] = 0 ? $GUI_DISABLE: $GUI_ENABLE) EndIf ;~ Return $aHit[0] EndFunc Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo $hWndListView = $idListview If Not IsHWnd($idListview) Then $hWndListView = GUICtrlGetHandle($idListview) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) ;$iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_RCLICK ; Sent by a list-view control when the user clicks an item with the left mouse button ;~ msgbox(0, "", "22") ListView_RClick() ;~ Return 0 EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY
  3. @NIce: I'm using WM_NOTIFY handler and _GUICtrlListView_GetSelectedIndices func but not working like pic4. This my code: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #include <GuiListView.au3> Global $idListview, $idItem1, $mON, $mOFF, $mEdit, $mAdd, $mDel $iLVStyle = BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS) $iLVExtStyle = BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT) Example() Func Example() GUICreate("listview items", 220, 250, -1, -1, -1, $WS_EX_ACCEPTFILES) GUISetBkColor(0x00E0FFFF) ; will change background color $idListview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150, $iLVStyle, $iLVExtStyle) ;,$LVS_SORTDESCENDING) $idItem1 = GUICtrlCreateListViewItem("item1|col22|ON", $idListview) $idItem2 = GUICtrlCreateListViewItem("item2|col12|OFF", $idListview) $idItem3 = GUICtrlCreateListViewItem("item3|col32|ON", $idListview) $idItem4 = GUICtrlCreateListViewItem("item4|col14|OFF", $idListview) $Menu = GUICtrlCreateContextMenu($idListview) $mDel = GUICtrlCreateMenuItem("Delete", $Menu) ;~ GUICtrlSetState(-1, $GUI_DISABLE) $mEdit = GUICtrlCreateMenuItem("Edit", $Menu) ;~ GUICtrlSetState(-1, $GUI_DISABLE) $mAdd = GUICtrlCreateMenuItem("Add", $Menu) ;~ GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateMenuItem("", $Menu) $mON = GUICtrlCreateMenuItem("ON", $Menu) ;~ GUICtrlSetState(-1, $GUI_DISABLE) $mOFF = GUICtrlCreateMenuItem("OFF", $Menu) ;~ GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop ;~ EndSwitch WEnd EndFunc ;==>Example Func ListView_RClick() Local $sSelLine = _GUICtrlListView_GetSelectedIndices($idListview) If ($sSelLine) <> "" Then GUICtrlSetState($mON, _GUICtrlListView_GetItemText($idListview, Number($sSelLine), 2) == "ON" ? $GUI_DISABLE : $GUI_ENABLE) GUICtrlSetState($mOFF, _GUICtrlListView_GetItemText($idListview, Number($sSelLine), 2) == "OFF" ? $GUI_DISABLE : $GUI_ENABLE) $cou = _GUICtrlListView_GetSelectedCount($idListview) GUICtrlSetState($mEdit, $cou >= 2 ? $GUI_DISABLE : $GUI_ENABLE) Else GUICtrlSetState($mDel,$sSelLine = "" ? $GUI_DISABLE: $GUI_ENABLE) GUICtrlSetState($mEdit,$sSelLine = "" ? $GUI_DISABLE : $GUI_ENABLE) GUICtrlSetState($mON, $sSelLine = "" ? $GUI_DISABLE: $GUI_ENABLE) GUICtrlSetState($mOFF,$sSelLine = "" ? $GUI_DISABLE: $GUI_ENABLE) EndIf ;~ Return $aHit[0] EndFunc Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam) Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo $hWndListView = $idListview If Not IsHWnd($idListview) Then $hWndListView = GUICtrlGetHandle($idListview) $tNMHDR = DllStructCreate($tagNMHDR, $ilParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) ;$iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_RCLICK ; Sent by a list-view control when the user clicks an item with the left mouse button ;~ msgbox(0, "", "22") ListView_RClick() ;~ Return 0 EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY
  4. @FrancescoDiMuro Thank you for replying. This is my demo code: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsConstants.au3> #include <ListViewConstants.au3> #include <GuiListView.au3> $iLVStyle = BitOR($LVS_REPORT, $LVS_SHOWSELALWAYS) $iLVExtStyle = BitOR($WS_EX_CLIENTEDGE, $LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT) Example() Func Example() GUICreate("listview items", 220, 250, -1, -1, -1, $WS_EX_ACCEPTFILES) GUISetBkColor(0x00E0FFFF) ; will change background color Local $idListview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150, $iLVStyle, $iLVExtStyle) ;,$LVS_SORTDESCENDING) Local $idItem1 = GUICtrlCreateListViewItem("item1|col22|ON", $idListview) Local $idItem2 = GUICtrlCreateListViewItem("item2|col12|OFF", $idListview) Local $idItem3 = GUICtrlCreateListViewItem("item3|col32|ON", $idListview) $Menu = GUICtrlCreateContextMenu($idListview) $mDel = GUICtrlCreateMenuItem("Delete", $Menu) ;~ GUICtrlSetState(-1, $GUI_DISABLE) $mEdit = GUICtrlCreateMenuItem("Edit", $Menu) ;~ GUICtrlSetState(-1, $GUI_DISABLE) $mAdd = GUICtrlCreateMenuItem("Add", $Menu) ;~ GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateMenuItem("", $Menu) $mON = GUICtrlCreateMenuItem("ON", $Menu) ;~ GUICtrlSetState(-1, $GUI_DISABLE) $mOFF = GUICtrlCreateMenuItem("OFF", $Menu) ;~ GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop ;~ Case $idButton ;~ MsgBox($MB_SYSTEMMODAL, "listview item", GUICtrlRead(GUICtrlRead($idListview)), 2) Case $idListview ;~ MsgBox($MB_SYSTEMMODAL, "listview", "clicked=" & GUICtrlGetState($idListview), 2) EndSwitch WEnd EndFunc ;==>Example
  5. Hi guys !. I'm created context menu items: Delete Edit Add ------------ ON OFF I want to do the following: + If right-click on a listview's item only --> detect a text in COL3 is 'ON' or 'OFF' --> if it is ON then set the context item ON to disabled, if it is OFF then set the context item OFF to disabled. (Pic1 and Pic 2). + If selected multi-row (pic 3) --> 'ON' and 'Edit' set to disabled. + If selected multi-row (pic 4) --> 'Edit' set to disabled. +If right-click without listview's item --> 'Add' context item only set to enabled (pic 5) Sorry sorry. My English is bad.
  6. I wish i using FF.au3 can closing any alert box. How do i can working it
  7. Thanks for reply. I am using FF version 44.0 and MOZREPL actived. I try run that script. It cant close dialog box. Can you run that script example ? sr my english. Thank
  8. I try test _FFDialogWait() example. It not working. How to fix ? #Include <FF.au3> _FFConnect() If _FFIsConnected() Then _FFOpenURL("http://ff-au3-example.thorsten-willert.de/") _FFImageClick("test_bild_1", "alt") Sleep(3000) ; to see the alert _FFDialogWait("bild") MsgBox(64,"","Alert closed ...") EndIf Thanks.
  9. How to get count tabs ? Please help me !. Thanks.
  10. _SysTrayIconHide not working in Windows XP
  11. How to check connection status a site ? sr . My bad English.
  12. No no. I want press Enter key from FF.au3 UDF. Thanks for reply.
  13. I trying _FFCmd("evnt = window.document.createEvent('KeyboardEvent');evnt.initKeyEvent('keypress', true, true, window, false, false, false, false, 13,13);window.document.getElementById('masthead-search-term').dispatchEvent(evnt);")
  14. This is code for address bar on web browser. javascript:{var evnt = window.document.createEvent('KeyboardEvent');evnt.initKeyEvent('keypress', true, true, window, false, false, false, false, 13, 13);window.document.getElementById('masthead-search-term').dispatchEvent(evnt);void(0)} How convert to _FFcmd ? thanks very much!
  15. Hi. I trying submit from recaptcha form. Please help me. This is my code: <snip> Thank.
×
×
  • Create New...