Click here to Skip to main content
15,889,034 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Pull Downs Menu Items Pin
BobInNJ11-Nov-08 13:00
BobInNJ11-Nov-08 13:00 
QuestionGet parent process command line in 64 bit Pin
Jack Rong11-Nov-08 10:23
Jack Rong11-Nov-08 10:23 
QuestionHow to select an initial entry when Virtual List is first displayed? Pin
AmVal11-Nov-08 8:11
AmVal11-Nov-08 8:11 
QuestionRe: How to select an initial entry when Virtual List is first displayed? Pin
Mark Salsbery11-Nov-08 8:41
Mark Salsbery11-Nov-08 8:41 
AnswerRe: How to select an initial entry when Virtual List is first displayed? Pin
AmVal11-Nov-08 11:25
AmVal11-Nov-08 11:25 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
Mark Salsbery11-Nov-08 12:39
Mark Salsbery11-Nov-08 12:39 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
AmVal12-Nov-08 4:30
AmVal12-Nov-08 4:30 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
Mark Salsbery12-Nov-08 7:29
Mark Salsbery12-Nov-08 7:29 
This should be the proper sequence after SetItemCount():

GotoDlgCtrl(&MyList_);
MyList_.SetItemState(0, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED );
GotoDlgCtrl(&MyEdit_); // optional - if you want initial focus on the edit control

Then return FALSE from OnInitDialog() (important!).

(make sure you comment out any fake mouse click stuff Smile | :) )

That works for me - I just tested it.

Without setting the focus to the list before setting the selection, it
indeed fails to select the item as you've seen - I confirmed that as well.


AmVal wrote:
I don't know if this ancient version I'm using has SetItemCountEx()


That's why I gave you the Win32 equivalent Smile | :)

You can get the Win32 equivalent of anything missing from your ancient MFC
version here: List View Control[^]

AmVal wrote:
It would be nice if I could keep the highlight blue all the time


You'd have to use custom draw for that.

Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
AmVal12-Nov-08 10:17
AmVal12-Nov-08 10:17 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
Mark Salsbery12-Nov-08 10:51
Mark Salsbery12-Nov-08 10:51 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
AmVal12-Nov-08 11:24
AmVal12-Nov-08 11:24 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
Mark Salsbery12-Nov-08 12:04
Mark Salsbery12-Nov-08 12:04 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
AmVal13-Nov-08 2:51
AmVal13-Nov-08 2:51 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
Mark Salsbery13-Nov-08 6:25
Mark Salsbery13-Nov-08 6:25 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
AmVal17-Nov-08 4:30
AmVal17-Nov-08 4:30 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
Mark Salsbery17-Nov-08 4:34
Mark Salsbery17-Nov-08 4:34 
GeneralRe: How to select an initial entry when Virtual List is first displayed? Pin
Mark Salsbery12-Nov-08 7:35
Mark Salsbery12-Nov-08 7:35 
QuestionException problem Pin
rrrado11-Nov-08 3:44
rrrado11-Nov-08 3:44 
AnswerRe: Exception problem Pin
David Crow11-Nov-08 4:27
David Crow11-Nov-08 4:27 
GeneralRe: Exception problem Pin
rrrado11-Nov-08 4:38
rrrado11-Nov-08 4:38 
GeneralRe: Exception problem Pin
David Crow11-Nov-08 4:55
David Crow11-Nov-08 4:55 
AnswerRe: Exception problem Pin
Rajkumar R12-Nov-08 1:08
Rajkumar R12-Nov-08 1:08 
AnswerRe: Exception problem Pin
Stephen Hewitt11-Nov-08 17:12
Stephen Hewitt11-Nov-08 17:12 
AnswerRe: Exception problem Pin
Randor 11-Nov-08 17:22
professional Randor 11-Nov-08 17:22 
QuestionHelp in CxImage.. Pin
gothic_coder11-Nov-08 3:13
gothic_coder11-Nov-08 3:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.