how to get top most *visible* window?

Hi,

How can I get top most window in Z order on the system which is
visible only ? My application shows a top most window.
Here is my code to get top most window where I used GetWindow function
to get top most window relative to my window hMyTopMostWindow.

HWND hSystemTopMostWindow = GetWindow(hMyTopMostWindow, GW_HWNDFIRST);
while (!IsWindowVisible(hSystemTopMostWindow))
{
	hSystemTopMostWindow = GetWindow(hSystemTopMostWindow, GW_HWNDNEXT);
}

Using above code serves my purpose but not feasible to use it when I
am using it in iterative calls. Is thers any window function that does
same thing ?( Get top most window which is visible only)

Thanks,
Ajay

0
4/20/2007 2:29:12 PM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
547 Views

Similar Articles

[PageSpeed] 30

Reply:

Similar Artilces:

WM_QUERYCENTERWND and detecting creation of modal window.
I found that, the parent window is receivinig WM_QUERYCENTERWND when new modal window is started under that parent. I can capture that message in method CDialog::WindowProc. Capturing WM_QUERYCENTERWND is better then capturing WM_ENABLE, because when UI is multithreaded, it is possible to have two or more modal windows simultaneously connected to one parent (each modal window on separate thread). When second modal window is connected to parent window, I don't receive WM_ENABLE, but I receiving WM_QUERYCENTERWND each time when new modal window is shown. I need to count how many mo...

How to write text to command prompt console windows?
I am using VC++ 6.0 to build a windows based application, however, my application allows user to input command arguments in the dos prompt windows. I want to have a warning message for user if they have input the wrong arguments. How can I write text to the dos prompt windows if user input the wrong arguments? Thanks in advance. Steven. Steven wrote: > I am using VC++ 6.0 to build a windows based application, however, my > application allows user to input command arguments in the dos prompt > windows. I want to have a warning message for user if they have input the > wrong ar...

Keep getting this Error ID: 0x800CCC0F
Any suggestions on how to fix this error? Your server has unexpectedly terminated the connection. Possible causes for this include server problems, network problems, or a long period of inactivity. Subject 'Fw: ' Server: 'smtp.gmail.com' Windows Live Mail Error ID: 0x800CCC0F Protocol: SMTP Port: 25 Secure(SSL): Yes "Poodlenation" <Poodlenation@discussions.microsoft.com> wrote in message news:E5FED1D7-835F-4BFE-B7E7-D81D05696967@microsoft.com... > Any suggestions on how to fix this error? > > Your server has unexpectedly terminat...

All in one Windows 2003 Server as PDC with SQL and CRM
hello, can i install an Microsoft CRM Production Server as an All-In-one Solution with Microsoft CRM and SQL 2000 Server on the PDC (Windows 2003 Server)? Is this supported? What are the possible disadvantages besides not having an secondary Domain Controller for extra security? Andy in a testing environment this works but in production is not a good idea. The only supported single server deployment is sbs 2003 etc. why not supported? apart from SBS you should never start treating your domain controllers as application servers as if anything goes wrong you risk losing your entire AD....

Windows Server 2008 Installation Error
Hi , I am trying to install WinServer 2008 checked build x86 in my computer but I get following error when I put the key: Windows Server 2008 Installation Error: Windows installation has encountered an error and needs to be restarted. i restart the installation but the problem happens again. any fix for this? Thanks, Are you booting from the installation media? -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "dfrg" wrote: &g...

Windows Explorer
One of my document folders has a bold heading that reads "Unspecified". The folder name is "2008". If I name it anything else, the heading disappears. What does this heading mean? -- ....Len -------- Original-Nachricht -------- > One of my document folders has a bold heading that reads "Unspecified". The > folder name is "2008". If I name it anything else, the heading disappears. > What does this heading mean? Maybe an answer: http://support.microsoft.com/kb/306554 Look into the second to last paragraph. Ber...

Priority Option on the MO Entry Window
Is there a way to set the default (Low medium or High) in the Manufacturing Order Entry Window? I would like it to default to Low, but it now defaults to medium... thanks! -- Doug Dear Doug, Actually it does not exist as option, but if you have VBA module registered, this will be easily customized, just add the form and the priority field to VBA and paste the following code lines: Private Sub Window_AfterOpen() Priority.Value = 1 End Sub Regards, -- Mohammad R. Daoud MCP, MCBMSP, MCTS, MCBMSS Mob: +962 - 79 -999 65 85 Great Package For Business Solutions daoudm@greatpbs.com http://...

ERROR 1053 when strating CRM 1.2 on Windows 2003
When strating the MSCRM Security Service I get the following error. ERROR 1053: THe service did not respond to the strat or control request in a timly fashion. We have just installed CRM prior to migrating it from a 2000 server. Any sygestions on what could be causing this ?? Thanks ...

can not accses my email i get Error Number: 0x800CCC32
Unable to poll for new messages on your HTTP server. Account: 'Hotmail', Server: 'http://services.msn.com/svcs /hotmail/httpmail.asp', Protocol: HTTPMail, Server Response: 'Authorization Required', Port: 0, Secure(SSL): No, Error Number: 0x800CCC32 abe <anonymous@discussions.microsoft.com> wrote: > Unable to poll for new messages on your HTTP server. > Account: 'Hotmail', Server: 'http://services.msn.com/svcs > /hotmail/httpmail.asp', Protocol: HTTPMail, Server > Response: 'Authorization Required', Port: 0, Secure(SSL): ...

Problems Getting a Field to Work in a New Mail Message form
I have Outlook 2000 SR-1 using IMO (Internet Mail Only - not Exchange Server). Does anyone know of a way to make sure the From: field appears in a new mail message? For reasons too lengthy to get into, it would be very helpful for me to see the From: field (with my default email address already filled in, of course) as well as they typical To:, CC: and Subject: fields when composing a new email. I did try to create a new form (Tools >Forms >Design a Form >Message) but when I used it, the default email address did not appear. What am I doing wrong? Thanks, Sangrateo SangrateoATanonymo...

How can I change the Z-axes of my window or dialog? #2
Hello, All: I am now meetting a problem that the sub-window( or sub-dialog) would not be shown out in front of the parent window, however, I just wanna let it be shown in front of my parent window. Is there anybody who knows how I can set the Z-axes with any function? Thanks in advance! ...

Coding problems with User defined Visible Property
Hi I have a report that my users supply to seavel groups. Some do not require certain fields so these will be hidden by using a checkbox on the relevant form. At the moment, I am using the following in code builder: Me.txt[recordNumber].Visible = Forms![Pdoptions]!chk[recordnumbersvisible] Which isn't doing the job. I've checked all the names and they are correct. This code gives me eaither a syntex error, or an expected end error, but I can find no problem. The code is sitting in the "on format" property of the detail section header, of the report I need this to work in. If...

Exchange 2003/SP2 cant get SPF working
I am trying to test SPF in SP2 I have defined my SPF policy to reject mail that fails an SPF check I have a test domain that I have deliberately configured the SPF field to claim mail will only be generated from the wrong host. I have defined the SPF policy to reject mail that fails the SPF check and then gone to the default Virtual SMTP server (the only one defined) and turned on SPF filter for that connection. I stopped & started the SMTP server. I then use that domain to send a mail to the Exchange server (single server - ie not a front/back end setup). The mail should have ...

Cant get "Platform Builder" to appear under "Project Types" in VS2005
Hi Everyone, We've just purchased PB 6 and am trying to install it on one of our development stations, but no matter how many times I've installed/ deleted/reinstalled VS2005 and WinCE 6 I cannot for the life of me get it to appear in the project types list for when creating a new solution. It wont even allow me to open an existing project from the demo WinCE 6 folder. I'm now in to my 3rd day of battling with this ! Though the PB icon shows on the splash screen as it starts, as does some of the CE6 'getting started' stuff on the start page. It has had the ...

on server reboot multiple emails get returned as undeliverable
I have an SBS 2003 server running exchange, all latest service packs etc. We have hit a problem a couple of times when on reboot of the server end users get emails returned as undeliverable as they have exceeded the delivery date. It does not affect all outgoing messages, and the destinations are valid. It is as though the SMTP gets stuck on some messages, and only notices on re-start. Any ideas? F Frank <noreply@127.0.0.1> wrote: > I have an SBS 2003 server running exchange, all latest service packs > etc. > We have hit a problem a couple of times ...

maximize window
A co-worker worked on an Excel spreadsheet that we both use and Saved it. Now, when I open it, the workbook window is not maximized nor can I because the 3 buttons in the upper right corner of the window (Minimize, Maximize and Close) are nowhere to be found. The co-worker is unavailable for me to ask him what he did. How do I get the 3 buttons back so that I can maximize the window? TIA David Two options. If the title bar is just off the screen and you can't see it: Window|Arrange|Tiled (and resize the way you like it) If you can see the whole title bar, and that title bar is...

Getting info from the last used cell
Currently I am adding many sheets together. I am using "Start Sheet" and "End Sheet" and everything in between those two sheets is adding for a total. I would (in a few cells) to just get the data from the last cell used. Example: The sheets I am adding are dates and if sheet 01-19-09 (dd-mm-yy) has the last entry in cell c18 I would like that number. However there may be blank cell before that sheet. and after that sheet there will be info in other cells. I would like that info to go into c18 of the sheet I use and named "Totals". -- Ed Davis ...

windows update fail...... What now?
ok so I had a problem with windows update downloading but not installing.. I did go to the windows file in the C: drive and manually installed it myself. Thinking that it would fix my install problem.. I was wrong.. I next have found out that in my event logger that my IIS6 is not working properly or something. It doesn't look right and in my event logger it says my security assessment tool 4.0 error 1303 I am the administrator and logged in already so what the heck? And I also would like to say that my computer is old and it's a IBM think pad running windows xp perfessio...

unable to delete Windows.edb file
I am trying to delete my Windows.edb file which is in C:\Documents and Settings\All Users\Application Data\Microsoft\Search\Data\Applications\Windows I have indexing service set to manual and off. I also have Microsoft Search disabled. But when I try to delete the Windows.edb file, I get a file in use message and it won't delete. What else uses it? I am also getting a bungh of MSSBC4xx.log files that show up in the same folder. There are about 50 of them now. Where do they come from? And is it related to my being unable to delete the ..edb file? Thanks, ...

Retrieving the Top 10 of the Average of Two columns, but displaying a third
I'm new to Excel programing, so please bear with me. I have an excel spreadsheet with 3 columns. Column1 Column2 Column3 -------------------------------------- John Doe 5 3 Jane Smith 2 9 Bill Smith 4 2 What I need to do is take the average of Column 2 and 3, find the highest average of the entire list and display Column 1 as the final result. In other words: I need to create a Top 5 List of the people with the highest grade average. I don't care much for displaying the grade, I just need the top 5...

Run full size window application
How should I set an MFC application to run on full size window (as maximized) when application does start? I tried to set as a predefined size on MainFrm, in PreCreateWindow() but does not doing what I need (e.g. ::SetWindowPos(m_hWnd,HWND_TOP,x1,y1,x2,y2,NULL); Thanks, Chris On Mon, 12 Jul 2004 10:12:07 -0400, Chris <chris@ca.ca> wrote: >How should I set an MFC application to run on full size window (as >maximized) when application does start? >I tried to set as a predefined size on MainFrm, in PreCreateWindow() >but does not doing what I need (e.g. >::SetWindowPos(m_h...

Send and Receive window keeps opening
Every time Outlook does a send/receive, the progress window comes up, even though I clicked the box to not show the window again. Anybody know why this is happening and how to kill it? ...

Can I use Windows XP Home for Commercial ?
i would need to clarify on this matter whether can we use Windows XP Home edition for a commercial ? is it legal ? a lot of people told me that it is okay using Windows XP Home for commercial but it just that we cannot fully utilize the feature of the Windows i.e. joined domain ...etc I also cannot find anything in Windows XP Home EULA that the Home edition is only for NON-Commercial use. Can anyone clarify this to me ? Jim wrote: > i would need to clarify on this matter whether can we use Windows > XP Home edition for a commercial ? is it legal ? a lot of people > told ...

A Crystal Beginner
I am using Crystal 9.2.4.77 and have loaded the Crystal enhancements. Now I want to do against the CRM database. What do I do? I thought I would create a data source to the CRM SQLserver, which I did, then connect to it through Crystal Reports. That works, but when I drill down on the AAA_MSCRM database to choose my tables, it shows me dbo as the only option (where did this come from??) and under that are just a few generic tables. No CRM tables. Something's not quite right. What am I missing? file - log on to aps server "KBLawson" <klawson@aetinc.com> wrote in ...

"cannot open outlook window" message
I have been using Outlook Professional for about a year, operating system Windows 7 home premium 32bit. I started receiving this error message yesterday and every fix I have tried has failed. Does anyone have a fix? Thank you, -- Genaro And what would 'every fix' be exactly? "Genaro" <Genaro@discussions.microsoft.com> wrote in message news:29E29D2C-32A1-463C-A85F-77D13D575160@microsoft.com... >I have been using Outlook Professional for about a year, operating system > Windows 7 home premium 32bit. I started receiving this error message >...