Posted May 24, 201213 yr I'd like to retrieve all the windows having same class name "tooltips_class32"I used the win32 API function:hwndFound = FindWindowEx(NULL, NULL, "tooltips_class32", NULL);However, I could get only one window.Question is how to get all windows having the same class name.Another question is how to get the tooltip text?Using GetWindowText API, right?Thank you!
May 24, 201213 yr Author I used EnumWindow to retrieve all tooltip windows.Now the question is how to get the tooltip text given its HWND handle?I used TTM_GETTOOLINFO, but received nothing.#include <windows.h>#include <commctrl.h>void GetToolTipText(HWND hTooltip){ char szBuf[1024]={0}; TOOLINFO ti; ti.cbSize = sizeof(ti); ti.hwnd = GetParent(hTooltip); ti.uId = GetDlgCtrlID(hTooltip); ti.lpszText = szBuf; SendMessage(hTooltip, TTM_GETTOOLINFO, 0, (LPARAM)&ti); if(MessageBox(0, ti.lpszText, "tooltip", MB_YESNO) == IDNO) exit(0);} Edited May 24, 201213 yr by alaphate
May 27, 201213 yr From a question I just read at stackOverflow (http://stackoverflow.com/questions/1333770/how-to-get-tooltip-text-for-a-given-hwnd) I'd imagine that you should send TTM_GETTEXT to the tool-tip windows.See more here: http://msdn.microsoft.com/en-us/library/bb760393%28VS.85%29.aspx (particularly, be careful on XP and below - there's no way to get or control the length of the returned text)
May 28, 201213 yr Author enhzflep,Thank you for replying my questions. You are awesome!The idea came from a tooltip fixer using:nircmd win settopmost class “tooltips_class32″ 1nircmd is nirsoft's command line toolWhen tooltip text is hidden by taskbar in windows xp.Now I can retrieve the id of tooltip control's, however, some id is zero.Still no tooltip text is retrieved.attachment is c++ source code.ThankstooltipText.zip Edited May 28, 201213 yr by alaphate
May 28, 201213 yr enhzflep,Thank you for replying my questions. You are awesome!The idea came from a tooltip fixer using:nircmd win settopmost class “tooltips_class32″ 1nircmd is nirsoft's command line toolWhen tooltip text is hidden by taskbar in windows xp.Now I can retrieve the id of tooltip control's, however, some id is zero.Still no tooltip text is retrieved.attachment is c++ source code.ThanksTry postmessage instead of sendmessage Api..
May 28, 201213 yr enhzflep,Thank you for replying my questions. You are awesome!The idea came from a tooltip fixer using:nircmd win settopmost class “tooltips_class32″ 1nircmd is nirsoft's command line toolWhen tooltip text is hidden by taskbar in windows xp.Now I can retrieve the id of tooltip control's, however, some id is zero.Still no tooltip text is retrieved.attachment is c++ source code.ThanksTry postmessage instead of sendmessage Api..
Create an account or sign in to comment