Solved

How to position windows common dialog in vb6 when using comdlg32 GetOpenFilename?

Posted on 2014-12-15
3
271 Views
Last Modified: 2015-01-10
If I use GetOpenFilename of comdlg32 the common dialog box is placed somewhere onto the left top edge - always the same position. The parameter list of GetOpenFilename has no variables for the positioning of the dialog box. So how can I best move the dialog to the wanted position (before showing up resp. before the user begins to react)?
Does this work also for message boxes?
Ok, I am only interessted in solutions for VB6!

Sincerly
Josef
0
Comment
Question by:joschramm
  • 2
3 Comments
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40500824
The GetOpenFilename window will open wherever it was the last time. In other words if you see it and then move it, it will open the next time at the new position. That says to me that the position must be stored in the Registry and so if you can find the entry you can set it ahead of time via code. (Sorry for my being lazy here and not finding it for you.)
0
 

Accepted Solution

by:
joschramm earned 0 total points
ID: 40531716
Hi Martin Liss, unfortunately I did not find any appropriate entry in the Registry. Nevertheless I found a code snippet that solved my problem.
It is to be admired at http://www.freevbcode.com/ShowCode.asp?ID=685.
It uses GetWindowRect and MoveWindow to move the common dialoge window around. To use these functions an AdressOf operator is needed (to fetch the adress of a hook function). Therefore I had to modify my code somewhat as my code runs as class.
If you are interessted (or someone else) I can send more details.
Sincerly, Josef
0
 

Author Closing Comment

by:joschramm
ID: 40541772
See my comment
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Replace Formatted Numbers with text 9 61
SLMGR Switches Are Not Working On KMS Host 3 68
Prevent checkbox click event occur while editing it in vb6 8 33
Help me. 3 45
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now