Powerbasic Museum 2020-B

Webmaster: José Roca (PBWIN 10+/PBCC 6+) (SDK Forum) => CSED Editor => Topic started by: Gary Beene on December 18, 2013, 10:28:22 PM

Title: File Registration
Post by: Gary Beene on December 18, 2013, 10:28:22 PM
Hi Jose,
I used your RegisterFileExtensions function from CSED in another app and it seems to work just fine.  Thank you for that.

But, I noticed that when I run the similar function in the PB IDE, the entire screen seems to be redrawn to have shortcuts show the icon associated with the PB Editor (on files registered to it).

But with your RegisterFileExtensions code, either in my app or in your CSED app, there's no screen redraw. The icons for shortcuts to files supported are not changed to icons representing the new extension owner.  And if I create a new shortcut to a registered file, the new shortcut does not use the designated CSED (or my app) icons.

Is this what you see also?
Title: Re: File Registration
Post by: José Roca on December 18, 2013, 11:33:24 PM
MSDN says:

Quote
When you create or change a file association, it is important to notify the system that you have made a change. Do so by calling SHChangeNotify and specifying the SHCNE_ASSOCCHANGED event. If you do not call SHChangeNotify, the change may not be recognized until after the system is rebooted.

So, add a call to SHChangeNotify. It is in ShlObj.inc.