|
I would suggest very simple approach as you want to display only the icon, use DrawIcon, inplace of doing a lot of stuff over CStatic.
1) add the icon as member variable.
class CMyDialog : public CDialog
{
........
HICON m_hStaticIcon;
........
}
2) load the icon
BOOL CMyDialog:OnInitDialog()
{
.........
m_hStaticIcon = ::LoadIcon(AfxGetResourceHandle(), MAKEINTRESOURCE(ICON_ID));
.........
}
Paresh Chitte wrote: In CMyDialog:OnPaint(), I have painted a region of CDialog with GradientFill(...), and on this area I want a static icon,
3) Now you draw the icon over the painted region.
void CMyDialog::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this);
.....
.....
}
else
{
CDialog::OnPaint();
CClientDC dc(this);
dc.DrawIcon(100, 100, m_hStaticIcon);
}
}
|
|
|
|
|
Hi Rajkumar,
The solution you have provided is perfectly working for me.
Thank you very much for your kind help.
Regards,
Paresh.
|
|
|
|
|
Hi,
The below code is not working:
ExitWindowsEx(EWX_REBOOT|EWX_FORCE,0);
In which condition it may fail?
|
|
|
|
|
|
Return value is 0. And I have checked this.
|
|
|
|
|
|
Using getLastError, I got the error 1314 (The required previlige is not held by the client). What it means?
|
|
|
|
|
pther wrote: What it means?
see my previous reply
|
|
|
|
|
|
Hello Friends,
Can anyone say how to find the number of ports and the name of ports such as COM1, COM2 etc in our PC using a VC++ program. I searched it everywhere, but i couldnt find a proper source code.
Can u please help in this..
usharani
|
|
|
|
|
|
It is Very confusing because we dont have complete source code there .
Can u help me in this
usharani
|
|
|
|
|
don't you have the implementation of BeginEnumeratePorts, EnumeratePortsNext, EndEnumeratePorts posted in the page itself.
|
|
|
|
|
Hi Raj thanks very much it was helpful a lot..................
usharani
|
|
|
|
|
Hi experts,
I m a VC++ developer and i used Windows API CreateFile() for serial communication. but it decrease the speed of sending n receiving bytes from port.
can u please answer me how to speed up communication?
I also set the TimeOuts to '0' so that it doesnt take any timeout waitng..
Please reply..
Its really matter to me..
|
|
|
|
|
Member 3220373 wrote: but it decrease the speed of sending n receiving bytes from port.
What do you mean ? Decrease compated to what ?
|
|
|
|
|
the time taken by my program in VC++ is very greater than same implemented
program in TurboC++
My observation;;
if i used a file to write on device connected on my COM4 have size 172kb
then TurboC++ pgm takes only 54sec but VC++ pgm takes 211 sec
almost 3.5 times.
so i want some special function or tric to increase the speed of this transmisssion..
reply...plzzzzzzz
|
|
|
|
|
Member 3220373 wrote: can u please answer me how to speed up communication?
Use USB. (just kidding).
Please elaborate.
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
|
|
|
|
|
|
Thnks for reply...
I already used DCB structure in my program..
but have same effect...
the probm is If i load a file of 172kb using TurboC++ prgm
then it takes appx 55 sec...
but
when I load file using VC++ prgm that uses CreateFile() API
it takes appx 211 sec... i.e. appox 3.5 times.of TC
so plz... reply....any option to decrease load delay..
n speed up my transmission...
PLz ..... ur reply always matter to me..
|
|
|
|
|
I am trying to implement "intellisearch" combo box like we have in IE.
I create a separate list box and draw it below combo box when user starts typing in something.
The Combo box has to be a parent of this list box. When I draw the list box using the Create method, it offcourse will try to draw the list box inside the client area of the combo box, and fails to do so.
Can we draw a child window outside the client area of the parent?
<br />
<br />
bool CAutoCompComboBox::CreateListBox()<br />
{<br />
CRect clientRect(-1, -1, -1, -1);<br />
<br />
GetClientRect(&clientRect); <br />
<br />
BOOL bRet = _listFilter.Create(WS_CHILD | WS_VISIBLE | <br />
WS_VSCROLL | LBS_STANDARD,<br />
clientRect, this, 1);<br />
<br />
<br />
_listFilter.Create(WS_CHILD | WS_VISIBLE | <br />
WS_VSCROLL | LBS_STANDARD,<br />
clientRect, GetParent(), 1);<br />
<br />
<br />
Thanks in advance..
Misha
Evil triumphs when good people sit quiet...
|
|
|
|
|
|
Thanks,
Thats the problem. I don't want to subclass the list box which comes with CCombobox. I have to keep it separate.
all ideas would be greatly appreciated.
Evil triumphs when good people sit quiet...
|
|
|
|
|
what about WS_POPUP style instead of WS_CHILD and position the popup window relative to combobox and send the messages to and fro between combo box and popup listbox. I think popup window is the best match as "intellisearch" kind of control pops up when some thing is typed and closes when out of focus from combobox.
|
|
|
|
|
Thanks, that seems to work. the code looks like this:
ClientToScreen(&clientRect); <br />
<br />
BOOL bRet = _listFilter.CreateEx(0, <br />
_T("LISTBOX"), <br />
_T(""), <br />
WS_POPUP | WS_VISIBLE | WS_BORDER | WS_VSCROLL <br />
| LBS_NOTIFY <br />
,<br />
clientRect.left, clientRect.top, <br />
clientRect.Width(), clientRect.Height(), <br />
this->GetSafeHwnd(), <br />
NULL, <br />
NULL);<br />
Evil triumphs when good people sit quiet...
|
|
|
|