Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open File Question

Status
Not open for further replies.

Yarg

IS-IT--Management
Jun 23, 2001
2
US
Okay I am lost ...
I want the open file function to only images how do I do this ... also when I ask it to open an image file now it brings up a blank window
 
Im not too sure what you mean regarding the second part of your question but this may be what you are talking about at the start:

Code:
char strFilename[MAX_PATH];

	OPENFILENAME ofn;

    ZeroMemory(&ofn, sizeof(ofn));

    ofn.lStructSize = sizeof(ofn);
    ofn.hwndOwner = hwnd;
    ofn.lpstrFilter = "Image Files (*.jpg)\0*.jpg\0";
    ofn.lpstrFile = strFilename;
    ofn.nMaxFile = MAX_PATH;
	ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
    ofn.lpstrDefExt = "jpg";

	if(GetOpenFileName(&ofn))
	{
		// Do stuff with strFilename here
	}

Skute

"There are 10 types of people in this World, those that understand binary, and those that don't!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top