#include <GuiToolbar.au3>
#include <GuiMenu.au3>
#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Constants.au3>
#include <ImageListConstants.au3>
#include <GuiMenu.au3>
#include<SecurityConstants.au3>
#include <GuiImageList.au3>
Local $hToolbar, $hMenu
Local Enum $idNew = 1000, $idOpen
$hGUI = GUICreate("Toolbar", 323,47 , Default, Default,Bitor($WS_CAPTION,$WS_SYSMENU))
$ImageList1 = _GUIImageList_Create(16 ,16, 5)
$ico=_GUIImageList_AddIcon($ImageList1, "G:\网盘\My DBank\网址ico\迅雷.ico", 0, True)
$Input = GUICtrlCreateInput("",55, 3, 201, 42)
GUICtrlSetFont(-1, 20, 400, 0, "Arial")
$Button = GUICtrlCreateButton("搜索", 257, 2, 65, 43)
$hToolbar = _GUICtrlToolbar_Create($hGUI)
$sousuo1 = _GUICtrlToolbar_AddString($hToolBar, "迅雷")
_GUICtrlToolbar_SetExtendedStyle($hToolbar, $TBSTYLE_EX_DRAWDDARROWS)
_GUICtrlToolbar_SetImageList($hToolBar, $ImageList1)
_GUICtrlToolbar_AddButton($HToolBar, 0,$ico , 0, $BTNS_DROPDOWN)
GUISetState()
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
Local $tNMHDR, $iCode, $hMenu,$baidu
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$iCode = DllStructGetData($tNMHDR, "Code")
If $iCode = $TBN_DROPDOWN Then
$hMenu = _GUICtrlMenu_CreatePopup()
_GUICtrlMenu_AddMenuItem($hMenu, "谷歌",$baidu)
_GUICtrlMenu_AddMenuItem($hMenu, "百度")
_GUICtrlMenu_AddMenuItem($hMenu, "雅虎")
_GUICtrlMenu_AddMenuItem($hMenu,"必应")
_GUICtrlMenu_AddMenuItem($hMenu, "")
_GUICtrlMenu_AddMenuItem($hMenu, "迅雷")
_GUICtrlMenu_AddMenuItem($hMenu,"电驴")
_GUICtrlMenu_TrackPopupMenu($hMenu, $hGUI)
_GUICtrlMenu_DestroyMenu($hMenu)
EndIf
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
当我切换到百度的时候。。如何响应事件。。。。。搜索了论坛。。好像没找到。。。- -,试过几个,。。好像没响应