Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to force the explorer to refesh after the setting change?

55 views
Skip to first unread message

Johnny Xia

unread,
Jun 27, 2001, 6:19:47 AM6/27/01
to
Hi all,

There is a function SHChangeNotify(), which can be called to notify the
explorer that a file or folder
is changed. But my problem is that I don't change the file or folder, I just
modify the setting of explorer.
After modification I want the explorer to do refreshing. Which function
shall I call? or May I call
SHChangeNotify().

Thanks.
Johnny Xia.


David Lowndes

unread,
Jun 27, 2001, 5:12:06 PM6/27/01
to
>... But my problem is that I don't change the file or folder, I just

>modify the setting of explorer.

Johnny,

Which setting are you changing, and how are you changing it?

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.

Johnny Xia

unread,
Jun 27, 2001, 9:04:37 PM6/27/01
to
I change the value of
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ShellState .
This value can enable or disable one-click to open file in the explorer.

Johnny Xia.
"David Lowndes" <dav...@mvps.org> wrote in message
news:tuikjtcg0gsapulg3...@4ax.com...

David Lowndes

unread,
Jun 28, 2001, 2:59:44 AM6/28/01
to
>I change the value of
>HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ShellState .
>This value can enable or disable one-click to open file in the explorer.

I wondered if it might have been something you could change using
SystemParametersInfo, but I can't see it referenced there.

Does anyone have any suggestions for the approved way of changing this
setting?

David Lowndes

unread,
Jun 28, 2001, 6:51:04 AM6/28/01
to
I think the setting is readable via SHGetSettings, but there's no
equivalent set function!

Johnny Xia

unread,
Jul 2, 2001, 11:14:01 PM7/2/01
to
Dave,

Thanks for your concern of my question. I open the main.cpl with dependance
viewer. This cpl imports lots of noname
functions of shell32.dll. Maybe an undocumented API could do this function.

I tried another way, and almost get the result that I want. After changing
the value of ShellState, I broadcast the
WM_SETTINGCHANGE message with lParam points to a string "ShellState". This
will notify explorer that
system setting changed. But the desktop doesn't refresh immediately. I have
to use the key F5 to manually refresh
the window. So I am thinking that if there is way to refresh the explorer
programatically.

Cheers,
Johnny Xia.


"David Lowndes" <dav...@mvps.org> wrote in message

news:lr2mjtsomia9a83b0...@4ax.com...

Matthew Ellis

unread,
Jul 15, 2001, 2:51:40 PM7/15/01
to
"Johnny Xia" <john...@acersoftech.com.cn> wrote in message
news:O5NqjY3$AHA.1768@tkmsftngp03...

> I change the value of
> HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ShellState .
> This value can enable or disable one-click to open file in the explorer.

It's probably done through a WM_SETTINGCHANGE, which is sent to all
top-level windows. Write a small program to output the string which is
contained in lParam, change the one-click settings in the folder options
window, and see what happens. It should then just be a case of replicating
this message...

Matt
m.t....@bigfoot.com

Dan

unread,
Sep 6, 2001, 3:00:05 PM9/6/01
to
This will work like F5 -
::PostMessage( hwndExplorer, WM_COMMAND, 41504, 0 );

Dan

>.
>

0 new messages