Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I'm trying to get in WinAPI the same style like in the search control of firefox, this grey text with the name of the search engine which disappears when you click on it. I found Edit_SetCueBannerText(), included the requierd comctrl.h, but when I compile it I get this error:

`Edit_SetCueBannerText' undeclared

What can I do?
Thanks a lot
Posted

As you can see on the documentation of the Edit_SetCueBannerText Macro (Windows)[^], to use te macro your application should target at least Windows XP or Windows Server 2003.

Then, accordingly with the documntation at Using The Windows Headers (Windows)[^], you should add the lines below to your source code, before than including any system header:

<br />
#if !defined(WINVER)<br />
#define WINVER 0x0501 // Target Windows XP or later<br />
#endif<br />
<br />
#if !defined(_WIN32_WINNT)<br />
#define _WIN32_WINNT 0x0501 // Target Windows XP or later<br />
#endif<br />



You also need to setup the manifest of your application to target the Common Controls version 6.0 (i.e. Comctl32.dll version 6.0).
 
Share this answer
 
Comments
Ajay Vijayvargiya 27-Sep-10 14:39pm    
See if EM_SETCUEBANNER message-code is available for your code. This is due to macros described by Sauro above. Ensure you defined those macros BEFORE anything else in your code/project.
Sauro Viti 27-Sep-10 15:02pm    
When using precompiled headers, the right place where put them is in the head of the stdafx.h file...
it didn't work, same error again.
the manifest created Dev C++ automatically, this is it:
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
  xmlns="urn:schemas-microsoft-com:asm.v1"
  manifestVersion="1.0">
<assemblyIdentity
    name="DevCpp.Apps.WakeUp"
    processorArchitecture="x86"
    version="1.0.0.0"
    type="win32"/>
<description>test</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="x86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>


could be anything wrong with it?
 
Share this answer
 
Comments
Sauro Viti 27-Sep-10 15:01pm    
The manifest seems to be right, however problems with the manifest could generate errors at runtime. Problems at compile time like undefined symbols are commonly due to wrong usage of the Windows headers. If you are using precompiled headers check for the defines I wrote above in your stdafx.h
gaaaary 27-Sep-10 15:30pm    
sounds crazy, but Dev Cpp doesn't have a stdafx.h file

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900