 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ricardo F. de Oliveira Guest
|
Posted: Tue Apr 27, 2004 1:18 pm Post subject: blocking application with showmodal |
|
|
Hi,
situation:
1)- i open my application
2)- click in a button to show a configuration window with showmodal
3)- open other application, ex. word, excel, etc.
4)- back to my application,
the configuration window is hiden, and i cant do anything more, the app stay
blocked,
obs. 1) my application is MDI,
2)- is dll dependent,
3) some windows are static and others are created at runttime.
any help or tip is welcome,
thanks,
Ricardo
|
|
| Back to top |
|
 |
Andrue Cope Guest
|
Posted: Tue Apr 27, 2004 1:42 pm Post subject: Re: blocking application with showmodal |
|
|
On Tue, 27 Apr 2004 10:18:12 -0300, Ricardo F. de Oliveira wrote:
| Quote: | any help or tip is welcome,
|
This has been noticed before. There was an interesting response some time
last year but that was relating to trying to emulate ShowModal without
using ShowModal().
FWIW the Borland IDE also suffers from this problem under some conditions.
--
Andrue Cope
[Bicester UK]
|
|
| Back to top |
|
 |
Ricardo F. de Oliveira Guest
|
Posted: Tue Apr 27, 2004 2:28 pm Post subject: Re: blocking application with showmodal |
|
|
Where can i find the "interesting response"?
is it possible yet?
thanks,
"Andrue Cope" <no.spam (AT) spammy (DOT) com> escreveu na mensagem
news:30x7wbldc8s4$.1ehlr03ggi52.dlg (AT) 40tude (DOT) net...
| Quote: | On Tue, 27 Apr 2004 10:18:12 -0300, Ricardo F. de Oliveira wrote:
any help or tip is welcome,
This has been noticed before. There was an interesting response some time
last year but that was relating to trying to emulate ShowModal without
using ShowModal().
FWIW the Borland IDE also suffers from this problem under some conditions.
--
Andrue Cope
[Bicester UK]
|
|
|
| Back to top |
|
 |
Andrue Cope Guest
|
Posted: Tue Apr 27, 2004 3:38 pm Post subject: Re: blocking application with showmodal |
|
|
On Tue, 27 Apr 2004 11:28:18 -0300, Ricardo F. de Oliveira wrote:
| Quote: | Where can i find the "interesting response"?
is it possible yet?
|
I tried to find it but failed. I thought I had it in a "To do" document but
apparently not. It made the comment that the VCL code for ShowModal was
some fifty lines long suggesting there was more going on than you'd think.
Sadly it appears that it's still not quite enough
--
Andrue Cope
[Bicester UK]
|
|
| Back to top |
|
 |
EH Guest
|
Posted: Tue Apr 27, 2004 6:11 pm Post subject: Re: blocking application with showmodal |
|
|
Ricardo F. de Oliveira wrote:
| Quote: | Hi,
situation:
1)- i open my application
2)- click in a button to show a configuration window with showmodal
3)- open other application, ex. word, excel, etc.
4)- back to my application,
|
Hi!
I can't give you a programming tip, but the following tip:
Your app does not hang, your modal window is just behind your main window.
To bring it into front, just navigate through the list of started applications
via ALT-TAB.
If your app get's re-activated this way, your modal windows is in front again.
Unfortuantely I don't know how to get this effect programmatically.
Regards,
EH :-)
|
|
| Back to top |
|
 |
JD Guest
|
Posted: Tue Apr 27, 2004 7:15 pm Post subject: Re: blocking application with showmodal |
|
|
"Ricardo F. de Oliveira" <ricfow (AT) dt (DOT) fee.unicamp.br> wrote:
| Quote: | [...] the configuration window is hiden, and i cant do
anything more, the app stay blocked
|
I assume that the Modal form is not an MDIChild? Have you
tried setting it's Style to fsStayOnTop?
Otherwise you might try posting a message to the window:
//--- in the form's header ------------------------------------
protected: // User declarations
virtual void __fastcall WndProc(TMessage &Message);
private: // User declarations
#define cfgMessage (WM_USER + 1024)
//-------------------------------------------------------------
void __fastcall TForm1::WndProc(TMessage &Message)
{
if( Message.Msg == cfgMessage )
{
// get the HWND using FindWindow or similar api
// this sample won't work as is
// you need to modify it for your code
HWND ConfigHandle = FindWindow( MAKEINTRESOURCE(WC_DIALOG), CfgForm->Caption.c_str() );
if( ConfigHandle )
{
// code to calculate the center of the window
// x = left ---- y = top
// set new windows position
SetWindowPos( ConfigHandle, HWND_TOP, x, y, 0, 0, SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER );
}
}
inherited::WndProc( Message );
}
//-------------------------------------------------------------
Then to use it:
PostMessage( CfgForm->Handle, cfgMessage, 0, 0 );
CfgForm->ShowModal();
~ JD
|
|
| Back to top |
|
 |
Harold Howe [TeamB] Guest
|
Posted: Wed Apr 28, 2004 2:25 pm Post subject: Re: blocking application with showmodal |
|
|
| Quote: | 1)- i open my application
2)- click in a button to show a configuration window with showmodal
3)- open other application, ex. word, excel, etc.
4)- back to my application,
|
I know I have seen this, but I could not reproduce it in a trivial app. If you find a way to reproduce this reliably, please post.
To fix the problem, you might want to try hooking the application's window proc and see what messages you get when your app is activated. When you get the activation, call SetWindowPos to bring any modal forms to the front.
H^2
|
|
| Back to top |
|
 |
Craig Farrell Guest
|
Posted: Wed Apr 28, 2004 11:53 pm Post subject: Re: blocking application with showmodal |
|
|
Hi,
"Ricardo F. de Oliveira" wrote:
| Quote: |
Where can i find the "interesting response"?
is it possible yet?
|
Are you seeing this on XP? If so, search google
advanced newsgroups in borland.public.delphi.*
for keyword: disableprocesswindowsghosting
(the issues seemed somewhat similar)
--Craig
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|