Windows - API GetOpenFileName

 
Vista:

API GetOpenFileName

Publicado por Ivan (1 intervención) el 07/03/2005 12:59:50
Alguien sabe como inicializar la estructura OpenFileName , q usa la API GetOpenFilename(estructura).
Agradeceria un ejemplo porq no encutro nada. gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:API GetOpenFileName

Publicado por Roberto Silva (1 intervención) el 25/09/2006 23:43:12
OPENFILENAME ofn;
char szFileName[MAX_PATH] = "";

ZeroMemory(&ofn, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwnd;
ofn.lpstrFilter = "Documentos de texto (*.txt)\0*.txt\0Todos los archivos (*.*)\0*.*\0";
ofn.lpstrFile = szFileName;
ofn.nMaxFile = MAX_PATH;
ofn.lpstrDefExt = "txt";
ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;

if (GetOpenFileName(&ofn))
{
shit goes here
}
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar