- CVI 정보나눔(www.cvi.kr)
- 스터디
- 개발메모
개발메모(형식에 매이지 않는 짤막한 개발 낙서)
글 수 174
여러개의 파일을 drag and drop 하여 리스트 박스에 하나씩 추가함
int CVICALLBACK PanelCB (int panel, int event, void *callbackData,
int eventData1, int eventData2)
{
static char** files;
static char* firstFile;
static int index;
static char Buff_ext[20];
switch (event)
{
//This event occurs when files are dragged and dropped on the panel
case EVENT_FILESDROPPED:
files = (char**)eventData1;
//firstFile = files[0];
index=0;
while(files[index]) // 파일명을 저장하는 문자열 공간이 NULL이 아니라면...
{
if(files[index][0]) /// 파일명이 NULL로 시작하지 않는다면...
{
/*
KD_Get_FileExtension(files[index], Buff_ext);
if(!stricmp(Buff_ext, ".KDRM"))
// 확장자가 KDRM 이라면 처리...
{
Open_KDRM_core(files[index]);
}
*/
// 전체 경로명에서 파일명만 Tmp_Buff로 뽑아냄
KD_Extract_Filename_only(files[index], kdwmv2wma_status.Tmp_Buff);
// Listbox에 Label과 value를 추가함.
InsertListItem (panelHandle, PANEL_listboxFileList, -1, kdwmv2wma_status.Tmp_Buff, files[index]);
}
index++;
}
break;
case EVENT_GOT_FOCUS:
break;
case EVENT_LOST_FOCUS:
break;
case EVENT_CLOSE:
QuitUserInterface (0);
break;
}
return 0;
}
int CVICALLBACK PanelCB (int panel, int event, void *callbackData,
int eventData1, int eventData2)
{
static char** files;
static char* firstFile;
static int index;
static char Buff_ext[20];
switch (event)
{
//This event occurs when files are dragged and dropped on the panel
case EVENT_FILESDROPPED:
files = (char**)eventData1;
//firstFile = files[0];
index=0;
while(files[index]) // 파일명을 저장하는 문자열 공간이 NULL이 아니라면...
{
if(files[index][0]) /// 파일명이 NULL로 시작하지 않는다면...
{
/*
KD_Get_FileExtension(files[index], Buff_ext);
if(!stricmp(Buff_ext, ".KDRM"))
// 확장자가 KDRM 이라면 처리...
{
Open_KDRM_core(files[index]);
}
*/
// 전체 경로명에서 파일명만 Tmp_Buff로 뽑아냄
KD_Extract_Filename_only(files[index], kdwmv2wma_status.Tmp_Buff);
// Listbox에 Label과 value를 추가함.
InsertListItem (panelHandle, PANEL_listboxFileList, -1, kdwmv2wma_status.Tmp_Buff, files[index]);
}
index++;
}
break;
case EVENT_GOT_FOCUS:
break;
case EVENT_LOST_FOCUS:
break;
case EVENT_CLOSE:
QuitUserInterface (0);
break;
}
return 0;
}