In my program I have window with several toolbars that have to show tooltips on its buttons.
As long as the tooltips are dynamical, I am handling the TTN_NEEDTEXTW following way:
1. Send message TTM_GETCURRENTTOOLW to the tooltip control in NMHDR.hwndFrom reveived. 2. Determine from which toolbar the notification comes by using TOOLINFO.hwnd returned. 3. Generate the tooltip text and set the TOOLTIPTEXTW.lpszText to point to the generated text. 4. Return
This procedure works in Windows, but not in WINE. In WINE, TTM_GETCURRENTTOOLW always returns FALSE. And there is no other way to determine which of the toolbars generated this message. (or at least I don't know it).
Any ideas about some workaround?
On Mon, Sep 19, 2016 at 09:30:20PM +0300, John Found wrote:
In my program I have window with several toolbars that have to show tooltips on its buttons.
As long as the tooltips are dynamical, I am handling the TTN_NEEDTEXTW following way:
- Send message TTM_GETCURRENTTOOLW to the tooltip control in NMHDR.hwndFrom reveived.
- Determine from which toolbar the notification comes by using TOOLINFO.hwnd returned.
- Generate the tooltip text and set the TOOLTIPTEXTW.lpszText to point to the generated text.
- Return
This procedure works in Windows, but not in WINE. In WINE, TTM_GETCURRENTTOOLW always returns FALSE.
That message in Wine should only return FALSE in a few scenarios:
http://source.winehq.org/git/wine.git/blob/5a9f7ef06df15e26acf46b0210dd76973...
Check that your cbSize member is valid, and if so, maybe look into why Wine doesn't think there is a tool currently selected.
Andrew
On Mon, 19 Sep 2016 13:39:27 -0500 Andrew Eikum aeikum@codeweavers.com wrote:
On Mon, Sep 19, 2016 at 09:30:20PM +0300, John Found wrote:
In my program I have window with several toolbars that have to show tooltips on its buttons.
As long as the tooltips are dynamical, I am handling the TTN_NEEDTEXTW following way:
- Send message TTM_GETCURRENTTOOLW to the tooltip control in NMHDR.hwndFrom reveived.
- Determine from which toolbar the notification comes by using TOOLINFO.hwnd returned.
- Generate the tooltip text and set the TOOLTIPTEXTW.lpszText to point to the generated text.
- Return
This procedure works in Windows, but not in WINE. In WINE, TTM_GETCURRENTTOOLW always returns FALSE.
That message in Wine should only return FALSE in a few scenarios:
http://source.winehq.org/git/wine.git/blob/5a9f7ef06df15e26acf46b0210dd76973...
Check that your cbSize member is valid, and if so, maybe look into why Wine doesn't think there is a tool currently selected.
Andrew
What is the values of TTTOOLINFOW_V1_SIZE and TTTOOLINFOW_V2_SIZE? I tried to search for them, but there is some very obfuscated C code... :'(
I am using a structure with size = 28h = 40 bytes
struct TOOLINFO .cbSize dd ? .uFlags dd ? .hwnd dd ? .uId dd ? .Rect RECT .hInst dd ? .lpszText dd ? ends
It seems that Windows accepts it, but WINE not.
On Mon, Sep 19, 2016 at 09:56:59PM +0300, John Found wrote:
On Mon, 19 Sep 2016 13:39:27 -0500 Andrew Eikum aeikum@codeweavers.com wrote:
On Mon, Sep 19, 2016 at 09:30:20PM +0300, John Found wrote:
In my program I have window with several toolbars that have to show tooltips on its buttons.
As long as the tooltips are dynamical, I am handling the TTN_NEEDTEXTW following way:
- Send message TTM_GETCURRENTTOOLW to the tooltip control in NMHDR.hwndFrom reveived.
- Determine from which toolbar the notification comes by using TOOLINFO.hwnd returned.
- Generate the tooltip text and set the TOOLTIPTEXTW.lpszText to point to the generated text.
- Return
This procedure works in Windows, but not in WINE. In WINE, TTM_GETCURRENTTOOLW always returns FALSE.
That message in Wine should only return FALSE in a few scenarios:
http://source.winehq.org/git/wine.git/blob/5a9f7ef06df15e26acf46b0210dd76973...
Check that your cbSize member is valid, and if so, maybe look into why Wine doesn't think there is a tool currently selected.
Andrew
What is the values of TTTOOLINFOW_V1_SIZE and TTTOOLINFOW_V2_SIZE? I tried to search for them, but there is some very obfuscated C code... :'(
I am using a structure with size = 28h = 40 bytes
Wrote a quick test and they seem to be 0x28 and 0x2c respectively, so I guess that's not your problem.
Andrew
On Mon, 19 Sep 2016 14:01:21 -0500 Andrew Eikum aeikum@codeweavers.com wrote:
Wrote a quick test and they seem to be 0x28 and 0x2c respectively, so I guess that's not your problem.
Andrew
BTW, I tested with pointer set to 0 and still have return value of FALSE, so according to the source you posted, it seems that `infoPtr->nCurrentTool == -1` for this tooltip control.
The control is created automatically by the toolbar. Here is the code that create the toolbar (some labels are arguments of the whole function):
; Create toolbar xor esi,esi invoke GetModuleHandleW,esi mov edi, eax invoke CreateWindowExW, esi, cToolbarClassName, NULL, \ WS_CHILD or \ WS_VISIBLE or \ WS_CLIPSIBLINGS or \ WS_CLIPCHILDREN or \ TBSTYLE_TRANSPARENT or \ TBSTYLE_FLAT or \ TBSTYLE_TOOLTIPS or \ TBSTYLE_WRAPABLE, \ esi, esi, esi, esi, \ [.ParentWindow], [.ToolbarID], \ edi, NULL mov ebx,eax stdcall SubclassWindow, ebx, CoolToolbarProc invoke SetPropW, ebx, [propAutoSize], TRUE
invoke SendMessageW, ebx, TB_BUTTONSTRUCTSIZE, TToolbarButton.size, esi
; make arrows for dropdown buttons invoke SendMessageW, ebx, TB_GETEXTENDEDSTYLE, esi, esi or eax,TBSTYLE_EX_DRAWDDARROWS invoke SendMessageW, ebx, TB_SETEXTENDEDSTYLE, esi, eax
; Set image lists invoke SendMessageW, ebx, TB_SETIMAGELIST, esi, [.ImagesNormal] invoke SendMessageW, ebx, TB_SETDISABLEDIMAGELIST, esi, [.ImagesDisabled]
; make tooltip to appear on not active main window. invoke SendMessageW, ebx, TB_GETTOOLTIPS, 0, 0 mov esi, eax invoke GetWindowLongW, esi, GWL_STYLE or eax, TTS_ALWAYSTIP or TTS_NOPREFIX invoke SetWindowLongW, esi, GWL_STYLE, eax ; Set tooltip delay time. invoke SendMessageW, esi, TTM_SETDELAYTIME, TTDT_AUTOMATIC, 600
On Monday, 19 September 2016, John Found johnfound@asm32.info wrote:
In my program I have window with several toolbars that have to show tooltips on its buttons.
As long as the tooltips are dynamical, I am handling the TTN_NEEDTEXTW following way:
- Send message TTM_GETCURRENTTOOLW to the tooltip control in
NMHDR.hwndFrom reveived. 2. Determine from which toolbar the notification comes by using TOOLINFO.hwnd returned. 3. Generate the tooltip text and set the TOOLTIPTEXTW.lpszText to point to the generated text. 4. Return
This procedure works in Windows, but not in WINE. In WINE, TTM_GETCURRENTTOOLW always returns FALSE. And there is no other way to determine which of the toolbars generated this message. (or at least I don't know it).
Any ideas about some workaround?
Hi, John.
Please open a bug report and attach sample application code there or at least a relevant part of it, so we can turn it into a test. Workarounds are not interesting for Wine.
-- http://fresh.flatassembler.net http://asm32.info John Found <johnfound@asm32.info javascript:;>
On Mon, 19 Sep 2016 21:43:14 +0300 Nikolay Sivov bunglehead@gmail.com wrote:
Hi, John.
Please open a bug report and attach sample application code there or at least a relevant part of it, so we can turn it into a test. Workarounds are not interesting for Wine.
Bug submitted: #41370; With links to the source code revealing it.
Your turn, dear WINE developers. :)
Best regards.
P.S. I actually found some workaround - simply to not use TTM_GETCURRENTTOOL and to identify the tool only by the NMHDR.idFrom received in the notification. :P