Sign in to follow this  

Icon button

This topic is 4840 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'm trying to create a button control with a transparent icon overlay in a c++ application that is using the xp visual style. However, when I set the icon parameter of the button control using the BM_SETIMAGE message the button is rendered as a flat windows 98 style button. What's the easiest way of creating a xp style button with a transparent icon overlay? I've been trying to use NM_CUSTOMDRAW to paint the icon onto the button but it wont send the CDDS_POSTPAINT draw state message. Here's the code that I'm using:
	case WM_NOTIFY:
		{
		LPNMHDR pNMHDR = (LPNMHDR)lParam;

		switch(pNMHDR->code) {
		case NM_CUSTOMDRAW:
			LPNMCUSTOMDRAW pNMCustomDraw = (LPNMCUSTOMDRAW)lParam;
			
			switch(pNMCustomDraw->dwDrawStage) {
			case CDDS_PREPAINT:
				return CDRF_NOTIFYPOSTPAINT;
			case CDDS_POSTPAINT:
				//Paint icon
			}
		}

		break;
		}
Does anyone know a solution to this/what's causing it?

Share this post


Link to post
Share on other sites

This topic is 4840 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this