Click here to Skip to main content
15,919,434 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: List Box & Rich Edit box Pin
prasad_som18-Feb-07 20:09
prasad_som18-Feb-07 20:09 
GeneralRe: List Box & Rich Edit box Pin
Suresh H18-Feb-07 20:20
Suresh H18-Feb-07 20:20 
GeneralRe: List Box & Rich Edit box Pin
prasad_som18-Feb-07 20:32
prasad_som18-Feb-07 20:32 
GeneralRe: List Box & Rich Edit box Pin
Suresh H18-Feb-07 20:50
Suresh H18-Feb-07 20:50 
AnswerRe: List Box & Rich Edit box Pin
prasad_som18-Feb-07 22:00
prasad_som18-Feb-07 22:00 
GeneralRe: List Box & Rich Edit box Pin
Suresh H18-Feb-07 22:48
Suresh H18-Feb-07 22:48 
AnswerRe: List Box & Rich Edit box Pin
prasad_som18-Feb-07 22:52
prasad_som18-Feb-07 22:52 
AnswerRe: List Box & Rich Edit box Pin
David Crow16-Feb-07 2:52
David Crow16-Feb-07 2:52 
Suresh H wrote:
case WM_COMMAND:
switch(LOWORD(wParam))
{
case LBN_DBLCLK:
{
HWND hwndListBox = GetDlgItem(hwnd, IDC_SLIST);
int iCurSel =::SendMessage(hwndListBox,LB_GETCURSEL,0,0);
TCHAR FName[25];
SendMessage(hwndListBox,LB_GETTEXT,(WPARAM)iCurSel,(LPARAM)FName);


This is Win32 code. Since you have an MFC application, based on the presence of CStdioFile, take advantage of it. Use ClassWizard to create a LBN_DBLCLK handler. In that handler, call the listbox's GetCurSel() method to get the index of the currently selected item. Then call the edit control's SetWindowText() method, or its StreamIn() method, to display the text (after opening the file and reading its contents, of course).




"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

"Judge not by the eye but by the heart." - Native American Proverb


QuestionWindows Menus and the WM_MENUCOMMAND message Pin
Martin081515-Feb-07 22:41
professionalMartin081515-Feb-07 22:41 
QuestionRe: Windows Menus and the WM_MENUCOMMAND message Pin
prasad_som16-Feb-07 1:51
prasad_som16-Feb-07 1:51 
AnswerRe: Windows Menus and the WM_MENUCOMMAND message Pin
Martin081516-Feb-07 2:22
professionalMartin081516-Feb-07 2:22 
AnswerRe: Windows Menus and the WM_MENUCOMMAND message Pin
prasad_som16-Feb-07 3:08
prasad_som16-Feb-07 3:08 
QuestionRe: Windows Menus and the WM_MENUCOMMAND message Pin
Martin081516-Feb-07 3:56
professionalMartin081516-Feb-07 3:56 
AnswerRe: Windows Menus and the WM_MENUCOMMAND message Pin
prasad_som16-Feb-07 5:00
prasad_som16-Feb-07 5:00 
GeneralRe: Windows Menus and the WM_MENUCOMMAND message Pin
Martin081516-Feb-07 6:31
professionalMartin081516-Feb-07 6:31 
QuestionDebugging capability Pin
mt_samiei15-Feb-07 22:39
mt_samiei15-Feb-07 22:39 
AnswerRe: Debugging capability Pin
Cedric Moonen15-Feb-07 22:50
Cedric Moonen15-Feb-07 22:50 
GeneralRe: Debugging capability Pin
mt_samiei15-Feb-07 23:03
mt_samiei15-Feb-07 23:03 
GeneralRe: Debugging capability Pin
NiceNaidu15-Feb-07 23:07
NiceNaidu15-Feb-07 23:07 
Questionkbhit() Question Pin
Programm3r15-Feb-07 20:57
Programm3r15-Feb-07 20:57 
AnswerRe: kbhit() Question Pin
Programm3r15-Feb-07 21:10
Programm3r15-Feb-07 21:10 
GeneralRe: kbhit() Question Pin
prasad_som15-Feb-07 22:29
prasad_som15-Feb-07 22:29 
AnswerRe: kbhit() Question [modified] Pin
prasad_som15-Feb-07 21:54
prasad_som15-Feb-07 21:54 
AnswerRe: kbhit() Question Pin
David Crow16-Feb-07 3:19
David Crow16-Feb-07 3:19 
QuestionMessagebox Question Pin
Programm3r15-Feb-07 20:47
Programm3r15-Feb-07 20:47 

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.