예제 #1
0
void FileDialogMoreFiles(void)
{
	int i;
	struct _finddata_t filedata;

	for(i=0;i<MAX_FILES;i++)
		fnames[i][0]='\0';
		
	numFiles=0;
		
	while(numFiles<MAX_FILES)
	{
		if(_findnext(hFile,&filedata)==0)
			strncpy(fnames[numFiles++],filedata.name,32);
		else	// no more files
		{
			if(numFiles==0)	// there aren't any more to list at all!
			{
				ExitFileDialog();
				InitFileDialog();	// reget the first page of them
			}
			break;
		}
	}
}
예제 #2
0
BOOL CALLBACK FileDialogProc(const HWND hWnd, const UINT Msg, const WPARAM wParam, const LPARAM lParam) 
{
	BOOL bProcessedMsg = TRUE;

    switch (Msg) {
    case WM_INITDIALOG:
        if (FALSE == InitFileDialog(hWnd))
            EndDialog(hWnd, -1);
        break;

    case WM_ACTIVATE:
        if (WA_INACTIVE != LOWORD(wParam)) SetFocus(hWnd);
        break;

    case WM_CLOSE:
		EndDialog(hWnd, 0);
		break;

    case WM_COMMAND:
		if (LOWORD(wParam) == IDC_FILELIST) {
			if (HIWORD(wParam) == LBN_DBLCLK) {
		        process_list_change(hWnd, GF_FALSE);
			} else {
	            bProcessedMsg = FALSE;
			}
		} else {
			switch (LOWORD(wParam)) {
			case IDOK:
				process_list_change(hWnd, GF_FALSE);
				break;
			case IDCANCEL:
				EndDialog(hWnd, 0);
				break;
			case IDM_OF_VIEW_ALL:
				bViewUnknownTypes = (Bool) !bViewUnknownTypes;
				refresh_menu_states();
				set_directory(w_current_dir);
				break;
			case IDM_OF_PLAYLIST:
				playlist_mode = (Bool) !playlist_mode;
				if (playlist_mode) refresh_playlist();
				else set_directory(w_current_dir);
				switch_menu_pl();
				break;
			case IDM_OF_PL_ACT:
				if (playlist_mode) {
					playlist_act(0);
				} else {
					process_list_change(hWnd, GF_TRUE);
				}
				break;
			case IDM_OF_PL_UP:
				playlist_act(1);
				break;
			case IDM_OF_PL_DOWN:
				playlist_act(2);
				break;
			case IDM_OF_PL_CLEAR:
				playlist_act(3);
				break;
			default:
				bProcessedMsg = FALSE;
				break;
			}
		}
        break;
	case WM_KEYDOWN:
		switch (wParam) {
		case VK_LEFT: 
		case '1': 
			playlist_act(1); 
			break;
		case VK_RIGHT: 
		case '2': 
			playlist_act(2); 
			break;
		default:
            bProcessedMsg = FALSE;
			break;
		}
		break;

    default:
        bProcessedMsg = FALSE;
    }
    
    return bProcessedMsg;
}