NO

Author Topic: Edit_SetCueBannerText and EM_SETCUEBANNER are not working (Pelles C bug?)  (Read 7730 times)

Snowman

  • Guest
I use Windows XP 32-bit and Pelles C 8.00.60.

In my program, I want to enable a "cue banner text" for the edit controls. A cue text is gray text that disappears when the user starts to input data; modern web browsers often use this to show the name of the search engine. Even Internet Explorer 8 does it.

According to MSDN this can be done by using the Edit_SetCueBannerText macro or by sending the EM_SETCUEBANNER message:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb761701%28v=vs.85%29.aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/bb761639%28v=vs.85%29.aspx

The problem is that neither works for me! Is there a bug in my code? Is this a bug in Pelles C?

Or is this feature unsupported on Windows XP -- if so, how come Skype and Internet Explorer 8 can use it just fine?

Attached below is the source code and compiled executable.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2112
First check your ComCtl32.dll version.
May the source be with you

Snowman

  • Guest
First check your ComCtl32.dll version.
Using the program you attached: 6.0.2900.6028.
Maybe my project's manifest is wrong?

Offline jj2007

  • Member
  • *
  • Posts: 536
I've tested it with my own templates, and indeed, it will not work without an XP manifest.

Snowman

  • Guest
I've tested it with my own templates, and indeed, it will not work without an XP manifest.
Could you please attach the manifest file for which the cue text feature works for you?
Then I will try that manifest on my previously attached project.

Offline jj2007

  • Member
  • *
  • Posts: 536
Here it is.

Snowman

  • Guest
Thanks but unfortunately it still doesn't work for me. What version of Windows are you using, is it XP?

Offline jj2007

  • Member
  • *
  • Posts: 536
OK, I resuscitated my old XP machine: doesn't work, even with a manifest. What is most irritating is that SendMessage and GetLastError insist that everything is just fine. But it isn't.
Conclusion: Works fine with Win7 and a manifest that specifies common controls version 6, otherwise not. I suggest to set the text manually, and clear it when the control gets the focus for the first time.

P.S.: Fascinating ... note this refers to combobox, not edit control:
Quote
You need to use EM_SETCUEBANNER As Integer = &H1501 for XP and CB_SETCUEBANNER As UInteger = &H1703 for Windows 7.

Check this also:
Quote
The problem in Windows XP isn’t that the cue banner shows up in an East Asian Language; it’s that if an East Asian language pack is installed, then the cue banner doesn’t show up at all

Could be the reason why it doesn't show on my old machine, because it does have an East Asian Language pack.
« Last Edit: June 20, 2015, 09:32:11 PM by jj2007 »

Snowman

  • Guest
Could be the reason why it doesn't show on my old machine, because it does have an East Asian Language pack.
Thanks, uninstalling the East Asian language support was the solution for me. It is pathetic of Microsoft that they haven't fixed this bug in all these years, while XP was still being supported.