|
-
Sep 13th, 2010, 07:35 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Allaways at the Bottom [of the forms of my proyect]
Allaways at the Bottom [of the forms of my proyect] Not all windows!!
Assuming that I have 7 Forms, as I do that the seventh is located under the other? (Without calling at 6 one by one and bring them before ...)
Something with SetWindowPos ()?
Something like this¿??
http://www.vbforums.com/showpost.php...2&postcount=10
Thanks
-
Sep 13th, 2010, 08:17 PM
#2
Re: Allaways at the Bottom [of the forms of my proyect]
What is wrong with using that code?
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Sep 14th, 2010, 02:00 AM
#3
Thread Starter
Addicted Member
Re: Allaways at the Bottom [of the forms of my proyect]
I need a form that allaways on top of those who do not belong to my project, but also is always in the background to windows of my project ...
Is it possible?
thanks!
-
Sep 14th, 2010, 07:32 AM
#4
Thread Starter
Addicted Member
Re: Allaways at the Bottom [of the forms of my proyect]
-
Sep 14th, 2010, 08:58 AM
#5
Re: Allaways at the Bottom [of the forms of my proyect]
There is no such thing, you will have to do this manually.
Window Z-Order is thought of as a stack. The highest in the Z-Order is top in the Z-Order. There is a special category used with SetWindowPos: hwnd_TopMost. All other windows are in a 2nd category: General
1) All TopMost windows can only change Z-order between other top most windows. No other windows can appear above TopMost windows (except of course, other TopMost windows)
2) All General-category (non-TopMost) windows can be activated and Z-Order changed within their group. No general-category window will be placed above TopMost
There is no bottom-most category. A window can be sent, in Z-Order, behind another window, but you have to know which window handle, or send it using hwnd_Bottom which sends it to the very lowest Z-Order. None of the categories is process/thread-specific.
Also, if you have 7 forms open, there is nothing preventing some other app's windows from mixing in between, your forms (Z-Order wise)
Now, if this applies, remember that an owned window can never be placed below the owner window in Z-Order. Owned windows are a category within a category. Owned windows can change Z-Order between owned windows of the same owner, but never drop below the owner. No other window can come between the owner and its owned windows.
Sounds like you'll need to develop a way of keeping informed of the Z Order of your 7 windows. The user clicking any of the 7 will bring it to the top (unless it is an owner window).
Edited: I think I have a way, just need to use some imagination....
Knowing how owned windows/forms work. Here's the idea
1. Use a form that has no purpose whatsoever, other than being an owner. Call it frmOwner
2. Load this form, but do not show it. It is hidden
3. All other forms in your project are loaded as that form as the owner, i.e., Form2.Show , frmOwner
4. Now use hwnd_bottom with SetWindowPos to move any of your forms to the bottom & it will only move to the bottom of the other owned forms
-- SetWindowPos on your owned forms will only apply in the context of the other owned forms
5. Remember to unload your owned form at some point else it will keep your app loaded in Task Manager.
Here's the tricky part & I'll leave it to your to work out (not too difficult). How do you unload an owner form from an owned form? Doable.
This is also not perfect and requires more thought. If you use SetWindowPos for one of the owned forms to send it to the bottom of the other owned forms, it will move the owner & all other owned forms to the bottom of the entire desktop. Mixing the 2 options above (owner forms & manually keeping track of Z-Order) would provide a method to prevent any other app windows from mixing in with your forms.
Well, you have 3 options worth considering: Manually monitoring & moving windows, working with owned windows, or your original plan
Last edited by LaVolpe; Sep 14th, 2010 at 09:29 AM.
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
|