[RESOLVED] jcButton Balloon tooltips flicker when themed (manifest) applied-VBForums
Results 1 to 15 of 15

Thread: [RESOLVED] jcButton Balloon tooltips flicker when themed (manifest) applied

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2010
    Posts
    355

    Resolved [RESOLVED] jcButton Balloon tooltips flicker when themed (manifest) applied

    I found a hidden bug in MS tooltips class. If the toolstip set to TTS_BALLOON, the tooltips re-position (twice) in usercontrol only when themed (manifest) applied. But if the tooltips style is standard, the flicker goes off.

    Please refer to my attachment. Compiled first. Run the exe file. Mouse moving over button from top to bottom, you can see balloon tooltips flickering. Is MS wrong or jcButton wrong?

    Name:  jcbutton.jpg
Views: 295
Size:  47.1 KB

    I do think the original CreateToolTips function is ok. The problem is hidden. I haven't found the root cause.

    Code:
    Private Sub CreateToolTip()
    
    '****************************************************************************
    '* A very nice and flexible sub to create balloon tool tips
    '* Author :- Fred.CPP
    '* Added as requested by many users
    '* Modified by me to support unicode
    '* Thanks Alfredo ;)
    '****************************************************************************
    
       Dim lpRect           As RECT
       Dim lWinStyle        As Long
       Dim lPtr             As Long
       Dim ttip             As TOOLINFO
       Dim ttipW            As TOOLINFOW
       Const CS_DROPSHADOW     As Long = &H20000
       Const GCL_STYLE         As Long = (-26)
    
       ' --Dont show tooltips if disabled
       If (Not m_bEnabled) Or m_bPopupShown Or m_Buttonstate = eStateDown Then Exit Sub
    
       ' --Destroy any previous tooltip
       If m_lttHwnd <> 0 Then
          DestroyWindow m_lttHwnd
       End If
    
       lWinStyle = TTS_ALWAYSTIP Or TTS_NOPREFIX
    
       ''create baloon style if desired
       If m_lTooltipType = TooltipBalloon Then lWinStyle = lWinStyle Or TTS_BALLOON
        
       If m_bttRTL Then
          m_lttHwnd = CreateWindowEx(WS_EX_LAYOUTRTL, TOOLTIPS_CLASSA, vbNullString, lWinStyle, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, UserControl.hWnd, 0&, App.hInstance, 0&)
       Else
          m_lttHwnd = CreateWindowEx(0&, TOOLTIPS_CLASSA, vbNullString, lWinStyle, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, UserControl.hWnd, 0&, App.hInstance, 0&)
       End If
       
       SetClassLong m_lttHwnd, GCL_STYLE, GetClassLong(m_lttHwnd, GCL_STYLE) Or CS_DROPSHADOW
    
       'make our tooltip window a topmost window
       ' This is creating some problems as noted by K-Zero
       'SetWindowPos m_lttHwnd, HWND_TOPMOST, 0&, 0&, 0&, 0&, SWP_NOACTIVATE Or SWP_NOSIZE Or SWP_NOMOVE
    
       ''get the rect of the parent control
       GetClientRect UserControl.hWnd, lpRect
    
       If m_WindowsNT Then
          ' --set our tooltip info structure  for UNICODE SUPPORT >> WinNT
          With ttipW
             ' --if we want it centered, then set that flag
             If m_lttCentered Then
                .lFlags = TTF_SUBCLASS Or TTF_CENTERTIP Or TTF_IDISHWND
             Else
                .lFlags = TTF_SUBCLASS Or TTF_IDISHWND
             End If
    
             ' --set the hwnd prop to our parent control's hwnd
             .lHwnd = UserControl.hWnd
             .lId = hWnd
             .lSize = Len(ttipW)
             .hInstance = App.hInstance
             .lpStrW = StrPtr(m_sTooltipText)
             .lpRect = lpRect
          End With
          ' --add the tooltip structure
          SendMessage m_lttHwnd, TTM_ADDTOOLW, 0&, ttipW
       Else
          ' --set our tooltip info structure for << WinNT
          With ttip
             ''if we want it centered, then set that flag
             If m_lttCentered Then
                .lFlags = TTF_SUBCLASS Or TTF_CENTERTIP
             Else
                .lFlags = TTF_SUBCLASS
             End If
    
             ' --set the hwnd prop to our parent control's hwnd
             .lHwnd = UserControl.hWnd
             .lId = hWnd
             .lSize = Len(ttip)
             .hInstance = App.hInstance
             .lpStr = m_sTooltipText
             .lpRect = lpRect
          End With
          ' --add the tooltip structure
          SendMessage m_lttHwnd, TTM_ADDTOOLA, 0&, ttip
       End If
    
       'if we want a title or we want an icon
       If m_sTooltiptitle <> vbNullString Or m_lToolTipIcon <> TTNoIcon Then
          If m_WindowsNT Then
             lPtr = StrPtr(m_sTooltiptitle)
             If lPtr Then
                SendMessage m_lttHwnd, TTM_SETTITLEW, m_lToolTipIcon, ByVal lPtr
             End If
          Else
             SendMessage m_lttHwnd, TTM_SETTITLE, CLng(m_lToolTipIcon), ByVal m_sTooltiptitle
          End If
    
       End If
       SendMessage m_lttHwnd, TTM_SETMAXTIPWIDTH, 0, 240 'for Multiline capability
       If m_lttBackColor <> Empty Then
          SendMessage m_lttHwnd, TTM_SETTIPBKCOLOR, TranslateColor(m_lttBackColor), 0&
       End If
    
    End Sub
    Attached Files Attached Files
    Last edited by Jonney; Jan 16th, 2013 at 11:50 PM. Reason: add attachment

  2. #2
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    3,132

    Re: jcButton Balloon tooltips flicker when themed (manifest) applied

    I get the same glitch in XP even for standard style tooltips. But it's more of a slower blink than a flicker. Don't know if it has something to do with the double subclassing of the UserControl (self-subclass + TTF_SUBCLASS). Haven't pinpointed the root cause yet...
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0

    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2010
    Posts
    355

    Re: jcButton Balloon tooltips flicker when themed (manifest) applied

    Quote Originally Posted by Bonnie West View Post
    I get the same glitch in XP even for standard style tooltips. But it's more of a slower blink than a flicker. Don't know if it has something to do with the double subclassing of the UserControl (self-subclass + TTF_SUBCLASS). Haven't pinpointed the root cause yet...
    The accurate say is that balloon tooltips is 'Re-positioned' when theme applied on Win7. Look like the balloon is just under mousepointer, so the balloon repositions again to leave small distance.

  4. #4
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    3,132

    Re: jcButton Balloon tooltips flicker when themed (manifest) applied

    In any case, it is a tooltip bug in jcButton. Not quite sure yet what it is...
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0

    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2010
    Posts
    355

    Re: jcButton Balloon tooltips flicker when themed (manifest) applied

    Quote Originally Posted by Bonnie West View Post
    In any case, it is a tooltip bug in jcButton. Not quite sure yet what it is...
    Not only jcButton, but also others using balloon tooltips, I suspect there's an issue in MS tooltips class when theme is applied.

    Refer to : http://www.vbforums.com/showthread.p...=1#post4322107
    Last edited by Jonney; Jan 17th, 2013 at 01:03 AM.

  6. #6
    Fanatic Member
    Join Date
    Dec 2008
    Posts
    585

    Re: jcButton Balloon tooltips flicker when themed (manifest) applied

    Are you using Windows 7 ?
    If so then try switching off all the Aero crap (etc).
    If you don't wish to do a global switch off of Aero, then you can tell Win7 to just switch it off for your app.
    If you right click your program's EXE and/or the shortcut to it, you can select Properties, and set the compatibility to XP, and also experiment with the 5 checkboxes in the middle of the dialog.
    PLEASE NOTE You should first tick the checkbox down the bottom that says apply to all users, as that brings up another identical dialog that you should use instead.

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2010
    Posts
    355

    Re: jcButton Balloon tooltips flicker when themed (manifest) applied

    Quote Originally Posted by Bobbles View Post
    Are you using Windows 7 ?
    If so then try switching off all the Aero crap (etc).
    If you don't wish to do a global switch off of Aero, then you can tell Win7 to just switch it off for your app.
    If you right click your program's EXE and/or the shortcut to it, you can select Properties, and set the compatibility to XP, and also experiment with the 5 checkboxes in the middle of the dialog.
    PLEASE NOTE You should first tick the checkbox down the bottom that says apply to all users, as that brings up another identical dialog that you should use instead.
    Don't know what are you talking about.
    With theme applied, The balloon tooltips re-positioned when mouse is moving in the button.

  8. #8
    Fanatic Member
    Join Date
    Dec 2008
    Posts
    585

    Re: jcButton Balloon tooltips flicker when themed (manifest) applied

    Quote Originally Posted by Jonney View Post
    Don't know what are you talking about.
    With theme applied, The balloon tooltips re-positioned when mouse is moving in the button.
    When you say "Don't know what are you talking about" what are you meaning ?
    Are you saying that you do not know about using compatibility settings ?

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2010
    Posts
    355

    Re: jcButton Balloon tooltips flicker when themed (manifest) applied

    Quote Originally Posted by Bobbles View Post
    When you say "Don't know what are you talking about" what are you meaning ?
    Are you saying that you do not know about using compatibility settings ?
    Have you tested my attachment and duplicated the balloon tooltips flickering problem?
    It's a hidden problem. Most of people didn't notice.
    I have tested as you said.Seemed to be nothing about compatibility. Anyway, Thx sir.
    Last edited by Jonney; Jan 17th, 2013 at 11:13 PM. Reason: thanks given Bobbles

  10. #10
    Fanatic Member
    Join Date
    Dec 2008
    Posts
    585

    Re: jcButton Balloon tooltips flicker when themed (manifest) applied

    Are you using Windows 7 ?
    If so then no point in me testing in XP (which I love)
    I do have Win 7 (which I hate) on one PC, but I tried cloning the drive from IDE to SATA and it ain't booting (did I mention that I hate Win 7). I have not gotten around to fixing it yet.
    Which is why I ask, are you using Win7

    Rob
    PS Getting the correct combination of the 5 checkboxes is tricky. Try switching off all the win 7 aero crap, and get it back to Classic. Then see if your problem is gone. If it is gone, then switch all the crap back on, and experiment further with the checkboxes.

    PPS I am popping out to the bank etc. So I am not being rude if I don't answer for a couple of hours.
    Last edited by Bobbles; Jan 17th, 2013 at 11:32 PM. Reason: Added another PPS

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2010
    Posts
    355

    Re: jcButton Balloon tooltips flicker when themed (manifest) applied

    The OS is Win7. I tested on few PC of Win7. The balloon tooltips got the same problem. I don't have WinXP. But I will test it.

    Edited: I tested on Win8 Consumer Preview, the balloon tooltips is perfect without any flickering.

    Conclusion: It's OS problem. Just ignore this annoying issue. (If guru knows the solution, please post here.)

    Thanks all!
    Last edited by Jonney; Jan 18th, 2013 at 01:23 AM. Reason: Win8 OK!!!

  12. #12
    Fanatic Member
    Join Date
    Dec 2008
    Posts
    585

    Re: [RESOLVED] jcButton Balloon tooltips flicker when themed (manifest) applied

    Did you explore win7 settings and turn off all the crap, and then run your program ?

  13. #13

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2010
    Posts
    355

    Re: [RESOLVED] jcButton Balloon tooltips flicker when themed (manifest) applied

    Quote Originally Posted by Bobbles View Post
    Did you explore win7 settings and turn off all the crap, and then run your program ?
    We want to slove the problem, not to hide problem. We can't expect users do the same thing.

    Thank you for help.

  14. #14
    Fanatic Member
    Join Date
    Dec 2008
    Posts
    585

    Re: [RESOLVED] jcButton Balloon tooltips flicker when themed (manifest) applied

    I am getting annoyed.
    I had to ask some questions many times, before getting answers.
    You don't take time to fully read our questions/suggestions, and to action/answer them.
    I am not telling you to get your users to turn of Aero etc. I am suggesting that you do it to help narrow down if Win7's aero etc is clashing with your user control.
    And after you have done that, you turn it on again. Then you experiment further with the checkboxes etc in compatibility . (you gave no details as to how what you did when you tried compatibility )
    Your short ill thought out responses are extremely annoying.
    We are trying to help, and you are glossing over things.

  15. #15

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2010
    Posts
    355

    Re: [RESOLVED] jcButton Balloon tooltips flicker when themed (manifest) applied

    I have tested as you said.Seemed to be nothing about compatibility. Anyway, Thx sir.
    I also disable on Aero on desktop and also check on "disable visual theme' for the exe file and blablah, The problem is the same. (Win7)
    But on win8, balloon tooltips is OK.

    You mentioned you got XP, please help to test.

    I have tested other commercial ActiveX controls with tooltips, the balloon is also flickering on Win7.
    The flickering has more chance if you fast move in a series controls (few controls lay vertically) as my above screenshot
    Last edited by Jonney; Jan 18th, 2013 at 07:52 AM. Reason: more content

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.