|
Ok so here is the code that I use:
- some init stuff
void MyButton::LoadImageFile()
{
CRect rectBtn;
GetClientRect(&rectBtn);
dc.Attach(this->GetDC()->m_hDC);
Gdiplus::GdiplusStartupInput gdiplusstartupinput;
Gdiplus::GdiplusStartup(&m_gdiplusToken,&m_gdiplusstartupinput,NULL);
m_MyImage = Image::FromFile(L"c:\\icon.png",TRUE);
rect = Rect(rectBtn.left,rectBtn.top,rectBtn.right,rectBtn.bottom);
grpx = new Graphics(dc);
}
- Drawing in OnPaint()
void MyButton::OnPaint()
{
CButton::OnPaint();
grpx->DrawImage(m_MyImage, rect);
}
- Message Map
BEGIN_MESSAGE_MAP(MyButton, CButton)
ON_WM_CTLCOLOR()
ON_WM_PAINT()
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_ERASEBKGND()
END_MESSAGE_MAP()
- OnCtlColor
HBRUSH MyButton::OnCtlColor(CDC* pScreenDC, CWnd * wnd, UINT nCtlColor)
{
return NULL;
}
- OnEraseBkgnd
BOOL MyButton::OnEraseBkgnd(CDC* pDC)
{
return TRUE;
}
Image flickers when the focus is set on the button and glowing vista effect is applied or seldom when you fast move over the button with the image.
|
|
|
|
|
HI all,
please help me to find out all serial com port of machine.
give me any help or guidance for this.
thanks in advance.
|
|
|
|
|
|
See here."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I m already taking help of this article.
but i have some problem in this code.
i m using this code to find Ports.i m using "UsingWMI" to find out the ports,and place this code in Thread,i m start the thread on function OnInitDialog than enter the port details in List and the Combobox.
when port finding process is running if i terminate the thread,and again want to find out the ports its not done,
coinitializesecurity returned error 80010119.
i m terminate the thread because i have an option of stop searching for ports.
so please help me what can i do.
thanks in advance.
|
|
|
|
|
Le@rner wrote: coinitializesecurity returned error 80010119.
Have you tried this?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Haven't you learned how to use Google yet? txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
In a simplicistic approach you may just try to open ports iteratively. The call will fail on not available ports (i.e not existing or busy ones).
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]
|
|
|
|
|
How to programmatically extract or get the signer name and counter-signer name from an exectuable file if it is digitally signed.
Is there any API or any raw method.
|
|
|
|
|
|
The given link is about "Digital Code Signing" and i need to retrive information programmatically from digital signature embedded in an executable such as signer name and counter signer name.
|
|
|
|
|
Please check if the following link helps: http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx
|
|
|
|
|
Hello experts,
Actually a quetion is generate on my mind. The Question is that how can we use .net dll used in MFC VC++.
ThanksIf you can think then I Can.
|
|
|
|
|
eg_Anubhava wrote: The Question is that how can we use .net dll used in MFC VC++.
You cannot, as there is no such thing. If you wish to use .NET features from C++ then you must write your program using Managed C++.txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
So whether you want to use a MFC DLL in .net?
else case, it is wont be possible except the one mentioned in above answer.Величие не Бога может быть недооценена.
|
|
|
|
|
Hello Dear,
I am tacking about .net dll in MFC .If you can think then I Can.
|
|
|
|
|
Hello Dear,
I am taking about How to use .net dll in MFC ;If you can think then I Can.
|
|
|
|
|
|
Hi,
I'm running Visual C++ .Net 2003 with Service Pack 1, and .Net Framework 1.1, and I'm having issues with using GetComboBoxInfo and GetScrollBarInfo, even though they are available as functions when using the intellisense.
Although I've seen, tried and used a workaround to use the GetComboBoxInfo function, I was wondering if there is an update I need to install to avoid having to use the workarounds.
TIA
Tony
|
|
|
|
|
maycockt wrote: I'm having issues with using GetComboBoxInfo and GetScrollBarInfo
What issues did you come across?
|
|
|
|
|
OOps, I should have elaboarated on that.
Even though I have the option to use the functions, when trying to declare a COMBOBOXINFO or SCROLLBARINFO they come up as undeclared identifier, and GetScrollBarInfo is identifier not found.
As I said, I have used a workaround involving specifically declaring the struct and declaring links to USER32.dll etc.
What I really want to know is if there is an update that takes away the requirement to put so many workarounds in place to use this functionality?
TIA
Tony
|
|
|
|
|
maycockt wrote: ...and GetScrollBarInfo is identifier not found.
Look at the function prototype in winuser.h . Do you have WINVER defined to be 0x0500 or greater?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hi Guys,
Thanks for your help.
Looking in the project settings I see the WINVER was initially configured for 0x410.
Nearly there
Tony
|
|
|
|
|
Hi,
How can we identify the valid hardware MAC address from the list obtained by GetAdaptersInfo API?
For example, in my machine there is a real Network Adapter and a Microsoft Loopback Adapter. I need to get the MAC address of the real Network Adapter.
Thanks in advance! - ns ami -
|
|
|
|
|
The documentation here[^] will explain it to you. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|