Or just change the ofn.lpstrFilter = szFilter; to ofn.lpstrFilter = filter; when you need the standard C file format, like this:

Quote:
cOpenAs = file_dialog_open("Open Model As...","Supported Files Types (*.mdl;*.hmp;*.obj;*.dae;*.ase;*.3ds;*.x)\0*.mdl;*.hmp;*.obj;*.dae;*.3ds;*.x\03D GameStudio (.mdl)\0*.mdl\03D GameStudio Terrain (.hmp)\0*.hmp\0Wavefront Object (.obj)\0*.obj\0Collada (.dae)\0*.dae\03ds Max ASE (.ase)\0*.ase\03ds Max 3DS (.3ds)\0*.3ds\0DirectX X(.x)\0*.x\0All Files (*.*)\0*.*\0");


Anyway, it would be great to added a handle ofn.hwndOwner = hWnd; and added also the OFN_OVERWRITEPROMPT flag like this:

I need this for my project wink

Code:
// file functions /////////////////////////////////

OPENFILENAME* filename(char* title,char* filter)
{
	static char szFile[MAX_PATH];
	ZeroMemory(szFile,MAX_PATH);
	static OPENFILENAME ofn;
	ZeroMemory(&ofn,sizeof(OPENFILENAME));
	ofn.lStructSize = sizeof(OPENFILENAME);
	ofn.hwndOwner = hWnd;
	ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT;
	if (filter) {
   	char szFilter[256];
	   ZeroMemory(szFilter,256);
	   int size = str_len(filter);
	   strcpy(szFilter,_chr(filter));
	   strcpy(szFilter+size+1,_chr(filter));
	   ofn.lpstrFilter = filter;
	} else
	   ofn.lpstrFilter = "All Files(*.*)\0*.*\0\0";
	   
	ofn.lpstrTitle	= _chr(title);
	ofn.lpstrFile	= szFile;
	ofn.nMaxFile	= MAX_PATH;
	return &ofn;
}




Regards, Robert

Quote
Everything should be made as simple as possible, but not one bit simpler.
by Albert Einstein

PhysX Preview of Cloth, Fluid and Soft Body

A8.47.1P