Oput of interest, did you know the component gallery allows you to add a progress dialogue to a project. Pretty cool because it can pump messages and keep the display fresh.
I always put the guts of a routine - the worker - in the thread and send or post the progress to the main app class. This then passes it onto wherever it is needed, like a status bar. You can also consider changing thread priorities temporarility so that the giu is having precendence over the worker (or something like that). But put it back again afterwards. I had no need of using copydata, unless I missunderstand what you are doing. Andrew > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Palmer, Jean L. > Sent: 06 October 2004 21:25 > To: [EMAIL PROTECTED] > Subject: RE: [msvc] CFileDialog > > > I've moved my progress bar dialog out of the UI thread, and > the main thread dialogs still (undesirably) show up on > bottom. I've added SetWindowPos (with &wndTop), still broken. > Added BringWindowToTop(), still broken. Never called > ShowWindow(SW_SHOW) on the dialog for my UI thread, still broken. > > Then I removed the 'Create' call from the dialog window for > my UI thread... and now all of the main thread dialogs seem > to show up on top, as I want. > > So the problem seems to arise from the fact that I have a > separate UI thread which owns a CDialog box. If I take away > that CDialog box from the UI thread, then all works fine. > > The reason that I put a CDialog in my other thread is because > I need a window to receive WM_COPYDATA messages from a > separate application. I need an hWnd for the SendMessage of > the COPYDATASTRUCT. My original design had the receipt of > the WM_COPYDATA message in my main thread, but it was causing > problems with the other application so I moved it to its own thread. > > So... I need an hWnd for receiving WM_COPYDATA messages, but > when I put that window in a separate thread it causes main > application thread dialogs to show up at the bottom z-order. > When I don't put that window in a separate thread, it causes > problems with the application that is sending me the > WM_COPYDATAs. help! > > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] Behalf Of Ehsan Akhgari > > Sent: Wednesday, October 06, 2004 3:27 PM > > To: [EMAIL PROTECTED] > > Subject: RE: [msvc] CFileDialog > > > > > > > I have a CFileDialog that is displayed with a DoModal() > call. Since > > > it is a modal window, the application waits on it to be dismissed > > > before allowing user input in other windows. Unfortunately, the > > > dialog window is not coming up as the topmost window. It > is hidden > > > under other windows, so the > > application seems to > > > hang... it's waiting for user input in a window that > isn't visible. > > > > > > I guess I could derive a class from CFileDialog and use its > > > OnInitDialog() to make sure that the dialog window is > visible... but > > > that seems like overkill. It sure seems that a dialog > window should > > > always show up on top. Am I missing some setting? The dialog is > > > created and shown as follows: > > > > > > CFileDialog dlg(TRUE, ".hdr", NULL, OFN_FILEMUSTEXIST | > > OFN_READONLY); > > > // some dlg.m_ofn values set here if (IDOK == > > > dlg.DoModal()) > > > // take action here > > > > Hmm, looks like the application window has been set to > something like > > "always on top". Have you tried SetWindowPos( ) to bring the modal > > window to the top? > > > > ------------- > > Ehsan Akhgari > > > > Farda Technology (http://www.farda-tech.com/) > > > > List Owner: [EMAIL PROTECTED] > > > > [ Email: [EMAIL PROTECTED] ] > > [ WWW: http://www.beginthread.com/Ehsan ] > > > > > > > > > > _______________________________________________ > > msvc mailing list > > [EMAIL PROTECTED] > > See > > http://beginthread.com/mailman/listinfo/msvc_beginthread.com > > for subscription changes, and list archive. > > > > _______________________________________________ > msvc mailing list > [EMAIL PROTECTED] > See > http://beginthread.com/mailman/listinfo/msvc_b> eginthread.com > for subscription changes, and list archive. > > > > This message has been scanned for viruses by MailControl - > (see http://bluepages.wsatkins.co.uk/?4318150) > This email and any attached files are confidential and copyright protected. If you are not the addressee, any dissemination of this communication is strictly prohibited. Unless otherwise expressly agreed in writing, nothing stated in this communication shall be legally binding. _______________________________________________ msvc mailing list [EMAIL PROTECTED] See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription changes, and list archive.
