Si, con "SendMessage(hEdit,LB_ADDSTRING,0,(LPARAM)text );" invio il messaggio al controllo hEdit, cioè l'EDIT(che ha come id ID_EDIT).
Questo è il resource.h:
Questo invece è resource.rc:codice:#define IDD_DIALOG1 100 #define ID_OK 101 #define ID_CANCEL 102 #define ID_LIST 103 #define ID_EDIT 104
codice:#include <windows.h> #include <commctrl.h> #include <richedit.h> #include "resource.h" IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 227, 68 STYLE DS_MODALFRAME | WS_CAPTION | WS_POPUP | WS_SYSMENU CAPTION "Dialog" FONT 8, "Ms Shell Dlg 2" { DEFPUSHBUTTON "ok", ID_OK,175,5,50,14 PUSHBUTTON "Cancel",ID_CANCEL,120,5,50,14 LISTBOX ID_LIST, 10,5,105,60, NOT LBS_NOTIFY|LBS_NOSEL | WS_VSCROLL | WS_HSCROLL EDITTEXT ID_EDIT, 120,25,105,20, ES_AUTOHSCROLL }


Rispondi quotando