News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Open Multiple Files

Started by Darrel, September 08, 2006, 02:48:30 PM

Previous topic - Next topic

Darrel

I'm having problems usin the Open Dialog Box with the following flags : (OFN_FILEMUSTEXIST,OFN_PATHMUSTEXIST,OFN_EXPLORER,OFN_ALLOWMULTISELECT). If I omit OFN_EXPLORER, I can open multiple files, but with it I am not able to open multiple files. I don't want to use the old style dialog box. Any suggestions on using OFN_EXPLORER and opening multiple files would be appreciated.

Thanks for your time and consideration.

Darrel

P1

Please post example code to demostrate the problem.

Are you using a private template?

Regards,  P1  :8)

Darrel

Here is sample code:

.386
.model flat,stdcall
option casemap:none

include \LEMKE\MyDefs.inc
include \LEMKE\MyEqus.inc
include \LEMKE\MyStructs.inc
include \LEMKE\MyProtos.inc

includelib \LEMKE\Lib\kernel32.lib
includelib \LEMKE\Lib\comdlg32.lib

.data

szBMP BYTE "bmp",0
szRotationFile BYTE "BMP",0,"*.bmp",0,0

.data?

szOpenSaveFile BYTE 1024 dup(?)
OpenSaveBitmap OPENFILENAME <>

.const

.code

Start:

mov OpenSaveBitmap.lStructSize,76
mov OpenSaveBitmap.nMaxFile,1024
lea edx,szBMP
mov OpenSaveBitmap.lpstrDefExt,edx
lea edx,szRotationFile
mov OpenSaveBitmap.lpstrFilter,edx
lea edx,szOpenSaveFile
mov OpenSaveBitmap.lpstrFile,edx
mov OpenSaveBitmap.Flags,OFN_FILEMUSTEXIST or OFN_PATHMUSTEXIST or OFN_EXPLORER or OFN_ALLOWMULTISELECT

INVOKE GetOpenFileName,ADDR OpenSaveBitmap ;comdlg32.dll

or eax,eax
je MultipleOpen00086

MultipleOpen00086:

INVOKE ExitProcess,eax ;kernel32.dll

END Start


I am willing to you use a template and OFNHookProc but haven't got it figured out yet either.

Thanks again for your time and consideration.

Darrel

Darrel

I've got a solution worked out.

Regards,

Darrel

GregL

Darrel,

Well, don't keep it a secret, what did you figure out?


Darrel

I'm using the OFNHookProc and intercepting the CDN_FILEOK message and adding the selected file to a LISTBOX and when the user clicks my OK button I'll just read what's in the LISTBOX. The LISTBOX and OK button are defined by a template. Will post the code when I get everything working appropriately.

Regards,

Darrel

Darrel

Here are the results.

Regards,

Darrel   :8)

[attachment deleted by admin]