?
Solved

XP Z-order consistently messed up in my application

Posted on 2008-06-24
3
Medium Priority
?
511 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.
Suggested Courses

752 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