Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to get all windows handles having same class name?

Featured Replies

Posted

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!

  • 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 by alaphate

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)

  • 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″ 1

nircmd is nirsoft's command line tool

When 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.

Thanks

tooltipText.zip

Edited by alaphate

enhzflep,

Thank you for replying my questions. You are awesome!

The idea came from a tooltip fixer using:

nircmd win settopmost class “tooltips_class32″ 1

nircmd is nirsoft's command line tool

When 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.

Thanks

Try postmessage instead of sendmessage Api..

enhzflep,

Thank you for replying my questions. You are awesome!

The idea came from a tooltip fixer using:

nircmd win settopmost class “tooltips_class32″ 1

nircmd is nirsoft's command line tool

When 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.

Thanks

Try postmessage instead of sendmessage Api..

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.