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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you customise file open and file save browse windows?

Status
Not open for further replies.

gjcsot

Programmer
Oct 16, 2002
9
GB
I what to customise OnFileOpen() so I can change the file filter to a list of my choicing but I can't find any help on this. I also want to do the same for the save browse window by customising OnFileSaveAs but this does even appear in the help files?

Can you point me to where I can find out how to get started? Or is there a easy way of changing the filters without writing my own OnFileOpen and OnFileSaveAs?
 
To change the filters, you just create an array of your new filters, and using the OPENFILENAME structure, setting the item that takes care of filters equal to that array of strings:

static OPENFILENAME ofn;

void PopFileInit(HWND hwnd)
{
static TCHAR szFilter[] = TEXT("Text Files(*.TXT)\0*.txt\0") TEXT("ASCII Files(*.ASC)\0*.asc\0");

//set ofn settings
ofn.lpstrFilter = szFilter;

} The weevil of doooooooooom
-The eagle may soar, but the weasel never gets sucked up by a jet engine (Anonymous)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top