Click here to Skip to main content
15,895,084 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionDialog text and full cpu capacity Pin
baerten6-Oct-08 3:25
baerten6-Oct-08 3:25 
QuestionRe: Dialog text and full cpu capacity Pin
David Crow6-Oct-08 4:05
David Crow6-Oct-08 4:05 
AnswerRe: Dialog text and full cpu capacity Pin
baerten6-Oct-08 4:21
baerten6-Oct-08 4:21 
QuestionRe: Dialog text and full cpu capacity Pin
David Crow6-Oct-08 4:26
David Crow6-Oct-08 4:26 
AnswerRe: Dialog text and full cpu capacity Pin
baerten6-Oct-08 4:31
baerten6-Oct-08 4:31 
GeneralRe: Dialog text and full cpu capacity Pin
Cedric Moonen6-Oct-08 4:37
Cedric Moonen6-Oct-08 4:37 
GeneralRe: Dialog text and full cpu capacity Pin
David Crow6-Oct-08 4:52
David Crow6-Oct-08 4:52 
QuestionTransparent Control on Gradient Fill Dialog Box.. Pin
gothic_coder6-Oct-08 1:38
gothic_coder6-Oct-08 1:38 
Hi all..

I've one Dialog box in which i fill the background color gradiently using this code...

void GradientFillRect(HDC hdc, LPRECT rcGradient, COLORREF start, COLORREF end, BOOL isVertical)
{
	BYTE startRed = GetRValue(start);
	BYTE startGreen = GetGValue(start);
	BYTE startBlue = GetBValue(start);

	BYTE endRed = GetRValue(end);
	BYTE endGreen = GetGValue(end);
	BYTE endBlue = GetBValue(end);

	HBRUSH endColor = CreateSolidBrush(end);
	FillRect(hdc, rcGradient, endColor);
	DeleteObject(endColor);

	//Gradient line width/height
	int dy = 1;

	int length = (isVertical ? rcGradient->bottom - rcGradient->top : rcGradient->right - rcGradient->left) - dy;

	for (int dn = 0; dn >= length; dn += dy)
	{
		BYTE currentRed = (BYTE)MulDiv(endRed-startRed, dn, length) + startRed;
		BYTE currentGreen = (BYTE)MulDiv(endGreen-startGreen, dn, length) + startGreen;
		BYTE currentBlue = (BYTE)MulDiv(endBlue-startBlue, dn, length) + startBlue;

		RECT currentRect = {0};
		if (isVertical)
		{
			currentRect.left = rcGradient->left;
			currentRect.top = rcGradient->top + dn;
			currentRect.right = currentRect.left + rcGradient->right - rcGradient->left;
			currentRect.bottom = currentRect.top + dy;
		}
		else
		{
			currentRect.left = rcGradient->left + dn;
			currentRect.top = rcGradient->top;
			currentRect.right = currentRect.left + dy;
			currentRect.bottom = currentRect.top + rcGradient->bottom - rcGradient->top;
		}

		HBRUSH currentColor = CreateSolidBrush(RGB(currentRed, currentGreen, currentBlue));
		FillRect(hdc, ¤tRect, currentColor);
		DeleteObject(currentColor);
	}
}



Now i've one picture box using for icon and one static box for some text. So how do i change picture boxes and static control background same as my current color(Gradient Color)..

Thanks all..
AnswerRe: Transparent Control on Gradient Fill Dialog Box.. Pin
gothic_coder6-Oct-08 2:26
gothic_coder6-Oct-08 2:26 
AnswerRe: Transparent Control on Gradient Fill Dialog Box.. Pin
Hamid_RT6-Oct-08 5:06
Hamid_RT6-Oct-08 5:06 
GeneralRe: Transparent Control on Gradient Fill Dialog Box.. Pin
gothic_coder6-Oct-08 20:11
gothic_coder6-Oct-08 20:11 
GeneralRe: Transparent Control on Gradient Fill Dialog Box.. Pin
gothic_coder7-Oct-08 1:12
gothic_coder7-Oct-08 1:12 
Questioncompile error for function InternetOpen Pin
George_George6-Oct-08 1:27
George_George6-Oct-08 1:27 
AnswerRe: compile error for function InternetOpen Pin
_AnsHUMAN_ 6-Oct-08 1:31
_AnsHUMAN_ 6-Oct-08 1:31 
GeneralRe: compile error for function InternetOpen Pin
George_George6-Oct-08 1:51
George_George6-Oct-08 1:51 
AnswerRe: compile error for function InternetOpen Pin
enhzflep6-Oct-08 1:36
enhzflep6-Oct-08 1:36 
GeneralRe: compile error for function InternetOpen Pin
George_George6-Oct-08 1:53
George_George6-Oct-08 1:53 
GeneralRe: compile error for function InternetOpen Pin
Rajesh R Subramanian6-Oct-08 1:59
professionalRajesh R Subramanian6-Oct-08 1:59 
GeneralRe: compile error for function InternetOpen Pin
George_George6-Oct-08 2:01
George_George6-Oct-08 2:01 
Question[Message Deleted] Pin
TALHAKOSEN6-Oct-08 1:09
TALHAKOSEN6-Oct-08 1:09 
AnswerRe: how to get specific textbox hwnd ?? Pin
enhzflep6-Oct-08 1:29
enhzflep6-Oct-08 1:29 
Questionfull code for comparing bitmaps Pin
kaushal kishore sharma6-Oct-08 0:42
kaushal kishore sharma6-Oct-08 0:42 
AnswerRe: full code for comparing bitmaps Pin
Michael Schubert6-Oct-08 0:46
Michael Schubert6-Oct-08 0:46 
GeneralRe: full code for comparing bitmaps Pin
kaushal kishore sharma6-Oct-08 0:51
kaushal kishore sharma6-Oct-08 0:51 
GeneralRe: full code for comparing bitmaps Pin
Rajesh R Subramanian6-Oct-08 0:56
professionalRajesh R Subramanian6-Oct-08 0:56 

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.