Re: CFileDialog in Threads



I doubt you will get anyone to respond by what I feel is shouting
at. Don't bother to be looking again on this thread, you have closed
the chances of a response unless Joe thinks some other way.

Nobody is obliged to give a response on any newsgroup, if you
don't ask it properly, so keep in mind when you post next time.

Firstly what you are trying to do is some sort of hackery, what if the
activex
control, updates the title in a timer,every few seconds? So the solution you
are trying to
find is bound to the problem you have at hand. So understand the
environment,
in which you intend to hack up the control's text and if what you are trying
to
do works, then be happy with it. There are no set rules for solving what you
are
trying to do. Safest mechanism is IAT patching the SetWindowText(...), but
that's the extreme, whether you want to do so or not is upto you. What
mechanism
you want to use is a call you have to make.Make the choices based on your
guts.

--
Vipin Aravind

<akshay4friend@xxxxxxxxx> wrote in message
news:1139133734.406977.110830@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
And the question about how to change the caption seems remarkably silly,

I SUGGEST YOU TO READ THIS THREAD AGAIN SPECIALLY READ MY 2ND AND 3RD
COMMENT IN THIS THREAD... CAN YOU PLEASE POINT MY STATEMENT WHERE I AM
ASKING ABOUT ''''''HOW TO SET CAPTION'''''' ?? ITS JUST SAMPLE CODE
TO SHOW SOMETHING ONCE I GOT HANDLE OF FILE DIALOG.....

I ALREADY MENTIONED IN MY 3RD COMMENT THAT GIVEN CODE IS SAMPLE AND
WHAT I ACTUALLY WANT TO DO IS TO CHANGE COMBOBOX VALUE IN SAVE DIALOG
INVOKED BY ACTIVEX CONTROL. THATS IT.

don't create UI objects in secondary threads" was given. In spite of
this, you keep asking how to make them work.

AGAIN READ THE FULL COMMENTS AND TELL ME WHERE I ASKED I WANT TO GET
WORK MY EXISTING CODE ONLY ??? IN MY 2ND COMMENT ONLY I CLEARED WHAT I
WANT TO DO AND HOW IT CAN BE ACHIVED BY ANY WAY .....


THANX
AKSHAY

Joseph M. Newcomer wrote:

But early on, the rule "don't create UI objects in secondary threads" was
given. In spite
of this, you keep asking how to make them work.

If you need to save a file, you have the main GUI thread ask the
question. And the
question about how to change the caption seems remarkably silly, because
even if you were
doing it in a child UI thread, that thread should know what the caption
should be and set
it before launching the dialog. Therefore, there is no need for another
thread to change
the caption. And if it were a CFileDIalog launched by some binary
plugin, the need to
handle this could be dealt with by a hook function that was executing in
the same thread
as the creation, again eliminating any need to do cross-thread detection
or modification.
Threading is complex, but adding gratuitous complexity which runs against
the core advice
("don't touch a window from another thread"), and persisting in the need
to use threads
for this purpose, is what I've been trying to point out is just trying to
force a bad
implementation to work, instead of explaining the real problem and asking
for a solution
that does not involve threads.

It would never have occurred to me to use threads for this purpose.
First, because they
aren't needed. Second, they would involve a lot of complexity that
appears to be easily
avoidable by simply not using threads.
joe

On 4 Feb 2006 00:48:29 -0800, akshay4friend@xxxxxxxxx wrote:

my current modified code working fine which is created using above
link. I am creating a thread in which I am watching window creation for
save dialog box using FindWindow and I can very well crosscheck handle
is of my required window. Can you point out possible error in this ??

This is a typical question: "Tell me how to make my bad solution work"
instead of "Here's
my problem, how can I solve it?"

Joseph it seems you have not read this FULL THREAD. Read my ALL
comments what I asked along with my code. 1st thing I already mentioned
I am new to threading second I already asked 'how should I get handle
to File Save Dialog Box 'after it invoked and also how to find its
invoked completely and appeared' SO I didnt said I want to get work my
existing code only which may be wrong !!!

As used here http://www.codeproject.com/shell/iesaveas.asp I am
creating only one thread now to watch created window and I am running
ActiveX in main GUI thread only but I dont need to use hooks for my
purpose.

Akshay
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm



.



Relevant Pages

  • Re: CFileDialog in Threads
    ... question about how to change the caption seems remarkably silly, ... but adding gratuitous complexity which runs against the core advice ... ("don't touch a window from another thread"), and persisting in the need to use threads ... It would never have occurred to me to use threads for this purpose. ...
    (microsoft.public.vc.mfc)
  • Re: CFileDialog in Threads
    ... question about how to change the caption seems remarkably silly, ... but adding gratuitous complexity which runs against the core advice ... ("don't touch a window from another thread"), and persisting in the need to use threads ... It would never have occurred to me to use threads for this purpose. ...
    (microsoft.public.vc.mfc)
  • Re: Drawing titlebar on XP with themes
    ... > This might cause flickering but no flickering is discernible on my ... there is a flickering problem if the window is ... WM_NCPAINT so that Windows does not draw any text in the caption. ... int cxframe = GetSystemMetrics; ...
    (microsoft.public.win32.programmer.ui)
  • Re: Change Window CE Caption Size and Font
    ... and *ALWAYS* a child window of another window, ... Do you know how can i draw this control IN my main window. ... i make a new window with a caption. ... the application font is used to ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: SetMapMode
    ... representation on the window given and at the coordinates given. ... The dll exposes an object model that the developer will use to define ... Firstly they contain an object representing the top caption (this ... my mp3 player) or a window (I will use this in my mp3 player to show ...
    (microsoft.public.vb.general.discussion)