Solved

XP Z-order consistently messed up in my application

Posted on 2008-06-24
3
502 Views
Last Modified: 2010-04-21
Hi developers and experts.
I cannot tell you how frustrating this has been and the embarassment it has caused me with my client.
My application runs just fine on my PC - and even other PCs, but one particular client running Windows XP Professional Service Pack 2 find that my application hangs and he has to terminate it - this is because windows get 'stuck' behind other windows. This normally occurs if I show a "modal" window or stay-on-top window - things like popup messages asking you to choose Yes or No before it will let you continue. Well if XP re-arranges the Z-order then the modal windows can get stuck behind other windows in the application and the user cannot see the active window.

Now originally I thought I solved the problem - GHOSTING!.
In my application I disable XP ghosting - but it seems he continues to have a problem.

Sometimes Alt-Tabbing out of the application and back in brings the correct form to the front - but now even that's not doing the trick.

If anybody knows anything that can help me please share!
0
Comment
Question by:rfwoolf
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
ichian01 earned 500 total points
ID: 21887880
It has to do with the way the app is coded.  If the window is coded with the property Always On top is true, and its parent throws a modal dialog box, and the window covers that dialog box there's no way to access it, because that modal box belongs to the parent, and the floating window also belongs to the parent.  The only solution is that if you're popping modals is to pop it from the child.  Hope this makes sense.
0
 
LVL 13

Author Comment

by:rfwoolf
ID: 21910123
Yes after digging even DEEPER (after many hours put in already into this problem in the past) I came up with the idea to check all my forms main settings:
-FormStyle
-PopupParent
-PopupStyle
and I saw a pattern with some of the problem forms were Stay-On-Top forms.
So I went through all 40 or so forms in my application and changed them to fsNormal - the client says the problem seems to be gone!
Other things I did:
  Instead of Showmessages my application now uses windows.messagebox(FormHandle, msg) because apparently this provides windows with a form handle to stipulate the parent of the message - whereas Showmessage could come from the application as a parent (therefore the Main Form).
  I also disabled Windows Ghosting.

Thanks for the answer though -you seem to have it right! @#$@ing fsStayOnTop is evil!!!
0
 
LVL 13

Author Closing Comment

by:rfwoolf
ID: 31470403
Thank you!
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
matchUp  challenge 9 93
word0 challenge 3 78
no display on laptop 5 74
Trouble with References... 5 43
There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now