Собственно для начала сам пример показываюший что по сути нужно.
Нужно получить тоже-самое только от другого окна/программы от -
может с использованием
или подругому, немогу понять ни как сам.
Может есть какие предложения или примеры?
Код:
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
Global $hListView, $Status
Local $GUI
Local $exStyles = BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_TRACKSELECT)
$GUI = GUICreate("ListView Set Hover Time", 400, 300)
$hListView = GUICtrlCreateListView("", 2, 2, 394, 268)
_GUICtrlListView_SetHoverTime($hListView, 10)
_GUICtrlListView_SetExtendedListViewStyle($hListView, $exStyles)
$hListView = GUICtrlGetHandle($hListView)
$Status = _GUICtrlStatusBar_Create($GUI, -1, "")
GUISetState()
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
; Add columns
_GUICtrlListView_AddColumn($hListView, "Column 1", 100)
_GUICtrlListView_AddColumn($hListView, "Column 2", 100)
_GUICtrlListView_AddColumn($hListView, "Column 3", 100)
_GUICtrlListView_InsertItem($hListView, "Row 1: Col 1")
_GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 2", 1)
_GUICtrlListView_AddSubItem($hListView, 0, "Row 1: Col 3", 2)
_GUICtrlListView_InsertItem($hListView, "Row 2: Col 1")
_GUICtrlListView_AddSubItem($hListView, 1, "Row 2: Col 2", 1)
_GUICtrlListView_InsertItem($hListView, "Row 3: Col 1")
_GUICtrlListView_InsertItem($hListView, "Row 4: Col 1")
_GUICtrlListView_InsertItem($hListView, "Row 5: Col 1")
;~ _GUICtrlListView_SetHoverTime($hListView, 10)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
GUIDelete()
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
$hWndListView = $hListView
If Not IsHWnd($hListView) Then $hWndListView = GUICtrlGetHandle($hListView)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndListView
Switch $iCode
Case $LVN_HOTTRACK ; Sent by a list-view control when the user moves the mouse over an item
$tInfo = DllStructCreate($tagNMLISTVIEW, $ilParam)
#cs
_DebugPrint("$LVN_HOTTRACK" & @LF & "--> hWndFrom:" & @TAB & $hWndFrom & @LF & _
"-->IDFrom:" & @TAB & $iIDFrom & @LF & _
"-->Code:" & @TAB & $iCode & @LF & _
"-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @LF & _
"-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @LF & _
"-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @LF & _
"-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @LF & _
"-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @LF & _
"-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @LF & _
"-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @LF & _
"-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
#Ce
ListView_HOTTRACK(DllStructGetData($tInfo, "SubItem"))
Return 0 ; allow the list view to perform its normal track select processing.
;Return 1 ; the item will not be selected.
EndSwitch
EndSwitch
;~ Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
Func _DebugPrint($s_text, $line = @ScriptLineNumber)
ConsoleWrite( _
"!===========================================================" & @LF & _
"+======================================================" & @LF & _
"-->Line(" & StringFormat("%04d", $line) & "):" & @TAB & $s_text & @LF & _
"+======================================================" & @LF)
EndFunc ;==>_DebugPrint
Func ListView_HOTTRACK($iSubItem)
Local $HotItem = _GUICtrlListView_GetHotItem($hListView)
If $HotItem <> -1 Then _GUICtrlStatusBar_SetText($Status, @TAB & "Hot Item: " & $HotItem & " SubItem: " & $iSubItem)
EndFunc ;==>ListView_HOTTRACK
Нужно получить тоже-самое только от другого окна/программы от -
Код:
$hCHandle = ControlGetHandle("[CLASS:#32770]", "", "[TEXT:Процессы]") ;Это диспетчер задач
Код:
$GetMessage = DllCallbackRegister("_GetMessage", "int", "int;ptr;ptr")
$hHook = _WinAPI_SetWindowsHookEx($WH_GETMESSAGE, DllCallbackGetPtr($GetMessage), _WinAPI_GetModuleHandle(0), 0)
Может есть какие предложения или примеры?