Mad Except Box Need to stay on top with applicaion

contains all delphi packages mentioned below
hareram
Posts: 15
Joined: Wed Sep 08, 2010 6:45 am

Mad Except Box Need to stay on top with applicaion

Post by hareram »

Hi,

[b]How to make madExcept exception box "stay on top" with my application?

My code is to make it stay on top as:
[/b]
//========================================================================
procedure MyOnExceptBoxCreate(exceptBox: dword; simpleMsgBox: boolean);
begin
with MESettings do SetTopmost (GetExceptBoxHandle,True); //True = need to stay on top
end;
//========================================================================
initialization
with MESettings do OnExceptBoxCreate := MyOnExceptBoxCreate;
//========================================================================

By this code Exception Box stay always on top even with other application too.

Thanks in Advance
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Mad Except Box Need to stay on top with applicaion

Post by madshi »

Looks ok to me. Is there a question hidden in your post? Or did you just want to share your idea?
hareram
Posts: 15
Joined: Wed Sep 08, 2010 6:45 am

Re: Mad Except Box Need to stay on top with applicaion

Post by hareram »

I had posted my query not an idea.

My question is:
How to make madExcept exception box "stay on top" with my application?

currently it stays always on top with other windows too, but I need to make it stay on top with my application.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Mad Except Box Need to stay on top with applicaion

Post by madshi »

Can you explain in a bit more detail? I'm not sure I understand what you mean exactly...
hareram
Posts: 15
Joined: Wed Sep 08, 2010 6:45 am

Re: Mad Except Box Need to stay on top with applicaion

Post by hareram »

Let me explain through an example:

suppose we have an application "ABC Management System" in which MadExcept is enabled. When any exception raised in application, the madExcept box will appear to user with error information. The error dialogue box should always stay with the application as dialogue on top of the application.

In my case...
The error dialogue box appears on top of the application but if you go to other window like MS Word, the error dialogue box still stay on top of the MS Word window if you not handle the error box. The Error Message box must be stay with application in which the exception raised.

I hope the above details will help you to understand the issue.

If you still have any confusion please let me know...
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Mad Except Box Need to stay on top with applicaion

Post by madshi »

Have you tried "SetTopmost(..., false)" in your "MyOnExceptBoxCreate" handler?
hareram
Posts: 15
Joined: Wed Sep 08, 2010 6:45 am

Re: Mad Except Box Need to stay on top with applicaion

Post by hareram »

Yes, that's make strange, If you will not clear madExcept box it goes behind the application and you will not get any more exception error message. I need to make it stay on top with application.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Mad Except Box Need to stay on top with applicaion

Post by madshi »

You could try using "SetParent" to make the madExcept window a child of your main window. This way the madExcept window should probably stay on top with your application. I haven't tried that myself yet, though. If you want to do this you should probably make sure that the option "pause all running delphi/bcb threads" is disabled here:

http://help.madshi.net/madExceptSettings2.htm
hareram
Posts: 15
Joined: Wed Sep 08, 2010 6:45 am

Re: Mad Except Box Need to stay on top with applicaion

Post by hareram »

It's really looks good...!

I am unable to locate the madException box where I will have to set it as "SetParent". Please add steps to make it as child window or if you have any source that could be great (if any).

Thanks!
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Mad Except Box Need to stay on top with applicaion

Post by madshi »

You should be able to call SetParent in "MyOnExceptBoxCreate". You may have to change the window styles (SetWindowLong(GWL_STYLE)), I'm not sure.
hareram
Posts: 15
Joined: Wed Sep 08, 2010 6:45 am

Re: Mad Except Box Need to stay on top with applicaion

Post by hareram »

It's not working.

TY
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Mad Except Box Need to stay on top with applicaion

Post by madshi »

hareram wrote:It's not working.
A few more details, please?

BTW, do you have a commercial license, or are you using the non-commercial edition?
hareram
Posts: 15
Joined: Wed Sep 08, 2010 6:45 am

Re: Mad Except Box Need to stay on top with applicaion

Post by hareram »

Yes, I have commercial license.
iconic
Site Admin
Posts: 1065
Joined: Wed Jun 08, 2005 5:08 am

Re: Mad Except Box Need to stay on top with applicaion

Post by iconic »

See if SetWindowPos() helps, pay special attention to the second parameter.

--Iconic
hareram
Posts: 15
Joined: Wed Sep 08, 2010 6:45 am

Re: Mad Except Box Need to stay on top with applicaion

Post by hareram »

I have already used the SetWindowPos() and tried with both true and false as second parameter. By using "false", MadExcept box goes behind the screen and "true" make the box stay on top with every windows.

My objective is to make the exception box stay on top with application and user can not carry their work until madeExcept box handled.
Post Reply