|
The list control displays the selected item in gray when the control does not have the focus.
Software Zen: delete this;
|
|
|
|
|
As Gary said, it sounds like the control has the style turned on that specifies to always show the selected item even when the control does not have focus. If you don't want that, you can either programmatically turn it off (LVS_SHOWSELALWAYS style) or you can specify it in the dialog editor via the control's Properties page.
|
|
|
|
|
LVS_SHOWSELALWAYS style is turned ON for the list control. I need the selected item tobe highlighted always, even if the control is not focused. Please let me know if there is anyway todo this.
Thanks
Mohammed
|
|
|
|
|
Mohammed Kutty wrote:
I need the selected item tobe highlighted always, even if the control is not focused.
thats what the LVS_SHOWSELALWAYS style takes care of simply when list control looses focus the selected item turns grey .(like any windows caption color does, when it looses focus)
"Go as far as you can see,and when you get there youll see further" - Unknown
|
|
|
|
|
It is selected. The grey indicates that the item is selected, but that the control does not have focus. If the selected item was always blue, it would be confusing as the user wouldn't know if the control had focus or not.
However, if you're adamant about the item always showing up in blue, then you'll need to create an owner-drawn control where you're code is responsible for manually drawing the items. Just search this site for:
"list view owner draw"[^]
|
|
|
|
|
This unusual selection highlight is one of our customer requirement. Anyway As you suggested I tried the OWNER DRAW way and it works.
Thanks To Tom, Giorgi and Gary
Mohammed
|
|
|
|
|
Glad to hear it worked out, Mohammed.
|
|
|
|
|
I would suggest doing it the "custom draw" way instead. All you have to do is set a color then. With owner draw, you have to draw the entire thing if I remember correctly.
--
An eye for an eye will only make the world blind.
|
|
|
|
|
Custom Draw = listen to NM_CUSTOMDRAW (or something like that)
--
An eye for an eye will only make the world blind.
|
|
|
|
|
That's true and in my VC++.NET Bible I actually cover custom drawn controls as opposed to owner drawn controls. However, I figured that he'd find more owner-drawn code and more easly be able to plug that into his project.
|
|
|
|
|
Hai..
How to Access the child Control value. I have a dialog box, Font dialog Box. Which is having some controls with the class name bosa_sdm_Microsoft word.Each control having child control with the name RichEdit20W. When the selection changed in the control, class name Bosa_sdm_Microsoft Word , The value in the child control, RichEdit20W, is also changing.Now i want to acess the child control value.
Thanking you,
E.veera Raghavendra.
e.veera raghavendra
|
|
|
|
|
Try GetWindow() API to retrieve child window
<bold>- Nilesh
<italics>"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|
|
Please forgive, my English level is badly.
How does a simple TOOLBAR weave to write?
I want to know the meaning of each step.
Thanks for your help very much, thanks!I would always be on-line to wait for your answer.
I come from China, is a plait distance raw recruit.Please forgive, my English level is badly.
|
|
|
|
|
|
Very thankful ThatsAlok!
I come from China, is a plait distance raw recruit.
|
|
|
|
|
|
I have a program that I have access to the code for. This program runs over a period of time and memory slowly goes up. This could be because of a memory leak or memory just bad memory management. Is there a way to let the program run for a while and then try to dump the memory to see how it is being used. What is the best way and quickest way of detecting where the memory is being used but not being freed? I know in programming Lotus Domino from the C API you can put a few parameters in the notes.ini after viewing a memory dump and determine exactly where a memory leak is occurring. Is there a way to do this in a C++ application or even tools that just run along side a program that monitors the leaking program.
Thanks
|
|
|
|
|
If you can run a debug build, you can use the CRT memory dump system to help track down memory leaks. Lookup _CrtMemDumpStatistics or one of the other _Crt memory routines.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
You can always try this[^] to see if your app is leaking memory..
Behind every greak black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
I will give it a try and let you know how it works. Thanks.
|
|
|
|
|
Thank you, I have been doing some reading on samples that people have posted using this and I have found some other articles as well. This looks like what I needed.
|
|
|
|
|
I have worked with a couple samples in trying to figure out the best practices of multithreading applications. Most of these samples use threads that are only ran for short periods of times. What I would like to do is write a program that spawns off 4 threads. These 4 threads stay dormant or suspended until I send them a file to work with. Then they become active and go to work. When they are done, they should report back to the main application thread.
Where should I start looking for information on how to do this? Does anyone know of a good book that has good samples on how to do this? Do you know of an example on here that works this way?
Thanks
|
|
|
|
|
I created a project: HomeWork with a document-view.
This is a static function:
Header:
static DWORD __stdcall Thread(LPVOID lp);
Implementation:
DWORD __stdcall CHomeWorkView::Thread(LPVOID lp)
{
CHomeWorkView* parent = (CHomeWorkView*)lp;
parent->Work();
return 0;
}
A member variable is also there:
HANDLE m_hEvent;
A public member function of the class:
Header:
void Work();
Implementation:
void CHomeWorkView::Work()
{
while (TRUE)
{
if (WaitForSingleObject(m_hEvent,INFINITE) == WAIT_OBJECT_0)
{
MessageBox("Working on the file right now");
}
}
}
OnBtnStart:
DWORD id;
m_hEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
CreateThread(NULL,0,Thread,this,0,&id);
When you want to start the work:
PulseEvent(m_hEvent);
------------------------
This is this's style of working with worker threads, kinda.
Just make it four threads, like Thread1, 2, 3, 4 etc. and four worker funcs like Work1, 2, 3, 4.
If you don't like this's style, then look somewhere else.
this is this.
|
|
|
|
|
This[^] article will be of great help...
Behind every greak black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
This concept is called as Thread Pooling, Here[^]is a good article from MSDN. Have a look.
<bold>- Nilesh
<italics>
"Reading made Don Quixote a gentleman. Believing what he read made him mad" -George Bernard Shaw
|
|
|
|