Ветеран
Сообщения: 604
Благодарности: 133
|
Профиль
|
Отправить PM
| Цитировать
amel27
Посмотри, если будет время:
Код: 
#include <WindowsConstants.au3>
#include <ToolTipConstants.au3>
Global Const $CW_USEDEFAULT = 0x80000000
Global Const $TOOLTIPS_CLASSA = "tooltips_class32"
Global $hToolTip
$hGUI = GUICreate("Test GUI", 300, 200)
$hToolTip = DllCall("user32.dll", "hwnd", "CreateWindowEx", "int", $WS_EX_TOPMOST, "str", $TOOLTIPS_CLASSA, _
"str", 0, "int", BitOR($WS_POPUP, $TTS_ALWAYSTIP), "int", $CW_USEDEFAULT, _
"int", $CW_USEDEFAULT, "int", $CW_USEDEFAULT, "int", $CW_USEDEFAULT, "hwnd", $hGUI, "hwnd", 0, _
"hwnd", 0, "ptr", 0)
$hToolTip = $hToolTip[0]
$TestButton = GUICtrlCreateButton("Test", 105, 50, 75, 25)
_ToolTipCreate(GUICtrlGetHandle($TestButton), "Its a Test button")
$OkButton = GUICtrlCreateButton("Ok", 105, 100, 75, 25)
_ToolTipCreate(GUICtrlGetHandle($OkButton), "Its a Ok button")
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
GUISetState()
While 1
$msg = GUIGetMsg()
Switch $msg
Case -3
ExitLoop
EndSwitch
WEnd
Func _ToolTipCreate($sUid, $sText)
Local $tRect = DllStructCreate("int Left;int Top;int Right;int Bottom")
DllCall("user32.dll", "int", "GetClientRect", "hwnd", $sUid, "ptr", DllStructGetPtr($tRect))
Local $tBuffer = DllStructCreate("char[256]")
DllStructSetData($tBuffer, 1, $sText)
Local $TOOLINFO = DllStructCreate("int cbSize;int uFlags;hwnd hWnd;int uId;int rect[4];hwnd hinst;" & _
"ptr lpszText;int lParam;ptr lpReserved")
DllStructSetData($TOOLINFO, "cbSize", DllStructGetSize($TOOLINFO))
DllStructSetData($TOOLINFO, "uFlags", BitOR($TTF_CENTERTIP, $TTF_SUBCLASS))
DllStructSetData($TOOLINFO, "hWnd", $hGUI)
DllStructSetData($TOOLINFO, "uId", $sUid)
DllStructSetData($TOOLINFO, "rect", DllStructGetData($tRect, "Left"), 1)
DllStructSetData($TOOLINFO, "rect", DllStructGetData($tRect, "Top"), 2)
DllStructSetData($TOOLINFO, "rect", DllStructGetData($tRect, "Right"), 3)
DllStructSetData($TOOLINFO, "rect", DllStructGetData($tRect, "Bottom"), 4)
DllStructSetData($TOOLINFO, "hinst", 0)
DllStructSetData($TOOLINFO, "lpszText", 0)
DllStructSetData($TOOLINFO, "lParam", 0)
DllStructSetData($TOOLINFO, "lpReserved", 0)
DllCall("user32.dll", "int", "SendMessage", "hwnd", $hToolTip, "int", $TTM_ADDTOOL, "int", 0, _
"ptr", DllStructGetPtr($TOOLINFO))
EndFunc
Func RGB2BGR($iColor)
Return BitAND(BitShift(String(Binary($iColor)), 8), 0xFFFFFF)
EndFunc ;==>RGB2BGR()
Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam)
Local $tNMHDR, $hWndFrom, $iCode
$tNMHDR = DllStructCreate("hwnd hWndFrom;int IdFrom;int Code", $lParam)
$hWndFrom = DllStructGetData($tNMHDR, "hWndFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
If $iCode = $TTN_GETDISPINFO Then ConsoleWrite($iCode & @LF)
Return "GUI_RUNDEFMSG"
EndFunc
Пытаюсь получить уведомление TTN_GETDISPINFO, но безуспешно
Инфа
|