|
-
Nov 13th, 2000, 12:52 PM
#1
Thread Starter
Fanatic Member
OK, I'm using this API function in Access97 to give me a standard File Open dialog box. However, when the dialog box appears, it is placed close to the top left hand corner of the screen.
Being as aesthetically anal as I am, how can I centre this dialog box in the middle of my screen
Thanks in advance...
-
Nov 13th, 2000, 12:53 PM
#2
Thread Starter
Fanatic Member
In case you missed it, teh function is GetOpenFileName Lib "comdlg32.dll"
-
Nov 13th, 2000, 02:30 PM
#3
Frenzied Member
You're in luck I'm building a windowhandler class 
Code:
'Here are some types and api calls:
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
Private Declare Function MoveWindow Lib "user32" (ByVal hWnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
First find the handle of the window:
Code:
FindWin = FindWindow("Class", "Caption")
Then move it with this:
Code:
Public Function Move(WinhWnd As Long, x As Long, y As Long, Optional width As Long, Optional height As Long)
Dim win As RECT
GetWindowRect WinhWnd, win
If width = 0 Then width = win.Right - win.Left
If height = 0 Then height = win.Bottom - win.Top
MoveWindow WinhWnd, x, y, width, height, 1
End Function
Let me know if you need something!
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Aug 16th, 2001, 01:39 PM
#4
Member
How do you deal with threading? The File Open Dialog box does not exist until you call the GetOpenFilename Function.
And no code is run until the program receives the response from the Function. Am I missing something?
I am currently using the Common Dialog API to get several filenames from the user. I want to save the changes
that the user makes to the file display (ie List view or Detail view and Sort by column), but I can't modify the dialog
box because I can't run any code while it exists.
Any help would be appreciated.
Kevin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|