Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Googler


Сообщения: 3665
Благодарности: 1563

Профиль | Отправить PM | Цитировать


Creat0R
может через GUIRegisterMsg() типа такого?
Код: Выделить весь код
#include <GUIConstants.au3>
#include <A3LConstants.au3>
#include <GuiTreeView.au3>

Opt("GuiOnEventMode", 1)

$Gui = GUICreate("Test", 300, 200)
GUISetOnEvent(-3, "OnExit")
$nTreeView = GUICtrlCreateTreeView(20, 20)
$hTreeView = IDToHwnd($Gui, $nTreeView)
$nTV1_ID = _GUICtrlTreeViewInsertItem($nTreeView,"Inserted1")
$nTV2_ID = _GUICtrlTreeViewInsertItem($nTreeView,"Inserted2")

GUIRegisterMsg ($WM_NOTIFY, "TV_Event")
GUISetState()

While 1
    Sleep(100)
WEnd

Func TV_Event($hWnd, $Msg, $wParam, $lParam)
    If $Msg = $WM_NOTIFY Then
        Local $NMHDR = DllStructCreate("hwnd;uint;short", $lParam)
        If DllStructGetData($NMHDR, 1)=$hTreeView And DllStructGetData($NMHDR,3)=-451 Then
            ConsoleWrite(_GUICtrlTreeViewGetTree($nTreeView,'\')&@CRLF)
        EndIf
    EndIf
    Return $GUI_RUNDEFMSG
 EndFunc

Func OnExit()
    Exit
EndFunc

Func HwndToID($hControlID)
    $iRet = DllCall("user32.dll", "int", "GetDlgCtrlID", "hwnd", $hControlID)
    Return $iRet[0]
EndFunc

Func IDToHwnd($hWnd, $CtrlID)
    $iRet = DllCall("user32.dll", "int", "GetDlgItem", "hwnd", $hWnd, "int", $CtrlID)
    Return $iRet[0]
EndFunc
З.Ы. я уже сталкивался ранее с контролами без ControlID при установке специфического софта... вот я с ними тогда помучился... собсно из-за них и пришлось лезть в дебри
Это сообщение посчитали полезным следующие участники:

Отправлено: 12:44, 29-10-2007 | #654