Prev: RegClean
Next: MMControl (.wait = False Problem)
From: BeeJ on 31 Jul 2010 16:46 I want to stack forms in a certain order. Z pos - Form 0 - Main App Form 1 - Image Form (launched from Main Form, sits on top of Main App Form) 2 - Small Image Form #1 2 - Small Image Form #2. Note that Z2 only means above Z1 and Small Image Form #1 can be above or below #2 (not mandatory). Now the way I would do this is to use the following in the Main App Form. This works. Hope I got the following code right. fImage.Show , Me ' on top of main fSmallImage1.Show , fImage fSmallImage2.Show , fImage But, unfortunately, this not the new architecture. fSmallImage1 and fSmallImage2 are now each contained in ActiveX EXEs. One ActiveX EXE for each fSmallImageN. I have a class that all works except for setting the owner of the fSmallImage form. So I am not sure if this can be done this way or a different way needs to be applied, but right now I am trying to pass the fImage as an object to the ActiveX EXE to use in the fSmallImage1.Show , fImage. problem is, I get an out of stack space when I try to execute the sub to pass the fImage object to the ActiveX EXE. It all compiles to EXEs and all other interfaces to the ActiveX EXE work. 1) So, is this Marshalling (just trying to learn terminology here)? 2) Can I pass an object like this? (does not look like it) 3) what other method should I use to accomplish what I need? 4) maybe pass the hwnd and use SetWindowPos hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE ? But this does not specify a Z order. Or does it by sequence? Can I get multiple fSmallImage1 and fSmallImage2 etc (there are more) to lay on top of fImage. Do I assume that if they are SetWindowPos in the order 1,2 ... n then n is on top of 2 which is on top of 1 which is on top of fImage. This would mean passing hWnd from the Main app to the ActiveX EXEs. Since the ActiveX EXE is out of process, would this work? I could spend several days trying to code something but hoping someone will tell me the path to take so my coding efforts will be going in the right direction.
From: BeeJ on 31 Jul 2010 16:57 When I said I needed to pass the fImage form I was suggesting use of This sub in the ActiveX EXE. Public Function SetOwner(ByVal hwndToUse, ByVal hwndOfOwner) As Long SetOwner = SetWindowLong(hwndToUse, GWL_HWNDPARENT, hwndOfOwner) End Function 'SetOwner Does this also set the Z Order?
From: Nobody on 31 Jul 2010 17:19 I don't think you can set the parent or owner to another process. See the remarks section of SetParent() API function. So what you can ideally do is move the form to the standard EXE, or use SetWindowPos tricks, but this would cause some flickering when the user switches to another application, like when you activate Notepad which would be obscured by your inactive top most window until you remove the top most flag(from Deactivate event), so Notepad would flicker during the switch.
From: BeeJ on 31 Jul 2010 17:30 Nobody used his keyboard to write : > I don't think you can set the parent or owner to another process. See the > remarks section of SetParent() API function. So what you can ideally do is > move the form to the standard EXE, or use SetWindowPos tricks, but this would > cause some flickering when the user switches to another application, like > when you activate Notepad which would be obscured by your inactive top most > window until you remove the top most flag(from Deactivate event), so Notepad > would flicker during the switch. Sort of what I got too. May be OK since the user will not be messing with forms, just viewing them, so there should be no flicker during normal viewing. So is SetWindowPos like vbSystemModal for a MsgBox?
From: Nobody on 31 Jul 2010 17:42
"BeeJ" <nospam(a)nowhere.com> wrote in message news:i324m7$f5f$1(a)speranza.aioe.org... > So is SetWindowPos like vbSystemModal for a MsgBox? > Yes, like Task Manager. |