hello , does any one know the style or extended style to make the windows xp button styles(bubble style) in win32 api
hello , does any one know the style or extended style to make the windows xp button styles(bubble style) in win32 api
Unfortunately its a little more difficult than just adding a style (which is what I had hoped you could do initialy!). You need to include a windows manifest file as a resource and init the common controls. There is a brief link here describing the process. If you have any other troubles getting it to work, come back and ask.
Last edited by dalek; 05-26-2004 at 03:33 AM.
ok thanks for that.gave me a clear understanding 1 thing.
how do i include this in a C , win32 api program.thanks
Using Windows XP Visual Styles
Perhaps the quickest/shortest route is to link with comctl32.lib, use InitCommonControlsEx and include the manifest file in the same directory as the executable. For example:Build that and call the exe 'manifest_demo.exe' then save the following as manifest_demo.exe.manifest in the same directory:Code:#include <windows.h> #include <tchar.h> #if defined __MINGW_H #define _WIN32_IE 0x0400 #endif #include <commctrl.h> /*link with comctl32.lib (-lcomctl32 with DevCpp(MinGW))*/ int WINAPI _tWinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance, LPTSTR lpCmdLine,int nCmdShow) { INITCOMMONCONTROLSEX iccx; iccx.dwSize=sizeof(INITCOMMONCONTROLSEX); iccx.dwICC=0; InitCommonControlsEx(&iccx); MessageBox(0, _T("Don't forget to include your xp manifest\nin the same directory as this exe."), _T("XP Manifest Styles"), MB_OK); return 0; }Code:<?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="X86" name="CompanyName.ProductName.manifest_demo.exe" type="win32" /> <description>Your application description here.</description> <dependency> <dependentAssembly> <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency> </assembly>
Last edited by Ken Fitlike; 05-26-2004 at 06:14 AM.
CProgramming FAQ
Caution: this person may be a carrier of the misinformation virus.
hmm theres only 1 problem thou.if u dont have the manifest file there it doesnt work
any one know how to fix this?
This is what i do..
1. Create a custom resource called "RT_MANIFEST" without quotes.
2. Name the resource "1" without quotes.
3. Paste in the xml code Ken gave you.
4. Save & Recompile.
You still need to use the common controls as stated in previous posts.
ok im not sure what im doing wrong but i cant get it to work
Paste this into your resource file:
where YourApp.exe.manifest refers to the manifest file you created as per Ken's post. (This is essentially what Marc was describing).Code:#ifndef RT_MANIFEST #define RT_MANIFEST 24 #endif #ifndef CREATEPROCESS_MANIFEST_RESOURCE_ID #define CREATEPROCESS_MANIFEST_RESOURCE_ID 1 #endif CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "YourApp.exe.manifest"
ok thanks...only problem now is that lcc-win32 says its impossible to read the rc file
Apparently, lcc does not support RT_MANIFEST. You can grab the free Resource Hacker to add your manifest to the exe.
its not thats its not reading the manifest its that it isnt read the rc files
its wierd never happened before
Hey,
For Starters i'm using Dev-cpp.
I can get the manifest file to work the only problem is that the manifest all ways has to be in teh diretory with the program is there away to make the manifest say become a resourse in the project its self thus being able to chaneg directorys?
Thanks.