News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Weird tooltips behaviour when manifest is included

Started by jj2007, May 17, 2015, 08:00:24 PM

Previous topic - Next topic

jj2007

Chasing this bug took me a long time. I had two versions of a toolbar demo, one behaving nicely, the other showing strange behaviour of Unicode tooltips (tested in XP SP3 and Win7-64):

- they show when you enter the toolbar slowly through a separator, e.g. to the left of the 11th element (the "ticked folder"), and then move left without ever leaving the toolbar zone.
- they don't show if you enter the toolbar from any other direction, except in rare cases.

It turned out the only relevant difference between the two versions is that one had a manifest, the other didn't :(

I am using this structure, but fumbling with it, or using the Windows.inc struc doesn't have any effect.
TOOLINFOW2 STRUCT ; CommCtrl.h
  cbSize DWORD ?
  uFlags DWORD ?
  hWnd DWORD ?
  uId DWORD ?
  rect RECT <>
  hInst DWORD ?
  lpszText DWORD ?
  lParam LPARAM ?
  ; lpReserved DWORD ? no good, makes tooltips show only first character
TOOLINFOW2 ENDS


The manifest is straightforward:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="*"
name="MasmBasic"
type="win32"
/>
<description>Masm32 is great</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>


Does anybody have an application with tooltips to test this further? There is nothing in \Masm32\Examples.

dedndave

which flags did you use with InitCommonControlsEx ?

jj2007


fearless

I have an app that uses a manifest and uses the toolbar with tooltips. I create the toolbar and add it as a child of a rebar control. Tooltips appear to show ok. Only other thing different that i can think of is that i call this:

Invoke SendMessage, hToolBar, CCM_SETVERSION, 5, 0

before adding buttons to the toolbar. Once ive done that i insert a band into my rebar:

    Invoke GetDlgItem, hWin, IDC_RbBIF
    mov hRebarBif, eax
    mov rbbi.cbSize,SIZEOF REBARBANDINFO   
    mov rbbi.fMask,       RBBIM_ID or RBBIM_STYLE or RBBIM_CHILDSIZE or RBBIM_CHILD or RBBIM_SIZE;
    mov rbbi.wID,         IDC_MAINTOOLBAR
    mov rbbi.fStyle,      RBBS_CHILDEDGE or RBBS_TOPALIGN or RBBS_FIXEDSIZE;RBBS_CHILDEDGE or RBBS_FIXEDSIZE RBBS_FIXEDSIZE
    mov rbbi.lx,0
    mov rbbi.cxIdeal, 160
    mov rbbi.cxMinChild,160
    mov rbbi.cyMinChild,24
    mov rbbi.cyChild,24
    mov eax, hToolBar
    mov rbbi.hwndChild,   eax
    invoke SendMessage,hRebarBif,RB_INSERTBAND,0,ADDR rbbi 


Not sure if any of that helps. Here is most of the style settings im using for the rebar:



It also has WS_EX_CONTROLPARENT set

For the toolbar this is the style settings i have:



also WS_CHILD and WS_VISIBLE for both


For InitCommonControlsEx i use these: ICC_COOL_CLASSES or ICC_STANDARD_CLASSES or ICC_WIN95_CLASSES or ICC_BAR_CLASSES

The app im referring to, is this one, WinBif:



Project home: http://www.letthelight.in/projects/released/winbif
Direct download: http://www.letthelight.in/component/jdownloads/finish/24/40?Itemid=0

jj2007


jj2007

Quote from: fearless on May 17, 2015, 10:55:42 PMInvoke SendMessage, hToolBar, CCM_SETVERSION, 5, 0

Without XP manifest, you can set up to version 5 with CCM_SETVERSION
With XP manifest, you cannot go below version 6... and the weird behaviour remains.

jj2007

Only vaguely related but also weird - a one-line resource file:

123 10 Countries.zip ; zipped countries.tab; ID must be in range 1...127

Chokes with error RC2142: ellipsis requires three periods
Take away one dot, i.e. range 1..127, and it works 8)

dedndave

that is odd - lol
you have 2 semicolons on that line - did you try 1 ?

jj2007

Quote from: dedndave on May 24, 2015, 04:35:52 AM
that is odd - lol
you have 2 semicolons on that line - did you try 1 ?

I tried but no change.

sinsi

Aren't comments supposed to be C-like? i.e // instead of ;

jj2007

You are right, Sinsi :t
";" always worked for me, but with // the weird behaviour stops