Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

XP Z-order consistently messed up in my application

Posted on 2008-06-24
3
Medium Priority
?
514 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
ichian01 earned 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

618 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