|
Hi, thanks for your answer, but this doesn't resolve the problem.
I tried also: RedrawWindow, BringWindowToTop, ShowWindow(SW_SHOW),Invalidate, ...
But no effect
|
|
|
|
|
Where did you interject those at?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
In "OnInitDialog" ... it's the "farest" code after a dialog is initialized or?
Big thanks for your help
|
|
|
|
|
If you sleep inside your main thread, the GUI will be frozen because you don't process GUI messages anymore. That's also the reason why you don't see the two first texts. For this purpose, you should use a timer, this will be much better.
|
|
|
|
|
I meant in relation to the other code you showed.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
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);
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..
|
|
|
|
|
Static Box problem is gone..
case WM_CTLCOLORSTATIC:
{
HBRUSH hbr;
SetBkMode((HDC)wParam, TRANSPARENT);
hbr=(HBRUSH)GetStockObject(NULL_BRUSH);
return (LONG)hbr;
}
What message should i handle to make my picture box transparent?? In which i'm drawing icon???
|
|
|
|
|
|
This only works on Static controls.. Which i've already done.. Can some one show some light how to make picture Box treansparent in which i'm dispalying icon??
|
|
|
|
|
Changed My code something like this..
case WM_CTLCOLORSTATIC:
{
HDC hdc = (HDC) wParam;
HWND hwndStatic = (HWND) lParam;
HBRUSH hbrBkcolor = (HBRUSH)GetStockObject(NULL_BRUSH);
if (hwndStatic == GetDlgItem(hWnd, IDC_ICON))
{
SetBkMode ( hdc, TRANSPARENT );
return (LRESULT) hbrBkcolor;
}
if (hwndStatic == GetDlgItem(hWnd, IDC_TEXT1))
{
SetBkMode(hdc, TRANSPARENT);
return (LRESULT) hbrBkcolor;
}
break;
}
But no success..What am i doing wrong??
|
|
|
|
|
Hello everyone,
What is wrong with my simple code below? I have tried to figure it out in 40 minutes, but failed.
1>main.cpp
1>c:\program files\microsoft sdks\windows\v6.0a\include\wininet.h(58) : error C2146: syntax error : missing ';' before identifier 'HINTERNET'
1>c:\program files\microsoft sdks\windows\v6.0a\include\wininet.h(58) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\wininet.h(58) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\wininet.h(59) : error C2143: syntax error : missing ';' before '*'
1>c:\program files\microsoft sdks\windows\v6.0a\include\wininet.h(59) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\program files\microsoft sdks\windows\v6.0a\include\wininet.h(59) : error C2378: 'HINTERNET' : redefinition; symbol cannot be overloaded with a typedef
#include <wininet.h>
int main()
{
InternetOpen ("Test Agent", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
return 0;
}
thanks in advance,
George
|
|
|
|
|
Do you link to Wininet.lib?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
It is a compile error, I never link. I think during compile phase, import library is never used. Correct?
Actually, I have added Wininet.lib to Project --> Properties --> Linker --> Input --> Additional Dependencies. Is that the correct place?
regards,
George
|
|
|
|
|
Compiles fine here
MinGW 3.4.5
Have you tried including windows.h before wininet.h?
I've had errors similar to those before when including in the wrong order or
not including something explicitly (which in the end just affects include order)
|
|
|
|
|
Thanks, after including windows.h before wininet.h, the compile passed. So weird.
Here is the compile pass code.
#include <windows.h>
#include <wininet.h>
int main()
{
InternetOpen ("Test Agent", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
return 0;
}
regards,
George
|
|
|
|
|
George_George wrote: So weird.
Actually, there's nothing weird. To start with it, the first error message that you got was:
1>c:\program files\microsoft sdks\windows\v6.0a\include\wininet.h(58) : error C2146: syntax error : missing ';' before identifier 'HINTERNET'
When you open the error location, you find this:
typedef LPVOID HINTERNET;
So, the error clearly suggests that LPVOID is not being recognized as anything at all - a semicolon is expected there. If you try to locate the definition of LPVOID, it is within WinDef.h
But, WinDef.h is included in Windows.h - so, Windows.h must be included before wininet.h
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Cool man!
regards,
George
|
|
|
|
|
|
Just wondering why we should help you to set the text for an edit-box in a keygen?
Try typing "Adobe Creative Suite 2 by cvs/SSG" into google and checking the results.
|
|
|
|
|
can anyone send me full code for comparing two bitmaps...
thank you..
|
|
|
|
|
No problem. What's your preferred method of payment? PayPal?
|
|
|
|
|
sry my friend..
i have account on paypal but i have not done any work yet due to busy in college..but if you can provide me the code for this i will be very thankful to you..
rest is your wish..thanks for the reply..
|
|
|
|
|
Read the guidelines[^] before you make another post.
For once, what is pissing me off is your TXSTPK. Stop using SMS language here. Hundreds of people read it every day. So, act like a professional.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Rajesh R Subramanian wrote: For once, what is pissing me off is your TXSTPK
You forgot the ASAP and URGENTZZ
|
|
|
|
|
if (bitmap1 == bitmap2)
BTW Don't forget to visit www.cpallini.freeproductz.com for more free 'full code'.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|