mfc_Drag_Drop_1 - 8BitsCoding/RobotMentor GitHub Wiki



๋Œ€ํ™”์ƒ์ž์˜ Accept Files๋ฅผ True๋กœ ๋ณ€๊ฒฝ

๋Œ€ํ™”์ƒ์ž์— Drag and Drop์ด ๊ฐ€๋Šฅํ•˜๊ฒŒ ๋œ๋‹ค.

ํด๋ž˜์Šค๋งˆ๋ฒ•์‚ฌ์˜ WM_DROPFILES๋ฅผ ์ถ”๊ฐ€ํ•œ๋‹ค.

void CMFCApplication1Dlg::OnDropFiles(HDROP hDropInfo)
{
	m_drop_list.ResetContent();

	int count = DragQueryFile(hDropInfo, 0xFFFFFFFF/*-1*/, NULL, 0);

	wchar_t temp_path[MAX_PATH];
	for (int i = 0; i < count; i++) {
		DragQueryFile(hDropInfo, i, temp_path, MAX_PATH);
		m_drop_list.InsertString(i, temp_path);
	}

	CDialogEx::OnDropFiles(hDropInfo);
}