Link to home
Start Free TrialLog in
Avatar of HiImGlen
HiImGlen

asked on

Center Open/Save dialogs on the desktop?

Hi, I have made a DLL for calling in my Delphi application using Dev-CPP which contains the means of accessing the windows explorer style open/save dialogs.

They don't center themselves though, they end up in the top left hand corner...
Avatar of AmigoJack
AmigoJack

uhm... and why dont you call it directly in delphi? you could hook the dialog and then set whatever once you got its handle. if you want i can give an example in delphi
Avatar of HiImGlen

ASKER

Because it takes up space and ram, I also noticed that even when free'd the dialog still used ram and it wasn't released, so I thought if I did it manually in c++ that wouldn't happen.

But the same behaviour remains, I find it a good idea to contain all the code in a dll though. Dynamically used of course.
hmm... i suspect youre using something else than directly calling GetOpenFileName(). if you can say me how i can test if my pure api calls also take "space and ram" which are never released then i could test if my methods result in the same (propably it wont be enough to watch taskman when opening the dialog and when closing it, right?). in fact i never had memory problems with that.
Through Delphi as TOpenDialog/TSaveDialog or using API in Delphi and in C++ seems to have no difference, but only as the Task Manager shows, even if it isn't really there it's annoying that it displays it.

I do call a function in my c++ DLL that sets it up for two different opendialogs and executes the api or a save dialog and executes the api.

I know it never centers itself by default though, but I can't find any answers that don't pertain to MFC..........
at least i know how to hook the selectfolder-dialog to resize it according to its calling window and i know the open/save dialogs also support a specific callback hook. i could try to do that in borland builder 5 to do so, or in delphi 5. both things will be pure api calls and will show you how to change the position of the dialog. if you want that - say yes :) otherwise i can spare the work
ASKER CERTIFIED SOLUTION
Avatar of itsmeandnobodyelse
itsmeandnobodyelse
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial