Solved

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

Posted on 2014-12-15
3
312 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 47

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

737 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