cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
voyager1983
Level 4

How to load the file association without reboot

Hi, All

I use the "set windows registry - multiple entries" to add file association with the specific type of data file.

The data file's icon shows correctly only when I reboot the machine or re login.

How should we do to make the data file's icon looks correctly immediately after installation finished?

Thanks!
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

A Windows application can call the SHChangeNotify function with the SHCNE_ASSOCCHANGED flag (searching the InstallShield Windows forums will turn up examples) to do it, so presumably launching a simple executable that calls that function or a JNI DLL that calls it would do the trick...
0 Kudos
voyager1983
Level 4

Thanks!

I write an exe file using windows API SHChangeNotify as you said. and it works fine!

But one thing in my mind is if such executable works normal in Windows Vista?

Below is my code:

#include "stdafx.h"
#include
#include

#pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" ) //this is used for hide the console window when invoking

void main()
{

SHChangeNotify(SHCNE_ASSOCCHANGED,SHCNF_IDLIST | SHCNF_FLUSH,NULL,NULL);
}
0 Kudos