PDA

View Full Version : Simulating Refresh (Windows Explorer)


shaitan
06-09-2007, 03:40 PM
I read all threads about refreshing codes for example using below code:

Originally Posted by Intrigued in "How to force Desktop Refresh" Thread

DLL.CallFunction(_SystemFolder.."\\SHELL32.DLL", "SHChangeNotify", "134217728, 0, NULL, NULL", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)

But it only refreshes desktop after A file type association has been changed as 134217728 EventID points to.
It does not works on refreshing windows explorer and folder and file browsing.

For example in one of autoruns I want to see if hidden settings is on or not, and if on, set it off and show a hidden file in explorer to user.
I can change registry keys for setting on and off folder options settings, but it needs explorer REFRESH.
I'm searching for a code to refresh explorer for me at the time.

Thanks

RizlaUK
06-09-2007, 04:09 PM
you are useing the wrong flags

try it with the "SHCNE_ALLEVENTS" flag

EG:
DLL.CallFunction(_SystemFolder.."\\SHELL32.DLL", "SHChangeNotify", "134217728, SHCNE_ALLEVENTS, NULL, NULL", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)

shaitan
06-09-2007, 04:29 PM
DLL.CallFunction(_SystemFolder.."\\SHELL32.DLL", "SHChangeNotify", "134217728, SHCNE_ALLEVENTS, NULL, NULL", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)

No, it doesn't works. still it refreshes another something, not explorer.

Thanks

RizlaUK
06-09-2007, 04:40 PM
funny......it works for me, it refreshes desktop and all open explorer windows

mz241508
06-09-2007, 04:42 PM
you are useing the wrong flags

try it with the "SHCNE_ALLEVENTS" flag

EG:
DLL.CallFunction(_SystemFolder.."\\SHELL32.DLL", "SHChangeNotify", "134217728, SHCNE_ALLEVENTS, NULL, NULL", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)

Thanks, this will come in handy! :yes

P.S. works for me as well.

shaitan
06-09-2007, 04:52 PM
dear RizlaUK,

try attached app, that's not working for me OR i'm making a mistake!!