By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,124 Members | 1,566 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,124 IT Pros & Developers. It's quick & easy.

parent windows from DLL

P: n/a
I need to send refresh message to Windows Explorer from shell
extension(DLL).
But I dont know how to obtain handle to Windows Explorer from within DLL
since i dont have any handle to any window.

Thanks, Rajko


Nov 17 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
>I need to send refresh message to Windows Explorer from shell
extension(DLL).
But I dont know how to obtain handle to Windows Explorer from within DLL
since i dont have any handle to any window.


Rajko,

What are you doing that requires refreshing Explorer?

Have a look at SHChangeNotify I suspect that's most likely what you
need.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #2

P: n/a
I'm working on program for renaming files. And when I rename file
"small.txt" to "SMALL.txt" Windows Explorer does not refresh window.
So, I want to send refresh message to Windows Explorer window. Or better
Windows Explorer list control.
But I dont know hoe to obtain WE handle. :-(

Rajko

"David Lowndes" <da****@example.invalid> wrote in message
news:kc********************************@4ax.com...
I need to send refresh message to Windows Explorer from shell
extension(DLL).
But I dont know how to obtain handle to Windows Explorer from within DLL
since i dont have any handle to any window.


Rajko,

What are you doing that requires refreshing Explorer?

Have a look at SHChangeNotify I suspect that's most likely what you
need.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Nov 17 '05 #3

P: n/a
>I'm working on program for renaming files. And when I rename file
"small.txt" to "SMALL.txt" Windows Explorer does not refresh window.
So, I want to send refresh message to Windows Explorer window. Or better
Windows Explorer list control.
But I dont know hoe to obtain WE handle. :-(


Have you tried using SHChangeNotify?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #4

P: n/a
This is interesting.
First I tried SHChangeNotify(SHCNE_RENAMEITEM, SHCNF_PATH, OldFileName,
NULL);
well... items renamed just dissapeared .... (on F5 they reaper renamed)
Then I found solution thx to Dave :
SHChangeNotify(SHCNE_RENAMEITEM, SHCNF_PATH, OldFileName, NewFileName);

BTW I was convinced that I need to use PostMessage() and got stuck with it.

Thanks, Dave.
"David Lowndes" <da****@example.invalid> wrote in message
news:3s********************************@4ax.com...
I'm working on program for renaming files. And when I rename file
"small.txt" to "SMALL.txt" Windows Explorer does not refresh window.
So, I want to send refresh message to Windows Explorer window. Or better
Windows Explorer list control.
But I dont know hoe to obtain WE handle. :-(


Have you tried using SHChangeNotify?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Nov 17 '05 #5

P: n/a
I noticed strange behaviour.
When I use it on max 5 files at once it works (all 5 files are updated),
but with 6 files nothing happens (not even one file is updated)?!

Rajko.
"David Lowndes" <da****@example.invalid> wrote in message
news:3s********************************@4ax.com...
I'm working on program for renaming files. And when I rename file
"small.txt" to "SMALL.txt" Windows Explorer does not refresh window.
So, I want to send refresh message to Windows Explorer window. Or better
Windows Explorer list control.
But I dont know hoe to obtain WE handle. :-(


Have you tried using SHChangeNotify?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Nov 17 '05 #6

P: n/a
It could be fixed with SHCNF_FLUSH flag but it slowes down process much.
Flag SHCNF_FLUSHNOWAIT does not work since it is closed loop and message
loop can not process sent messages.

Rajko.

"Rajko" <ra***@fly.srk.fer.hr> wrote in message
news:c6**********@bagan.srce.hr...
I noticed strange behaviour.
When I use it on max 5 files at once it works (all 5 files are updated),
but with 6 files nothing happens (not even one file is updated)?!

Rajko.
"David Lowndes" <da****@example.invalid> wrote in message
news:3s********************************@4ax.com...
I'm working on program for renaming files. And when I rename file
"small.txt" to "SMALL.txt" Windows Explorer does not refresh window.
So, I want to send refresh message to Windows Explorer window. Or betterWindows Explorer list control.
But I dont know hoe to obtain WE handle. :-(


Have you tried using SHChangeNotify?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq


Nov 17 '05 #7

P: n/a
>I noticed strange behaviour.
When I use it on max 5 files at once it works (all 5 files are updated),
but with 6 files nothing happens (not even one file is updated)?!


Doesn't the whole folder get updated - eventually?

Here's a quote from an old post on the subject by Raymond Chen [MS]
about the multiple notifications issue:

"If you send a lot of file update notifications, they get combined
into a single "directory update" notification, and Explorer refreshes
the entire directory - so the operation still succeeds; the items you
sent notifications on did get updated. (as did a bunch of files that
you didn't send notifications on, but no harm done there)
"

.... so if this isn't happening, it's presumably a bug/quirk in the
shell. Which OS versions have you tested with? Are all OS's behaving
the same?

Dave
Nov 17 '05 #8

P: n/a
Well, I Win XP pro v2002 SP1 and all updates available from SP2 on windows
update site.
Got .NET framework 1.1.
I tested od dir C:\Tmp\Test 100 and I heve there files:
copy (10) of empty.txt
copy (11) of empty.txt
copy (12) of empty.txt
copy (13) of empty.txt
copy (14) of empty.txt
copy (15) of empty.txt
copy (16) of empty.txt
copy (17) of empty.txt
copy (18) of empty.txt
copy (19) of empty.txt
copy (20) of empty.txt
copy (21) of empty.txt
_cczsd.asd
_cczsd.qwe

the last two have Croatian letters for test purpose.
If I update first 5 copy... they are updated, but when I try first 6
nothing.
I use flag SHCNF_FLUSHNOWAIT in every call and only every 5th SHCNF_FLUSH
which wait for shell to process messages. That is only way it works.
I tryed renaming 400 files "copy of..." and they were only 400 in that dir
just with SHCNF_FLUSHNOWAIT and nothing happened after renaming to UPPERCASE
letters. When I pushed F5 it was all there, renamed.

Rajko.
PS I will test it on few other machines and then post message here.
----- Original Message -----
From: "David Lowndes" <da****@example.invalid>
Newsgroups: microsoft.public.dotnet.languages.vc
Sent: Friday, April 23, 2004 4:16 PM
Subject: Re: parent windows from DLL

I noticed strange behaviour.
When I use it on max 5 files at once it works (all 5 files are updated),
but with 6 files nothing happens (not even one file is updated)?!


Doesn't the whole folder get updated - eventually?

Here's a quote from an old post on the subject by Raymond Chen [MS]
about the multiple notifications issue:

"If you send a lot of file update notifications, they get combined
into a single "directory update" notification, and Explorer refreshes
the entire directory - so the operation still succeeds; the items you
sent notifications on did get updated. (as did a bunch of files that
you didn't send notifications on, but no harm done there)
"

... so if this isn't happening, it's presumably a bug/quirk in the
shell. Which OS versions have you tested with? Are all OS's behaving
the same?

Dave

Nov 17 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.