Jump to content
  • Advertisement
Sign in to follow this  
MagiXSphere

Icon button

This topic is 5486 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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!