Click here to Skip to main content
16,019,435 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Gradient background to all the dialog boxes and non client area Pin
Sameer_Thakur21-Feb-07 4:45
Sameer_Thakur21-Feb-07 4:45 
GeneralRe: Gradient background to all the dialog boxes and non client area Pin
toxcct21-Feb-07 4:46
toxcct21-Feb-07 4:46 
GeneralRe: Gradient background to all the dialog boxes and non client area Pin
Sameer_Thakur21-Feb-07 4:52
Sameer_Thakur21-Feb-07 4:52 
GeneralRe: Gradient background to all the dialog boxes and non client area Pin
Hamid Taebi21-Feb-07 5:37
professionalHamid Taebi21-Feb-07 5:37 
GeneralRe: Gradient background to all the dialog boxes and non client area Pin
Mark Salsbery21-Feb-07 8:26
Mark Salsbery21-Feb-07 8:26 
GeneralRe: Gradient background to all the dialog boxes and non client area Pin
toxcct21-Feb-07 8:55
toxcct21-Feb-07 8:55 
GeneralRe: Gradient background to all the dialog boxes and non client area Pin
Mark Salsbery21-Feb-07 9:03
Mark Salsbery21-Feb-07 9:03 
QuestionUpdateLayeredWindow() doesn't work Pin
Toubou21-Feb-07 2:38
Toubou21-Feb-07 2:38 
Hi,

UpdateLayeredWindow() returned error "The parameter is incorrect", I tried to use AlphaBlend() that use similar parameters and it works fine

Here is the code:
	this->ModifyStyleEx(0, WS_EX_LAYERED);

//---- Generate 32bpp bitmap
	BITMAPINFO bmi;
	memset(&bmi, 0, sizeof(BITMAPINFO));
	bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
	bmi.bmiHeader.biPlanes = 1;
	bmi.bmiHeader.biWidth = 255;
	bmi.bmiHeader.biHeight = 255;
	bmi.bmiHeader.biBitCount = 32;

	unsigned char* bits;

	HDC hdc = CreateCompatibleDC(::GetDC(0));
	HBITMAP hbmp = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, (void**)&bits, 0, 0);
	SelectObject(hdc, (HBITMAP)hbmp);
	
	char alp = 0;
	for (int j=0; j<255; j++){
		unsigned char* vertbits = bits + j*255*4;
		for (int i=0; i<255*4; i+=4){
			vertbits[i+0] = 255 * alp / 255;
			vertbits[i+1] = 0;
			vertbits[i+2] = 255 * alp / 255;
			vertbits[i+3] = alp;
			alp++; alp%=256;
		}
	}
//----


	BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA};
	SIZE s = {255,255};
	POINT p = {0,0};
	BOOL res = ::UpdateLayeredWindow(m_hWnd, ::GetDC(0), 0, &s, hdc, &p, 0, &bf, ULW_ALPHA); //<-- ERROR HERE
	//AlphaBlend(GetDC()->m_hDC, 0, 0, 255, 255, hdc, 0,0,255,255,bf );

AnswerRe: UpdateLayeredWindow() doesn't work Pin
prasad_som21-Feb-07 3:23
prasad_som21-Feb-07 3:23 
GeneralRe: UpdateLayeredWindow() doesn't work Pin
Toubou21-Feb-07 4:39
Toubou21-Feb-07 4:39 
Answer*Solved* Pin
Toubou21-Feb-07 5:04
Toubou21-Feb-07 5:04 
QuestionQuerry regarding DoModal Pin
Vikram.....21-Feb-07 2:29
Vikram.....21-Feb-07 2:29 
AnswerRe: Querry regarding DoModal Pin
Cedric Moonen21-Feb-07 2:44
Cedric Moonen21-Feb-07 2:44 
GeneralRe: Querry regarding DoModal Pin
Vikram.....21-Feb-07 3:05
Vikram.....21-Feb-07 3:05 
QuestionRe: Querry regarding DoModal Pin
David Crow21-Feb-07 3:21
David Crow21-Feb-07 3:21 
Question[Message Deleted] Pin
Newbie0021-Feb-07 4:06
Newbie0021-Feb-07 4:06 
AnswerRe: Querry regarding DoModal Pin
David Crow21-Feb-07 4:09
David Crow21-Feb-07 4:09 
AnswerRe: Querry regarding DoModal Pin
toxcct21-Feb-07 4:10
toxcct21-Feb-07 4:10 
AnswerRe: [Message Deleted] Pin
ThatsAlok21-Feb-07 6:22
ThatsAlok21-Feb-07 6:22 
GeneralRe: [Message Deleted] Pin
Hamid Taebi21-Feb-07 7:11
professionalHamid Taebi21-Feb-07 7:11 
GeneralRe: [Message Deleted] Pin
Newbie0021-Feb-07 23:27
Newbie0021-Feb-07 23:27 
GeneralRe: [Message Deleted] Pin
ThatsAlok22-Feb-07 0:00
ThatsAlok22-Feb-07 0:00 
QuestionHow to draw a bitmap on top of button? Pin
Igor Jerosimic21-Feb-07 1:27
Igor Jerosimic21-Feb-07 1:27 
AnswerRe: How to draw a bitmap on top of button? Pin
Naveen21-Feb-07 1:44
Naveen21-Feb-07 1:44 
GeneralRe: How to draw a bitmap on top of button? Pin
Igor Jerosimic21-Feb-07 2:03
Igor Jerosimic21-Feb-07 2:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.