Drew Wutka
DWUTKA at marlow.com
Wed Jan 31 16:24:25 CST 2007
Yep. It's a snippet from something I did with Susan, where you put a form on top of everything on the desktop....and it stays on top of everything. (You can do the same thing with Window's Task Manager, if you select the Always On Top option....same with Media Player) I modified the code to force the form on top, but if something moves back over it, (another window), it will be behind it. Just try it, should do what you want to do. (You could put it into it's own module, just change the function declaration, and add an argument to replace Me.Hwnd (which is what you would send the function from a calling form) Drew -----Original Message----- From: JWColby [mailto:jwcolby at colbyconsulting.com] Sent: Wednesday, January 31, 2007 4:10 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] BringToFront What do you mean it doesn't stick. Will it stick long enough for the user to click the button and cause that form to close? John W. Colby Colby Consulting www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka Sent: Wednesday, January 31, 2007 5:00 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] BringToFront Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _ ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal _ cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Const SWP_NOMOVE = &H2 Private Const SWP_NOSIZE = &H1 Private Const HWND_TOPMOST = -1 Private Sub PutMeOnTop() SetWindowPos Me.Hwnd, HWND_TOPMOST, 0, 0, 0, 0, _ SWP_NOMOVE Or SWP_NOSIZE End Sub This will put the form in front of everything. It doesn't 'stick' though. Access forms are subclassed windows, so to put it truly always on top is a little trickier. Drew -----Original Message----- From: JWColby [mailto:jwcolby at colbyconsulting.com] Sent: Wednesday, January 31, 2007 3:41 PM To: 'Access Developers discussion and problem solving' Subject: [AccessD] BringToFront Is there a Bring To Front for a FORM? I may have a series of progress meters, which open modal, and as it happens centered and right on top of each other. I have devised a way to display an OK button which I display the very last line as that process finishes IF I want the user to know that a specific process finished. The problem is that things being the way they are, the one that is finishing may be physically hidden by another progress meter on top. I need to cause the progress meter that is displaying the "OK to continue" to pop in front of anything else that may be currently displayed. John W. Colby Colby Consulting www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com