[AccessD] Specifying where to open browser

Michael R Mattys michael.mattys at adelphia.net
Tue May 27 20:59:07 CDT 2003


Kathryn,

The best thing you could do is
1) Make your OFN into a stand-alone function
    that returns a string.
2) Create a small form and open it to the middle
    of your screen using MoveSize. Make this form's
    hwnd the parent for your dialog box.
3) When you get lReturn, then close the little form.

P.S.
I have looked this over and tried to fit in
FindWindow("#32770", "Select Photo"), but it just can't be done.
And you would not believe what goes into CreateWindowEx, so
just creating the form is the easiest way to go.

Michael R. Mattys
www.mattysconsulting.com

----- Original Message -----
From: "Kathryn Bassett" <kathryn at bassett.net>
To: "dbAdvisors (AccessD)" <accessd at databaseadvisors.com>
Sent: Tuesday, May 27, 2003 7:35 PM
Subject: [AccessD] Specifying where to open browser


> There is an event procudure that opens the "look in" browser. What would I
add to the below (and where) to get the blasted thing to open in the center
of my screen instead of the upper left of the screen. I need to see upper
left portion of the underlying form, to remind me of the name of the person
I'm looking for in the "look in", and the way it is now, I have to drag it
out of the way.
>
> Thanks,
>
> Private Sub btnbrowse_Click()
>          Dim OpenFile As OPENFILENAME
>          Dim lReturn As Long
>          Dim sFilter As String
>          OpenFile.lStructSize = Len(OpenFile)
>          OpenFile.hwndOwner = Me.hWnd
>          OpenFile.hInstance = 0
>          sFilter = "" & Chr(0)
>          OpenFile.lpstrFilter = sFilter
>          OpenFile.nFilterIndex = 1
>          OpenFile.lpstrFile = String(257, 0)
>          OpenFile.nMaxFile = Len(OpenFile.lpstrFile) - 1
>          OpenFile.lpstrFileTitle = OpenFile.lpstrFile
>          OpenFile.nMaxFileTitle = OpenFile.nMaxFile
>          ' Start looking in the same directory as the database
>          OpenFile.lpstrInitialDir = "D:\MyFiles\Online\muir63\photos63\"
>          ' Set the caption on the dialog
>          OpenFile.lpstrTitle = "Select Photo"
>          OpenFile.flags = 0
>          lReturn = GetOpenFileName(OpenFile)
>          txtPhoto = Left$(OpenFile.lpstrFile, InStr(OpenFile.lpstrFile,
Chr$(0)) - 1)
>
> --
> Kathryn Rhinehart Bassett (Pasadena CA)
> "Genealogy is my bag" "GH is my soap"
> kathryn at bassett.net
> http://bassett.net
>
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>



More information about the AccessD mailing list