Re: [win32] - transparent and opacy
Quote:
Originally Posted by
2kaud
You have checked, haven't you, that GetSize() and GetPosition() are returning the expected values?
yes.. i have tested now:
Code:
struct Position
{
int X;
int Y;
};
struct Size
{
int Width;
int Height;
};
Position GetPosition()
{
RECT LabelSize;
GetWindowRect(hwnd,&LabelSize);
Position crdSize = {LabelSize.left,LabelSize.top};
return crdSize;
}
Size GetSize()
{
RECT LabelSize;
GetWindowRect(hwnd,&LabelSize);
Size crdSize = {LabelSize.right-LabelSize.left,LabelSize.bottom-LabelSize.top};
return crdSize;
}
Re: [win32] - transparent and opacy
...and clrBackColor is set where?
Re: [win32] - transparent and opacy
Quote:
Originally Posted by
2kaud
...and clrBackColor is set where?
Code:
void SetBackColor(COLORREF color)
{
clrBackColor=color;
ShowWindow(hwnd,SW_HIDE);
ShowWindow(hwnd,SW_SHOW);
}
color GetBackColor()
{
return clrBackColor;
}
Re: [win32] - transparent and opacy
...and SetBackColor() is called from where? And is it called before the WM_ERASEBKGND message is received?
Re: [win32] - transparent and opacy
Quote:
Originally Posted by
2kaud
...and SetBackColor() is called from where? And is it called before the WM_ERASEBKGND message is received?
it's a class member... the ShowWindow() helps me do the control update
Re: [win32] - transparent and opacy
But have you checked that SetBackColor() is called before the WM_ERASEBKGND message is recieved? If it is called after, then clrBackColor won't have been set before it's used in the message process code.
Re: [win32] - transparent and opacy
Quote:
Originally Posted by
2kaud
But have you checked that SetBackColor() is called before the WM_ERASEBKGND message is recieved? If it is called after, then clrBackColor won't have been set before it's used in the message process code.
you came 1st?
WM_CTLCOLORSTATIC or WM_ERASEBKGND?
Re: [win32] - transparent and opacy
Output the received msg codes to a file or a debug window and see. It's for this sort of thing that I had the msg codes output to a file in an earlier example I posted.
Re: [win32] - transparent and opacy
Quote:
Originally Posted by
2kaud
Output the received msg codes to a file or a debug window and see. It's for this sort of thing that I had the msg codes output to a file in an earlier example I posted.
it's the WM_ERASEBKGND message.. is the 1st. and then cames the WM_CTLCOLORSTATIC message