15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


BringWindowToTop

Ron Birk -- rbirk@ctp.com
Monday, January 22, 1996

-- [ From: Ron Birk * EMC.Ver #2.5.02 ] --

I wrote the following in a pevious email:

> I have a MDI application with Drag&Drop support. When one drag a file from

> explorer, for example, to our application a dialog pops up and ask the
user
> to confirm the action. The problem is if our application is behind
explorer 
> the dialog thats pops up will also be behind explorer. Not good...
>
> I tried (in my OnDropFiles procedure, WM_DROPFILES) to use
> AfxGetMainWnd()->BringWindowToTop() before opening the dialog, but without
> success. What is going on here? I also tried SetWindowsPos, SetFocus etc
etc.
> Nothing causes my application to be the front one.

After some investigation I noticed a couple of things. First of all I am
using MSVC 1.52c (I am forced to use 16bit) but I am running Windows95.
Strange things are happening...

In my drag&drop routine I open a dialog with DoModal(). If running Win3.11
or WinNT my application gets the focus and the dialog and main window pops
up to the foreground. This does not happen in Windows95!! (Que?) Both the
main app and its newly created dialog will remain in the background.

What I did is to try AfxGetMainWnd()->BringWindowToTop() etc (see above)
without success. It still remain in the background. Is this something I have
to live with or is there a solution that will work with 16bits apps running
under Windows95?

Ron

--
 /\/\   Ron Birk                        Email:     rbirk@ctp.com
/ /_ \  Horizontal Solutions            Tel:       +46 8 744 6119
\  / /  Cambridge Technology Partners   Fax:       +46 8 744 9933
 \/\/   Stockholm, Sweden               Voicemail: +1 617 374 2081




David W. Gillett -- DGILLETT@expertedge.com
Wednesday, January 24, 1996

> After some investigation I noticed a couple of things. First of
> all I am using MSVC 1.52c (I am forced to use 16bit) but I am
> running Windows95. Strange things are happening...
> 
> In my drag&drop routine I open a dialog with DoModal(). If running
> Win3.11 or WinNT my application gets the focus and the dialog and
> main window pops up to the foreground. This does not happen in
> Windows95!! (Que?) Both the main app and its newly created dialog
> will remain in the background. 

  There is a particular 16-bit (3.x) app that I often drag files to -- it's 
already running and open -- on my Win95 system.  I've noticed that it 
*usually* becomes the active window when I drop a file on it, but 
sometimes not.  And when not, it *stays* not, as if it has gone into 
some sort of "don't become active when receiving dropped files" mode.

  What does that tell us?

1.  It's also a 16-bit app on Win95.  This combination may be the 
only mix of bitness and OS that exhibits the incorrect behaviour.

2.  The same app exhibits both behaviours; the behaviour may depend 
upon one or more unknown factors outside the app itself.

  I have not managed, yet, to identify anything that positively 
correlates with correct or incorrect behaviour of the app, besides 
what it did when the previous file was dropped on it.

Dave





| Вернуться в корень Архива |