回复 11# cashiba
請直接 點擊 COMBO 下拉三角形 多次 即可看到成效
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.8.1
Author: myName
Script Function:
Template AutoIt script.
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
#include <WinAPI.au3>
#include <GuiComboBox.au3>
#include <Array.au3>
#include <GuiButton.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $sComboRead
GUIRegisterMsg($WM_COMMAND, "WM_COMMAND")
Local $hGUI = GUICreate("表", 360, 180, -1, -1)
Local $hCombo = GUICtrlCreateCombo("", 10, 20,200,30)
Local $hButnf = GUICtrlCreateButton("搜索", 285, 15, 60,30)
Local $iClose = GUICtrlCreateButton("??", 285,135,60, 35)
GUISetState()
;--------------------------------------------------------------------------------------------------------------------
_SendMessage($hCombo, 0x14B)
Local $prr = ProcessList()
For $i = 1 To $prr[0][0]
_GUICtrlComboBox_AddString($hCombo,$prr[$i][0])
Next
$CHECK=0
;--------------------------------------------------------------------------------------------------------------------
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE, $iClose
ExitLoop
Case $hCombo
Case $hButnf
F)
EndSwitch
WEnd
Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg, $iwParam, $ilParam
Local $hWndFrom, $iIDFrom, $iCode
;$hWndFrom = $hWnd
$hWndFrom = $ilParam
$iIDFrom =_WinAPI_LoWord($iwParam);獲取低位 $iControl = BitAND($iwParam, 0xFFFF)
$iCode = _WinAPI_HiWord($iwParam);獲取高位 $iMsg = BitShift($iwParam, 16)
IF $iCode=7 Then
IF $CHECK=1 Then
GUICtrlSetData($hCombo, "", "")
GUICtrlSetData($hCombo, "重新搜索1|重新搜索2", "重新搜索2")
$CHECK=0
Else
$CHECK=1
GUICtrlSetData($hCombo, "", "")
Local $prr = ProcessList()
For $i = 1 To $prr[0][0]
_GUICtrlComboBox_AddString($hCombo,$prr[$i][0])
Next
EndIf
EndIf
Return $GUI_RUNDEFMSG
EndFunc ;==>_WM_COMMAND
|