怎样实现在ico控件上响应右键
#include <GUIConstantsEx.au3>#include <ListViewConstants.au3>
#include <WindowsConstants.au3>
#include <GUIListView.au3>
$Form1 = GUICreate("Form1", 410, 310)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
$ListView1 = GUICtrlCreateListView("||", 8, 8, 400, 210)
$ico = GUICtrlCreateIcon("shell32.dll",3,100,230)
GUISetState(@SW_SHOW)
For $I = 1 To 10
GUICtrlCreateListViewItem($I, $ListView1)
Next
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
Func WM_NOTIFY($hWndGUI, $MsgID, $WParam, $LParam)
Local $tagNMHDR, $Event, $hWndFrom, $IDFrom
Local $tagNMHDR = DllStructCreate("int;int;int", $LParam)
If @error Then Return $GUI_RUNDEFMSG
$IDFrom = DllStructGetData($tagNMHDR, 2)
$Event = DllStructGetData($tagNMHDR, 3)
$tagNMHDR = 0
Switch $IDFrom;选择产生事件的控件
Case $ListView1
Switch $Event; 选择产生的事件
Case $NM_DBLCLK ; 双击
$Index = _GUICtrlListView_GetSelectedIndices($ListView1)
If Not StringLen($Index) Then; 这里用以判断是否选定了ListViewItem
MsgBox(0, "", "未选定")
Return
EndIf
MsgBox(0,0, _GUICtrlListView_GetItemText($ListView1, Number($Index), 0))
EndSwitch
Case $ico
Switch $Event; 选择产生的事件
Case $NM_DBLCLK ; 双击
MsgBox(0,"","点不出")
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
我找了论坛里的代码改了下,但是他原来的listview可以响应右键,我自己加的ico控件怎么就不行了 SETUP()
Func SETUP()
_IEErrorHandlerRegister()
Local $oIE = _IECreateEmbedded(), $oIE1 = _IECreateEmbedded()
GUICreate("xxxxx", 900, 300, -1, -1)
GUICtrlCreateObj($oIE, 0, 0, 400, 300)
GUISetState()
_IENavigate($oIE, "http://xy2.163.com/")
MsgBox(64, "求高手指教", "点击后如何从右边窗口显示出来 不要弹出网站来")
ControlClick("xxxxx", "", "Internet Explorer_Server1", "left", 1, 66, 98)
GUICtrlCreateObj($oIE1, 450, 0, 400, 300)
_IENavigate($oIE1, "http://xy2.163.com/")
EndFunc ;==>SETUP
IE事件的问题 点击IE后新窗口如何激活到右边的GUI界面
页:
[1]