how can I keep top-level windows in their relative z-order

A top level window will come to the top of the z-order (here I am assuming no 
always-on-top windows) when activated, say by clicking on it.

But the owner of a top-level window will never be brought above its owned 
windows.

Does anyone know of a simple way to prevent the top-level windows of an 
application from changing their z-order when activated?

Why do I want to do this? I have an application that allows transparent 
Flash controls. As you know, transparent Flash control must be housed in a 
top-level window (Actually, they must be housed in a WS_EX_LAYERED window and 
a WS_EX_LAYERED window must be top-level.)

There is nothing that would prevent someone from creating 2 Flash controls - 
one acting as the background and the other supplying buttons. In fact, this 
is very likely. The buttons Flash could be placed over the background flash. 
If the user where to click the background it would come to the front and hide 
the buttons. 

I want to prevent the background from coming to the top.

I thought that SetParent might do the trick, but unfortunately as well as 
setting ownership it restricts the ownee to the area defined by the owner. 
This would work for my example above, but in general I could not restrict the 
user from defining a Flash control that extends beyond the area of the 
background Flash.

I have also tried WM_WINDOWPOSCHANGING but to no avail. The code just got 
hoary and never worked properly. I would OR in the SWP_NOZORDER bit, but the 
z-order changed anyway. Or I tried changing the hwndInsertAfter, with no luck.

Any thoughts?

0
3/17/2008 6:26:02 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
376 Views

Similar Articles

[PageSpeed] 41

Just trap the WM_MOUSEACTIVATE and return MA_NOACTIVATEANDEAT. This will 
prevent the window from being activated when a user clicks on it. There are 
a few gotchas when you don't activate a window, but I leave that for you to 
explore :).



"Gerry Suggitt" <GerrySuggitt@discussions.microsoft.com> wrote in message 
news:C61590E0-DE8D-4302-8D91-C5A7C36030BE@microsoft.com...
>A top level window will come to the top of the z-order (here I am assuming 
>no
> always-on-top windows) when activated, say by clicking on it.
>
> But the owner of a top-level window will never be brought above its owned
> windows.
>
> Does anyone know of a simple way to prevent the top-level windows of an
> application from changing their z-order when activated?
>
> Why do I want to do this? I have an application that allows transparent
> Flash controls. As you know, transparent Flash control must be housed in a
> top-level window (Actually, they must be housed in a WS_EX_LAYERED window 
> and
> a WS_EX_LAYERED window must be top-level.)
>
> There is nothing that would prevent someone from creating 2 Flash 
> controls -
> one acting as the background and the other supplying buttons. In fact, 
> this
> is very likely. The buttons Flash could be placed over the background 
> flash.
> If the user where to click the background it would come to the front and 
> hide
> the buttons.
>
> I want to prevent the background from coming to the top.
>
> I thought that SetParent might do the trick, but unfortunately as well as
> setting ownership it restricts the ownee to the area defined by the owner.
> This would work for my example above, but in general I could not restrict 
> the
> user from defining a Flash control that extends beyond the area of the
> background Flash.
>
> I have also tried WM_WINDOWPOSCHANGING but to no avail. The code just got
> hoary and never worked properly. I would OR in the SWP_NOZORDER bit, but 
> the
> z-order changed anyway. Or I tried changing the hwndInsertAfter, with no 
> luck.
>
> Any thoughts?
> 


0
somebody1181 (132)
3/18/2008 2:04:50 AM
Well, that does keep the deeper Flash from coming to the fore ....

but

(1) If an another application window is over the flash window, clicking on 
the flash window will not bring the flash application windows above the other 
application's windows (as would be the normal operation)

(2) I want the controls in the flash window to be activated. If the flash 
control contains a text box, for example, and I click on the text box, I need 
to have the text box become active and ready to accept input from the 
keyboard.

Problem (1) is readily fixed with a call to ShowWindow of the root window of 
the flash window with a argument of SW_SHOWNA

Problem (2) has no fix that I can think of



"Somebody" wrote:

> Just trap the WM_MOUSEACTIVATE and return MA_NOACTIVATEANDEAT. This will 
> prevent the window from being activated when a user clicks on it. There are 
> a few gotchas when you don't activate a window, but I leave that for you to 
> explore :).
> 
> 
> 
> "Gerry Suggitt" <GerrySuggitt@discussions.microsoft.com> wrote in message 
> news:C61590E0-DE8D-4302-8D91-C5A7C36030BE@microsoft.com...
> >A top level window will come to the top of the z-order (here I am assuming 
> >no
> > always-on-top windows) when activated, say by clicking on it.
> >
> > But the owner of a top-level window will never be brought above its owned
> > windows.
> >
> > Does anyone know of a simple way to prevent the top-level windows of an
> > application from changing their z-order when activated?
> >
> > Why do I want to do this? I have an application that allows transparent
> > Flash controls. As you know, transparent Flash control must be housed in a
> > top-level window (Actually, they must be housed in a WS_EX_LAYERED window 
> > and
> > a WS_EX_LAYERED window must be top-level.)
> >
> > There is nothing that would prevent someone from creating 2 Flash 
> > controls -
> > one acting as the background and the other supplying buttons. In fact, 
> > this
> > is very likely. The buttons Flash could be placed over the background 
> > flash.
> > If the user where to click the background it would come to the front and 
> > hide
> > the buttons.
> >
> > I want to prevent the background from coming to the top.
> >
> > I thought that SetParent might do the trick, but unfortunately as well as
> > setting ownership it restricts the ownee to the area defined by the owner.
> > This would work for my example above, but in general I could not restrict 
> > the
> > user from defining a Flash control that extends beyond the area of the
> > background Flash.
> >
> > I have also tried WM_WINDOWPOSCHANGING but to no avail. The code just got
> > hoary and never worked properly. I would OR in the SWP_NOZORDER bit, but 
> > the
> > z-order changed anyway. Or I tried changing the hwndInsertAfter, with no 
> > luck.
> >
> > Any thoughts?
> > 
> 
> 
> 
0
3/19/2008 7:57:00 PM
Reply:

Similar Artilces:

how can i change my email address outgoing.
Ok, I have an email address which is 'piggy backed' to my normal email address so that anything from work comes through to my outllook account. When i receive mail it comes through as being sent to it ok. My question is how can i set it up so that my personal email doesn't show up on outgoing mail but shows as my business mail address thus looking more professional.? me2130 wrote: > Ok, I have an email address which is 'piggy backed' to my normal email > address so that anything from work comes through to my outllook account. > When i receiv...

Can't find LDAP Directory Server for sending my mail
I am using my Outlook a lot. Have many contacts in my outlook system. When I like to look them up as a list, I get "Cant find LAPD directory server (81). My address book is not listing all the contacts that I have emailed to. Hope that you can help. Arthur Grin agrin <agrin@discussions.microsoft.com> wrote: > I am using my Outlook a lot. Have many contacts in my outlook system. > When I like to look them up as a list, I get "Cant find LAPD > directory server (81). My address book is not listing all the > contacts that I have emailed to. Hope that you can help. ...

Freezing Top and Bottom Rows
Can I Freeze both Top and bottom pane on my worksheet, so when I scrool up an down I can see them both. Thanks /keith Keith No. Just the top row(s) can be frozen. Sort of work-around.....Window>New Window>Arrange>Horizontal. Have one skinny window at bottom and freeze top row in top window. Turn off row and column headers, scroll bars and sheet tabs on skinny window. Gord Dibben Excel MVP On Sat, 09 Apr 2005 00:47:58 GMT, "Keith Camacho" <kfcam@earthlink.net> wrote: >Can I Freeze both Top and bottom pane on my worksheet, so when I scrool up >an dow...

When open windows mail, it appears "The file couldn't be shown"
I have two mail managers working in my PC: Outlook (for my personal mail), and Windows mail for my job. Both managers were working well, and even sometimes with both programs opened. After a windows actualization, I tried to open Win Mail and in the preview part of the screen (bottom), I see this notice: "The folder couldn't be shown. Win mail could not open this folder" "Possible reasons: Not enough disc space, or not enough memory" I have enough disc space (67GB, and 1 GB in RAM), so those are not the reasons (my archive are, at much, 1 GB). On the ...

how can I find and download a WAB DLL file for Outlook 2000
When trying to use outlook I get a error message "cannot find WAB DLL" I may have accidently removed it. What OS are you using? Curious since OL2000 isn't Vista compatible. "JEJE" <JEJE@discussions.microsoft.com> wrote in message news:E344280E-7FEC-4550-8255-E1069D4A8621@microsoft.com... > When trying to use outlook I get a error message "cannot find WAB DLL" I > may > have accidently removed it. if you are using vista, see http://www.outlook-tips.net/howto/vista_wab.htm otherwise, we need to know the version of windows. -- Diane Po...

curly quotes became straight, can't get curly bakc
something changed curly quotes to straight, and now I can't resume curly quotes. I assume you've already checked your AutoCorrect options to make sure replace straight quotes with curly quotes is checked, so let's look at the other simple fixes first. Have you recently changed to a new font? Some fonts don't support curly quotes. What version of Word are you using? Jerry "John Worsley Simpson" wrote: > something changed curly quotes to straight, and now I can't resume curly > quotes. And in some fonts it's really hard to recogni...

Can't Print Money 2004 Report
Can some kind soul please tell me how to print a year end report on Money 2004, listing All transactions by payees and all deposits. Thanks Ray In microsoft.public.money, R wrote: >Can some kind soul please tell me how to print a year end report on Money >2004, listing All transactions by payees and all deposits. I would start with the Account Transactions report. Customize, checking each tab for your preferences. In particular, on the Rows&Columns tab, I would select to SubtotalBy:Payee. Set the Date to Previous Year. You can sort by clicking column headings. To print, right-...

sevice packs not included in windows update??
I am running windows vista home premium and have had to reinstall. When going through the windows update the service packs dont show up. do i need to download and install manualy? -- smills98823 Windows Vista and Windows Server 2008 service packs are not available for installation through Windows Update: http://support.microsoft.com/?kbid=948343#method5 smills98823 wrote: > I am running windows vista home premium and have had to reinstall. When > going through the windows update the service packs dont show up. do i > need to download and install manualy? >...

How to keep touch screen keyboard on top?
Hi. Is there a way to keep the touch screen keyboard on top (sort of like 'always on top' option)? I'd like to be able to enter the tender amount with the touch screen keyboard, but whenever I bring up the tender screen, the touch screen keyboard disappears and doesn't reappear, even after tender is completed. I have to ctrl+f6 again to bring it up. Thanks. This is a multi-part message in MIME format. ------=_NextPart_000_03B7_01C6F446.94DD58A0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable dha, Resize (shrink) the POS ...

In excel can you select certain cells which contain the same text
If I have several cells with the same text in them can I filter these out and select them. I know you can do this for formula etc but can it be done for text? try data>filter>autofilter -- Don Guillett SalesAid Software donaldb@281.com "ade" <ade@discussions.microsoft.com> wrote in message news:937AD9E1-668B-4E32-B194-29146DF0A60A@microsoft.com... > If I have several cells with the same text in them can I filter these out and > select them. I know you can do this for formula etc but can it be done for > text? ...

windows vista 02-06-08
I can not reset the size of my fonts, etc. on any page that comes up On Wed, 6 Feb 2008 01:42:22 -0800, "barbara" <lefdalbarbara@clearwire.net> wrote: >I can not reset the size of my fonts, etc. on any page that comes up Please repost in a newsgroup supporting Windows Vista. This group is for the database software Microsoft Access. John W. Vinson [MVP] ...

Outlook 2003
If someone sends me several pictures they dont automatically display one above the other like they used to in OE before i upgraded to Outlook 2003? I can find the bit about automatically downloading pictures but those are for HTML emails - i want them to display if they are sent as attachments! driving me mad and wasting lots of clicks and time! help please!! thanks Not possible. And note that you didn't upgrade but are using a completely different program now ;-) -- Robert Sparnaaij [MVP-Outlook] www.howto-outlook.com Tips of the month: -Creating Signatures -Create an Office XP CD...

You can use Google Maps with an Acess DB
How to open a Google Maps showing a location from your database. Not sure if anyone is interested but it was asked a couple of days ago and I didn’t know a good answer - just in case you have looked at my 1st attempt :-) so I looked into it and came up with this. There will be other methods – so this is just one. To open Google Maps with the pointer placed on any location in your database. Notes: I assume you have a field called PostCode – if not then change the OnClick. The field must contain a real postcode (the link will fail if the postcode does not exist) This will work for anywh...

Order Table
HI, I have some questions regarding integrating web store with RMS... 1) Why can´t I see the "Order Table" when I query it in the Administrator? I have the structure but there is no PUBLIC_ equivalent and it returns a syntax error when I do a SELECT * From Order 2) What are the reference number and channel type fields in the "Order Table"? 3) What are the values for the Status field in the "Exchange Table"? In the docs I have only found that 1 means the order is processed. DOes 0 means it is not processed? are there other values? 4) I am integrating O...

How to organize my document folders in alphabetical order
My document folders were in alphabetical order which is the way I want them. Without my help, My Microsoft Publisher system changed the locations of my folders to a dated system. I want to change it back to alphabetical order, but don't know how. Please help. haywardcan wrote: > My document folders were in alphabetical order which is the way I > want them. Without my help, My Microsoft Publisher system changed the > locations of my folders to a dated system. I want to change it back > to alphabetical order, but don't know how. Please help. =========================...

Top 100 Mailboxes by Size #2
Hi all, I am newbie to this Exchange server, as per my project requirement i require performance object and counter for the "Top 10 Mailbox's by size across all the Exchange Servers under management". i gone through this link http://www.microsoft.com/technet/prodtechnol/exchange/guides/E2k3MgmtPakGuide/7acebaa2-6725-46a8-b049-421d6e93ed25.mspx?mfr=true in this i find one Script which calculate Top 100 Mailboxes by Size. but in this all are user defined performance counters and object. so can u sort out me in brief and Is there any performance counter to find the value of ...

Disk keeps filling up
Hello everyone... My Exchange server (Version 5.5) has a directory (Folder)... That keeps filling up with files and making my disk full. The folder name is: D:\EXCHSRVR\IMCDATA\IN\ARCHIVE I can't for the life of me figure out why... Can anyone help me? Just write2me@daleallen.com www.daleallen.com Thanks in advance Dale Allen CCNA, MCSE, CNE On Fri, 12 Aug 2005 09:50:24 -0400, "Dale" <banana_pages@yahoo.com> wrote: >Hello everyone... > >My Exchange server (Version 5.5) has a directory (Folder)... That keeps >filling up with files and making my disk f...

How can i to put a SharePoint web server in my DMZ zone.
I want to expose just one of my SharePoint web servers into my DMZ zone, how can i do this? ------=_NextPart_0001_B573D3EC Content-Type: text/plain Content-Transfer-Encoding: 7bit -------------------- Thread-Topic: How can i to put a SharePoint web server in my DMZ zone. thread-index: AcqsG05Zq7kgx6kqQe6fWBwYUxg65Q== X-WBNR-Posting-Host: 63.147.159.188 From: JACR <JACR@discussions.microsoft.com> Subject: How can i to put a SharePoint web server in my DMZ zone. Date: Fri, 12 Feb 2010 11:41:01 -0800 Lines: 2 Message-ID: <ACE6C606-D323-42E2-880B-A4815E253E87@microsoft....

In SUM cells the # sign keeps showing instead of total
AYE! my head... i'm sure it is simple, but i cannot get the SUM cells to show the currency amount. instead, the cells keep showing ####### after i enter the formula. can anyone advise me in how to stop this from happening? what's more annoying is that one SUM cell IS working properly. what have i done? thank you! frustrated student Widen the cell size Regards, Peo Sjoblom "fyremunki" wrote: > AYE! my head... > > i'm sure it is simple, but i cannot get the SUM cells to show the currency > amount. instead, the cells keep showing ####### after ...

Can't Open 2nd Window
I used to be able to click the "Launch Microsoft Outlook" icon on the left end of the taskbar to open up a second Outlook window, so I could have 2 mailboxes open at the same time. I could even do a search in one mailbox while working in the other window. Suddenly I can't do this. Clicking the "Launch Microsoft Outlook" icon just switches the current window to the inbox and does not open another window. My .pst file size is about 700K, considerably smaller than I used to keep it. I have run Repair Office from the installer. Any suggestions? Thanks. Right-cl...

How can I set all mail in inbox as unread?
After I read email, it isn;t showing as opened. I tried to change it so it owuld and inadvertently changed all emails to show as opened. How do I switch it back. My computer was stoeln (with no backup) and trying to recreate what I had before is a REAL challenge! You can select the messages which you want to mark as unread again and then use Edit-> Mark as Unread or press CTRL+U. -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, HowTo, Downloads, Add-Ins and more http://www.msoutlook.info/ Re...

Can't get it to print different multiple pages
I am trying to write a 150+ page book using Microsoft Publisher. It is really neat - I am enjoying myself. However I can't get the print options to work correctly. My book settings are 5.5 X 8.5 and I am showing 2 pages at a time like a regular book - that is all nice - however when I go to print a few pages - it doesn't print two seperate pages on each 8 1/2 X 11. It prints the same page twice. ie if I wanted to print pages 50-53 (I expected 2 pages) the first page would have pages 50 and 51 on it and the second page I would have 52 and 53 on it. But I am getting page 50 ...

Re: Changing a block of cells from relative to absolute references
To the kind person that posted VBA code to do this, my thanks. It appears that this is in fact the easiest (read only) way to do this. I sent it to someone that knows a bit more than me about such things (ie something :) ) and they commented ... This is a very nice tidy piece of code and should work quite well... Except missing a vital "End With" :-) Aint it always the way. :) For the sake of completeness and in the hope that it might prove useful for others, here is the code that worked : '**************************** START OF CODE ****************************** Opti...

Word documents minimize out of order
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel A user I support has an interesting Word problem. <br><br>As an example, lets say that she has six word documents open. The document on top is then minimized. Instead of going to the next document down, it goes all the way back to the very first document opened. <br><br>At this point, I'd like to note that the Mac I use does not have this problem. Both Macs run Leopard, and both have Office 2008 fully up to date. <br><br>Here is what I have tried to fix the problem: <br>...

How can I print a spreadsheet on 11x17 paper in Excel2000.
There are only 4 or 5 choices of paper size in the printer setup section. Most of these I do not not what they are . I have an old DOS sheet that is printed in compressed print on an 11x 17 dot matrix. The printer is defined as an Oki 393 which is a wide-carriage printer. I can convert the worksheet to Excel with no problem but I cannot get it to print. Would like to maintain the continuity. Thanks for any help. ...