|
|
HANDLE hBMP = ::LoadImage(NULL, "filename.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
What is the procedure to change the background of list box?
NSS
|
|
|
|
|
The best way is to override the WM_CTLCOLORLISTBOX[^] message.
You'll need something like HBRUSH m_hBrush = NULL; in your class definition and check you set it to NULL in your classes constructor. Once done, override the DefWindowProc for your controls parent window and add to it...
switch( message )
{
case WM_CTLCOLORLISTBOX:
{
if( m_hBrush == NULL )
{
LOGBRUSH lb;
ZeroMemory( & lb, sizeof( LOGBRUSH ) );
lb.lbStyle = BS_SOLID;
lb.lbColor = RGB( 0, 0, 255 );
m_hBrush = CreateBrushIndirect( & lb );
}
SetBkColor( ( HDC ) wParam, RGB( 0, 0, 255 ) );
SetTextColor( ( HDC ) wParam, RGB( 255, 255, 255 ) );
return ( LRESULT ) m_hBrush;
}; break;
}
Obviously when the window / class is destroyed you'll need to destroy the brush you've alllocated so add something like if( m_hBrush != NULL ) DestroyObject( m_hBrush ); aswell.
This will currently set every list box on your window to the colour Blue, if you want to be more selective all you need to do is compare the list boxes handle to the lParam of the WM_CTLCOLORLISTBOX message.
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
Thanks a lot for your answer..
|
|
|
|
|
hi,
i am not able set the check mark when i select the menu item
is there any setting when creating the menu templete...
the following code snapet
CMenu *popMenu=mnu->GetSubMenu(0);
CMenu *subpop=popMenu->GetSubMenu(3);
UINT state=subpop->GetMenuState(ID_TEMP_SETPRIORITY_ABOVENORMAL,MF_BYCOMMAND);
if (state & MF_CHECKED)
subpop->CheckMenuItem(ID_TEMP_SETPRIORITY_ABOVENORMAL, MF_UNCHECKED|MF_BYCOMMAND);
else
subpop->CheckMenuItem(ID_TEMP_SETPRIORITY_ABOVENORMAL, MF_CHECKED | MF_BYCOMMAND);
if any idea please let me ASAP.
thanks in advance.
FAILURE is the first step towards SUCCESS
|
|
|
|
|
Try this in the UI handler for the menu item.
Love Forgives--Love Gives--Jesus is Love <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
|
Hi,
I wanted to set /NOENTRY option for resource DLL IN VC++ 6.0. I had serched the MSDN online Net but MSDN
is only helping out to set that Option in VC++.Net(7.0).
Plz Help me in setting tht option in VC++(6.0).
Nitin Patil
India
|
|
|
|
|
I dont know if there is a option to enable or diable that setting but you can do that manually.
In the project settings, under the link tab, There is a edit box called as Project Options, in that box add /NOENTRY with the other options similarly you add any other linker options.
-Prakash
|
|
|
|
|
Thanx for helping me out
Nitin Patil
|
|
|
|
|
Mr.Prakash wrote: in that box add /NOENTRY with the other options similarly you add any other linker options.
you getting 1 vote quite often...
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote: you getting 1 vote quite often...
yeah, coz i have my own personal downvoter.
-Prakash
|
|
|
|
|
Mr.Prakash wrote: yeah, coz i have my own personal downvoter.
Whom!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ThatsAlok wrote: Whom!
I dont know, but he/she is out there, waiting for me to post new messages to be downvoted
-Prakash
|
|
|
|
|
Mr.Prakash wrote: I dont know, but he/she is out there, waiting for me to post new messages to be downvoted
seems you have many enemy *ahem* downvoter here... but you are very polite guy... how come thats possible.. anyways, now I am correcting that person mistake , also we have four vote ( gold member vote weight is four time more then any normal member) .
as if we take worse condition is your downvoter is atmost gold member .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
-- modified at 0:14 Tuesday 10th January, 2006
|
|
|
|
|
ThatsAlok wrote: seems you have many enemy *ahem* downvoter here... but you are very polite guy... how come thats possible.. anyways, now I am correcting that person mistake , also we have four vote ( gold member vote weight is four time more then any normal member) .
as if we take worse condition is your downvoter is atmost gold member .
its not a big deal to get downvoted, but i would like to know wwhy it was downvoted on very innocent messages.
anyways no issues and thanks.
-Prakash
|
|
|
|
|
In my program I am calling a funtion which will employ the clipboard. the copy and paste process must be finished before the following codes are excuted, or errors will occur.
So I would like to program a delay after that function is called and before excuting the following codes.
Of course I can use the "for" loop, like "for(int i =1; i<=1000; i++){}" .
But, is there another way to make the program just pause and do nothing so that my program will not take too much resources of CPU and memory?
or is there any way to determine wether the clipboard thing has been completed?
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
You could just sleep the thread for a few seconds.
Sleep(1000);
1000 being in milliseconds, i.e. Sleep(1000) = sleep for one second.
Kelly Ryan
|
|
|
|
|
I thought it would work, but it dose not, neither does the for loop.
my code is like the following:
pCtrlCopyDef->Excute();
pSketch->Edit();
pCtrlPasteDef->Excute();
AfxMessageBox(_T("Exit?"));
pSketch->ExitEdit();
I have worked on it for quite a long time and got nothing fixed. could you please help me analyze it and find a way out?
Thank you very much!!!
-------------------
I am learning C++ and English
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
Are you redrawing your device context? Maybe the stuff is being pasted on there but you're just not drawing it.
Kelly Ryan
|
|
|
|
|
I am programming with the API of Autodesk Inventor, which is a CAD software. so the calling of the clipboard functionality is hidden behind those API function.
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
But are you actually redrawing the device context that holds the pasted sketch? Maybe it's being pasted but you're just not re-drawing it.
Kelly Ryan
|
|
|
|
|
KellyR wrote: But are you actually redrawing the device context that holds the pasted sketch? Maybe it's being pasted but you're just not re-drawing it.
What WM_TIMER Message and SetTimer api
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|