By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 1,012 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

common dialog!

P: n/a

Hello,

Is there a way to move the commondialog to a specific position ?

Greets John
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
> Is there a way to move the commondialog to a specific position ?

I believe this link covers the basics of what you want to do (although from
the write up, you'll have to modify it slightly to account placing the
dialog box at a specific position rather than the center of the screen.

http://www.mvps.org/vbnet/code/hooks...dlghookadv.htm

Rick - MVP
Jul 17 '05 #2

P: n/a
Ok, But does that work for the printerdialog??

Greets John

"Rick Rothstein" <ri************@NOSPAMcomcast.net> schreef in bericht
news:ZY********************@comcast.com...
Is there a way to move the commondialog to a specific position ?
I believe this link covers the basics of what you want to do (although

from the write up, you'll have to modify it slightly to account placing the
dialog box at a specific position rather than the center of the screen.

http://www.mvps.org/vbnet/code/hooks...dlghookadv.htm

Rick - MVP

Jul 17 '05 #3

P: n/a
It should... the CommonDialogBox is a container for several types of dialog
boxes with the Printer Dialog being only one, so I don't see why it
wouldn't. Perhaps Randy Birch (it was his site I referenced) will come along
and confirm this; but you might want to just try it and see. Take his code
as is and see if it centers your Printer Dialog Box... if it does, then
modifying it as Randy indicates can be done will work also.

Rick - MVP
"John Lauwers" <no****@fictief.com> wrote in message
news:3f**********************@reader1.news.skynet. be...
Ok, But does that work for the printerdialog??

Greets John

"Rick Rothstein" <ri************@NOSPAMcomcast.net> schreef in bericht
news:ZY********************@comcast.com...
Is there a way to move the commondialog to a specific position ?


I believe this link covers the basics of what you want to do (although

from
the write up, you'll have to modify it slightly to account placing the
dialog box at a specific position rather than the center of the screen.

http://www.mvps.org/vbnet/code/hooks...dlghookadv.htm

Rick - MVP


Jul 17 '05 #4

P: n/a
Problem is that code displays the API dialog, not the common control OCX
dialog. The API presents the WM_INITDIALOG message when it is about to be
displayed.

Karl has a demo in his site's samples section at http://www.mvps.org/vb/
called movedmsg that shows how to reposition a standard VB message box using
a windows hook. With some work it may be able to handle a VB common control
printer dialog. I have the code for the API printer dialog together, but I
haven't added position hooking yet. And this is one complicated beast,
compared to other common dialogs, sue to the amount of information that can
be set and retrieved.

--

Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.
"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote in message
news:Ka********************@comcast.com...
: It should... the CommonDialogBox is a container for several types of
dialog
: boxes with the Printer Dialog being only one, so I don't see why it
: wouldn't. Perhaps Randy Birch (it was his site I referenced) will come
along
: and confirm this; but you might want to just try it and see. Take his code
: as is and see if it centers your Printer Dialog Box... if it does, then
: modifying it as Randy indicates can be done will work also.
:
: Rick - MVP
:
:
: "John Lauwers" <no****@fictief.com> wrote in message
: news:3f**********************@reader1.news.skynet. be...
: > Ok, But does that work for the printerdialog??
: >
: > Greets John
: >
: > "Rick Rothstein" <ri************@NOSPAMcomcast.net> schreef in bericht
: > news:ZY********************@comcast.com...
: > > > Is there a way to move the commondialog to a specific position ?
: > >
: > > I believe this link covers the basics of what you want to do (although
: > from
: > > the write up, you'll have to modify it slightly to account placing the
: > > dialog box at a specific position rather than the center of the
screen.
: > >
: > > http://www.mvps.org/vbnet/code/hooks...dlghookadv.htm
: > >
: > > Rick - MVP
: > >
: > >
: >
: >
:
:
Jul 17 '05 #5

P: n/a
Ok thanks Randy and Rick, I will take the MSGPos and modify it so I can use
it with the commondialog.

Greets John
"Randy Birch" <rg************@mvps.org> schreef in bericht
news:5X***************@news01.bloor.is.net.cable.r ogers.com...
Problem is that code displays the API dialog, not the common control OCX
dialog. The API presents the WM_INITDIALOG message when it is about to be
displayed.

Karl has a demo in his site's samples section at http://www.mvps.org/vb/
called movedmsg that shows how to reposition a standard VB message box using a windows hook. With some work it may be able to handle a VB common control printer dialog. I have the code for the API printer dialog together, but I
haven't added position hooking yet. And this is one complicated beast,
compared to other common dialogs, sue to the amount of information that can be set and retrieved.

--

Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.
"Rick Rothstein" <ri************@NOSPAMcomcast.net> wrote in message
news:Ka********************@comcast.com...
: It should... the CommonDialogBox is a container for several types of
dialog
: boxes with the Printer Dialog being only one, so I don't see why it
: wouldn't. Perhaps Randy Birch (it was his site I referenced) will come
along
: and confirm this; but you might want to just try it and see. Take his code : as is and see if it centers your Printer Dialog Box... if it does, then
: modifying it as Randy indicates can be done will work also.
:
: Rick - MVP
:
:
: "John Lauwers" <no****@fictief.com> wrote in message
: news:3f**********************@reader1.news.skynet. be...
: > Ok, But does that work for the printerdialog??
: >
: > Greets John
: >
: > "Rick Rothstein" <ri************@NOSPAMcomcast.net> schreef in bericht
: > news:ZY********************@comcast.com...
: > > > Is there a way to move the commondialog to a specific position ?
: > >
: > > I believe this link covers the basics of what you want to do (although : > from
: > > the write up, you'll have to modify it slightly to account placing the : > > dialog box at a specific position rather than the center of the
screen.
: > >
: > > http://www.mvps.org/vbnet/code/hooks...dlghookadv.htm
: > >
: > > Rick - MVP
: > >
: > >
: >
: >
:
:

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.