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

Minimizing forms in a dll

P: n/a
I have a dll written in VB6 that exposes a form. The dll is called from
VBA in an Access 2000 application. I need to get the form to minimize
when the user minimizes the Access application window.

I cannot use the normal VB6 frmXX.Show vbModal, OwnerForm statement
because the OwnerForm in this case is not a VB6 form, it is the Access
application window.

Any ideas?

Peter

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Use the SetParent API to set the Access app as the parent window for your VB
form, then whne Access is minimixed so will your form.
--
Terry Kreft
MVP Microsoft Access
"Peter" <an*******@devdex.com> wrote in message
news:40**********************@news.newsgroups.ws.. .
I have a dll written in VB6 that exposes a form. The dll is called from
VBA in an Access 2000 application. I need to get the form to minimize
when the user minimizes the Access application window.

I cannot use the normal VB6 frmXX.Show vbModal, OwnerForm statement
because the OwnerForm in this case is not a VB6 form, it is the Access
application window.

Any ideas?

Peter

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #2

P: n/a

Terry, thanks.

I have tried that, but the window seems to lock up. In the platform SDK
it says that you should set the WS-CHILD style before calling SetParent
and in Windows 2000/XP you have to synchronize the UISTATE.

I think I may be getting out of my depth here, unless there is an easier
way out.

Peter

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3

P: n/a
Hmmm, I've seen that with other apps but Access has always behaved for me.

Essentially the steps are
1) get the hwnd of Access (just use hWndAccessApp normally)
2) pass the hWnd from 1 to the forms executable
3) use EnumChildWindows to get the hWnd for the MDIClient window
4) use the hWnd from 3 in the SetParent API call

--
Terry Kreft
MVP Microsoft Access
"Peter" <an*******@devdex.com> wrote in message
news:40**********************@news.newsgroups.ws.. .

Terry, thanks.

I have tried that, but the window seems to lock up. In the platform SDK
it says that you should set the WS-CHILD style before calling SetParent
and in Windows 2000/XP you have to synchronize the UISTATE.

I think I may be getting out of my depth here, unless there is an easier
way out.

Peter

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.