|
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]
|
|
|
|
|
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche
.·´¯`·->Rajesh<-·´¯`·.
[Microsoft MVP - Visual C++]
|
|
|
|
|
Damnit, you're so fast!
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]
|
|
|
|
|
pallini..thnx..but i need a full running code for comparing 2 bitmaps..
i have posted my code but i cant understand what is wrong in my code...
can you help please..
1.
void CPixelView::OnDraw(CDC* pDC)
{
CPixelDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
{
COLORREF color[255][255],color1[255][255];
CBitmap bitmap,bitmap1;
CString file1,file2,strText;
file1.Format("C:\\1.bmp");
file2.Format("C:\\3.bmp");
CDC dcMemory,dcMemory1;
int r[255][255],R[255][255];
// 1st image HBITMAP hBitmap1 = (HBITMAP)::LoadImage(NULL,file1,IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE );//| LR_CREATEDIBSECTION);
//2nd image HBITMAP hBitmap2 = (HBITMAP)::LoadImage(NULL,file2,IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE );
// Attach the loaded image to the CBitmap object.
bitmap.Attach(hBitmap1);
bitmap1.Attach(hBitmap2);
dcMemory.CreateCompatibleDC(pDC);
dcMemory.SelectObject(&bitmap);
dcMemory1.CreateCompatibleDC(pDC);
dcMemory1.SelectObject(&bitmap1);
pDC->BitBlt(0,0,200,200,&dcMemory,0,0,SRCCOPY);
pDC->BitBlt(0,0,300,700,&dcMemory1,0,0,SRCCOPY);
//for all the pixels
for(int i=0;i<48;i++)
{
for(int j=0;j<48;j++)
{
HDC hDC = ::GetDC(this->GetSafeHwnd());
color[i][j] = ::GetPixel(hDC,i,j);
::ReleaseDC(this->GetSafeHwnd(), hDC);
r[i][j]=GetRValue(color[i][j]);
HDC hDC1 = ::GetDC(this->GetSafeHwnd());
color1[i][j] = ::GetPixel(hDC1,i,j);
::ReleaseDC(this->GetSafeHwnd(), hDC1);
R[i][j]=GetRValue(color1[i][j]);
}
}//got the pixel values
}
}
|
|
|
|
|
kaushal kishore sharma wrote: allini..thnx..but i need a full running code for comparing 2 bitmaps
He just posted the code.
|
|
|
|
|
Well, you're "getting there";
Me thing you do not need to keep arrays of COLORREF or the r and R arrays
You should be able to get the size of the bitmaps dynamically (because a bitmap of 48 pixel is really small)
No need to get the DC twice.
Now that you have the color for the same pixel position in both bitmaps; what should you be doing with them ? compare them ? maybe ?
This signature was proudly tested on animals.
|
|
|
|
|
thank you for the reply.
can you tell how to make changes in the code. I am studying VC++ so not too much knowledge about the language.So can you help me with the code.
Yes i am comparing both bitmap for checking whether both images are same or different.
Thank You
kaushal kishore Sharma
kaushal..
|
|
|
|
|
Ingenious.
|
|
|
|
|
And can we use of this code for other formats like jpg?
|
|
|
|