|
|
От: |
Patalog
|
|
| Дата: | 29.10.03 15:04 | ||
| Оценка: | |||
const TCHAR* name1 = _T("c:\\temp\\mycoolfile1.txt");
const TCHAR* name2 = _T("c:\\temp\\mycoolfile2.txt");
drop_names names;
names.add(name1);
names.add(name2);
const TCHAR* file_names = names.lock();
DROPFILES drop_struct = { sizeof(drop_struct), { 0, 0 }, 0, 0 };
const size_t drop_size = sizeof(drop_struct) + names.size();
HGLOBAL drop_data = GlobalAlloc(0, drop_size);
unsigned char* clip_data = reinterpret_cast<unsigned char*>(drop_data);
memcpy(clip_data, &drop_struct, sizeof(drop_struct));
memcpy(clip_data + sizeof(drop_struct), file_names, names.size());
SendMessage(somebodycoolappwindow, WM_DROPFILES, (WPARAM)drop_data, 0);так что мог бы и сам догадатьсяDROPFILES Structure
--------------------------------------------------------------------------------
Defines the CF_HDROP clipboard format. The data that follows is a double null-terminated list of file names.