Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

PHRICTION

WinXP Theme Trouble

This topic is 5632 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I cannot get the XP visual style to work in my app. I followed the direction. Added the manifest file, etc. But it still didn''t work. I am not really sure where to call InitCommonControls() though. I was during WM_CREATE, is this correct? I could post my code, but I''m not sure what parts. Does anyone have any ideas? And, yes, I am running XP. phriction

Share this post


Link to post
Share on other sites
Advertisement
1: "doesn''t work" has zero userful information. you need to post more details than that.

2: you need to call initommoncontrols before you create any window, that is, before any createwindow[ex] calls.

Share this post


Link to post
Share on other sites
Sorry. I will elaborate.
It is a super simple app with nothing but a few push buttons.
I am trying to get them to use the XP theme. All I get is the standard gray rectangles.

I just tried calling InitCommonControls before CreateWindow, and it did''nt seem to help.

I included to commctrl.h at the top, linked to ComCtl32.lib, called InitCommonControls() in WinMain right before CreateWindows for the main window. I have my manifest file linked and it has no trouble finding it.

Any other ideas?

phriction

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
here''s what i did to get it to work:

* put a call to InitCommonControls in your WinMain, before any windows are created.

* insert a custom resource into your project. it should have a resource type of 24 (just the number 24, no quotes.)

* edit the properties of the newly created resource and change its id to 1. (just the number 1, no quotes.) you can also give the resource''s file a different name if you want. it doesn''t have to have a .manifest extension.

* now go to the page in the docs where the example manifest is and copy it. paste this into your 24/1 resource. then modify it so that the appropriate parts are specific to your app.

* rebuild and run the app. all of the controls should then be using the current theme.

Share this post


Link to post
Share on other sites
Now this is weird. I did what you said Niyaw, and now I''m getting:
error LNK2001: unresolved external symbol __imp__InitCommonControlsEx@4

I didn''t change that call at all, and I can go to the definition of the function.

Any ideas?

(brooding)
Why couldn''t they just put in some new functions or something...
(/brooding)
phriction

Share this post


Link to post
Share on other sites
Include comctl32.lib in your project.

#pragma comment(lib,"comctl32.lib")

is a real elegant way to do it right in your source if you're using MS compilers....

EDIT: Just read you had already done that. Might still try the #pragma if possible, looks like your project settings might be goofed. If nothing else just do a rebuild all. Sometimes that fixes flaky stuff.

[edited by - SilentReaper on January 23, 2003 5:13:33 PM]

Share this post


Link to post
Share on other sites
DOH!
Forget that post.

I guess I didn''t have ComCtl32.lib linked in the debug profile.
Stupid me! It works now. Thank you for the help.

phriction

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!