Click here to Skip to main content
15,503,808 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24320-Aug-22 1:06
coco24320-Aug-22 1:06 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan21-Aug-22 2:56
mveRichard MacCutchan21-Aug-22 2:56 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24321-Aug-22 8:51
coco24321-Aug-22 8:51 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan21-Aug-22 10:03
mveRichard MacCutchan21-Aug-22 10:03 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24321-Aug-22 11:16
coco24321-Aug-22 11:16 
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24322-Aug-22 10:58
coco24322-Aug-22 10:58 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan22-Aug-22 22:22
mveRichard MacCutchan22-Aug-22 22:22 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan23-Aug-22 1:23
mveRichard MacCutchan23-Aug-22 1:23 
I have now modified the Dlg_OnInitDialog function as below and the ListBox gets populated with file and directory names.
C++
BOOL Dlg_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
	RECT rc;
	char szPath[MAX_PATH]; // reserve space for the path

	// Associate an icon with the dialog box.
	//chSETDLGICONS(hwnd, IDI_DIRWALK, IDI_DIRWALK);
	SendMessage(hwnd, WM_SETICON, TRUE, (LPARAM)LoadIcon(GetWindowInstance(hwnd), MAKEINTRESOURCE(IDI_DIRWALK)));
	SendMessage(hwnd, WM_SETICON, FALSE, (LPARAM)LoadIcon(GetWindowInstance(hwnd), MAKEINTRESOURCE(IDI_DIRWALK)));

	GetClientRect(hwnd, &rc);
	SetWindowPos(GetDlgItem(hwnd, IDC_TREE), NULL, 0, 0, rc.right, rc.bottom, SWP_NOZORDER);

    strcpy(szPath, "< path to the directory to search >");
	DlgDirList(hwnd, szPath, IDC_TREE, 0, DDL_DIRECTORY | DDL_READWRITE); // populate the ListBox
	return(TRUE);
}

Note that the DlgDirList function needs to write into szPath so it must be created in the way I have shown.
GeneralRe: DialogBox fuction not executing its procedure Pin
coco24323-Aug-22 7:30
coco24323-Aug-22 7:30 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan20-Aug-22 0:14
mveRichard MacCutchan20-Aug-22 0:14 
GeneralRe: DialogBox fuction not executing its procedure Pin
Richard MacCutchan19-Aug-22 5:48
mveRichard MacCutchan19-Aug-22 5:48 
Questionmacro function definition Pin
coco24318-Aug-22 2:43
coco24318-Aug-22 2:43 
AnswerRe: macro function definition Pin
Mircea Neacsu18-Aug-22 3:06
mvaMircea Neacsu18-Aug-22 3:06 
GeneralRe: macro function definition Pin
coco24318-Aug-22 3:08
coco24318-Aug-22 3:08 
AnswerRe: macro function definition Pin
coco24318-Aug-22 3:06
coco24318-Aug-22 3:06 
GeneralRe: macro function definition Pin
Mircea Neacsu18-Aug-22 3:18
mvaMircea Neacsu18-Aug-22 3:18 
GeneralRe: macro function definition Pin
coco24318-Aug-22 3:43
coco24318-Aug-22 3:43 
GeneralRe: macro function definition Pin
Mircea Neacsu18-Aug-22 3:53
mvaMircea Neacsu18-Aug-22 3:53 
GeneralRe: macro function definition Pin
coco24318-Aug-22 4:30
coco24318-Aug-22 4:30 
GeneralRe: macro function definition Pin
Richard MacCutchan18-Aug-22 5:28
mveRichard MacCutchan18-Aug-22 5:28 
GeneralRe: macro function definition Pin
coco24318-Aug-22 5:46
coco24318-Aug-22 5:46 
GeneralRe: macro function definition Pin
Richard MacCutchan18-Aug-22 5:50
mveRichard MacCutchan18-Aug-22 5:50 
GeneralRe: macro function definition Pin
coco24318-Aug-22 6:18
coco24318-Aug-22 6:18 
GeneralLearning the Win API Pin
trønderen18-Aug-22 7:58
trønderen18-Aug-22 7:58 
GeneralRe: Learning the Win API Pin
coco24318-Aug-22 9:38
coco24318-Aug-22 9:38 

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.