|
see my example i hope you find why when you use ownerdraw you get error.
in MSDN you see:
"BS_OWNERDRAW
Creates an owner-drawn button. The owner window receives a WM_DRAWITEM message when a visual aspect of the button has changed. Do not combine the BS_OWNERDRAW style with any other button styles."
whitesky
|
|
|
|
|
HBRUSH CButtoncolorDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(nCtlColor == CTLCOLOR_BTN)
{
if( pWnd == "Your specific button pointer" )
return CreateSolidBrush(RGB(0,100,0));
}
return hbr;
}
I wonder maybe you need to use new font ( by SelectObject() ) to change the font color.
|
|
|
|
|
You can use a class derived CButton and use WM_DRAWITEM of course you need to set OwnerDraw in
property button in property window
whitesky
|
|
|
|
|
I think you need to one code so see this you need to insert this code in your project for one start
m_Button.ModifyStyle(0,BS_OWNERDRAW);
m_Button is CMyButton1
class CMyButton1 : public CButton
{
DECLARE_DYNAMIC(CMyButton1)
public:
CMyButton1();
virtual ~CMyButton1();
protected:
DECLARE_MESSAGE_MAP()
public:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
};
IMPLEMENT_DYNAMIC(CMyButton1, CButton)
CMyButton1::CMyButton1()
{
}
CMyButton1::~CMyButton1()
{
}
BEGIN_MESSAGE_MAP(CMyButton1, CButton)
END_MESSAGE_MAP()
void CMyButton1::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CDC dc;
dc.Attach(lpDrawItemStruct->hDC);
CRect rt;
rt = lpDrawItemStruct->rcItem;
dc.SetBkMode(0);
CString str;
GetWindowText(str);
if ( (lpDrawItemStruct->itemState & ODS_SELECTED) )
{
dc.FrameRect(&rt,&CBrush(RGB(110,170,210)));
dc.SetTextColor(RGB(0,0,0));
dc.FillRect(&rt,&CBrush(RGB(190,210,210)));
}
else
{
dc.FrameRect(&rt,&CBrush(RGB(0,0,0)));
dc.SetTextColor(RGB(255,255,255));
dc.FillRect(&rt,&CBrush(RGB(100,170,210)));
}
dc.DrawText(str,rt,DT_CENTER|DT_VCENTER|DT_SINGLELINE);
dc.Detach();
}
</code>
whitesky
|
|
|
|
|
Hi I want to make an imap client using c++ can anyone guide me which way to follow.
Thanks,
answer_me
|
|
|
|
|
I don't kwon if it help you, but here's PJ Naughter's MAPI Implementation[^] Good luck and keep the good coding!
|
|
|
|
|
Hi!
I tried to build a sample and then I got this error:
LINK : fatal error LNK1104: cannot open file "atls.lib"
I linked all the libraries I need. I can't find this atls.lib anywhere, on my computer or the Internet. I tried to make visual c++ to ignore this lib too, but nothing works.
But through some sources i came to know that, it comes along with Microsoft Visual Studio.NET 2003 (VC7).So i installed Microsoft Visual Studio.NET 2003 (VC7)in my machine.
After that i built the application, but got the following errors:
atls.lib(atlbase.obj) : error LNK2001: unresolved external symbol ___security_cookie
atls.lib(atlbase.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
atls.lib(atlbase.obj) : error LNK2001: unresolved external symbol __SEH_epilog
atls.lib(atlbase.obj) : error LNK2001: unresolved external symbol __SEH_prolog
Can any one help me please ??
|
|
|
|
|
dashprasannajit wrote: I can't find this atls.lib anywhere, on my computer or the Internet.
Google: MSDN atls.lib
92 hits
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
Maybe you're using a newer version of the Internet.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
can anyone show me how to connect to a database using CDatabase class. I'd prefer if you'll use access for simplicity.
Thanks...
---------------------Life is simple, You just complicate things------------------
|
|
|
|
|
See Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
See here for an example.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
i use CreateService to create a driver service
then CreateService return NULL
i use GetLastError() then return 4 (System cannot open file)
i can create service on 2000 system,but in xp system i can not
what make this error
who can help me?
hi
|
|
|
|
|
zt9788 wrote: i use GetLastError() then return 4 (System cannot open file)
Are you sure it's not ERROR_TOO_MANY_OPEN_FILES ?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I am writing a fairly simple Windows application that I plan to distribute as freeware. For that reason, I want the application to execute on Windows 95, 98, 2000, and Xp without having to create separate versions. I recently started learning C# on .net 2.0. Can I use C# to write a WinForm application to run on Windows 95, 98, 2000, and XP? I understand that the .net framework is required to run a Windows application that makes use of any DLL in .net, but if the user does not have .net installed, is it possible to package the necessary .net DLL with the application installer?
Thanks!
Raffi
|
|
|
|
|
|
Hi Jun,
I know about the redistributable, but is it possible to reduce the size of the file to include only those DLL's required by the application? The redistributable is 20MB!
Thanks for the info!
Raffi
|
|
|
|
|
Raffi NYC wrote: Can I use C# to write a WinForm application to run on Windows 95...
No, because Windows 95 does not support the .NET Framework.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
OK, let's exclude 95 from the picture for now. What about from 98 and up? Can I still use .net? I want to package .net DLL's with the application, but only the ones that are required by the app. Is this possible? An associate of mine mentioned that SharpDeveloper could be used for this purpose,
Thanks for the info!
Raffi
|
|
|
|
|
I managed to get additional info from another board regarding a package called Salamander.Net. It basically extracts all types on which your application is dependent and packages it into a single exectuable to run on any platform, even if that target machine does not have .net framework installed.
|
|
|
|
|
I'm writing a win32 program that needs to display video coming directly from a USB/IEEE 1394 camera..similar to a webcam type deal. I have never done anything like this before, and find MSDN articles on the subject to be confusing. Anyone with experience in this sort of thing have any suggestions on how to get started or know of anywhere to find good information? Thanks.
-matt
|
|
|
|
|
|