do own stunts there, different depending on app'. Then, no problem to
let a global var store the returned nFilterIndex member, etc. Another
advantage - one can also decide filter index on opening.
Know you already know all this stuff, but in case you still want to
see, and for eventual lurkers - in my editor control sample I lift out
those functions for desired index selection, etc.
It also shows proper way to handle Save dialog in 32-bit Windows. Save
dialog must never have dual file prefixes per filter index, because then file
will end up with double file ends (like PBedit's mycode.bas.inc, for example)
See http://www.tolken99.com/edm32.zip (117KB)
Oh yes - Should think the limit is the limit of what a combo box can handle,
so should be possible to use as many as one needs (would be fun to release a
good text editor with 32000 file types to chose from - all in random order..
------------------
Eh, what was the question again (typical me - answer, but don't read question)
The OpenFileDialog function can be modified to own needs. No problems to add
a BYREF FilterIndex member to it, but best is to lift out function and do own
version inside code, something like:
Code:
FUNCTION MyOpenFileDialog (BYVAL hWnd AS DWORD, _ ' parent window BYVAL Caption AS STRING, _ ' caption Filespec AS STRING, _ ' filename BYVAL InitialDir AS STRING, _ ' start directory BYVAL Filter AS STRING, _ ' filename filter BYVAL DefExtension AS STRING, _ ' default extension FilterIndex AS DWORD '<- NOTE: added! Flags AS DWORD ) AS LONG ' flags '.. '.. FUNCTION = GetOpenFilename(ofn) FilterIndex = ofn.nFilterIndex '..
[This message has been edited by Borje Hagsten (edited September 20, 2001).]
Leave a comment: