The module Win32::AdminMisc did not work for me, even if it returned successful!
I have used Bill's solution, it worked just fine!
I may miss something here. But how do we find those constant value for
HWND_BROADCAST and WM_SETTINGCHANGE?
notify_windows ('Environment');
exit 0;
sub notify_windows {
use Win32::API;
use constant HWND_BROADCAST => 0xFFFF; # Why those values?
use constant WM_SETTINGCHANGE => 0x001A;
my $registry_key = shift;
print "Flushing key: $registry_key \n";
my $SendMessage = new Win32::API("user32", "SendMessage", [qw(N N P P)], 'N')
or die "Finding SendMessage: " . Win32::FormatMessage (Win32::GetLastError ());
my $result = $SendMessage->Call(HWND_BROADCAST, WM_SETTINGCHANGE, 0, $_[0] ||
'Environment');
print "SendMessage result: $result \n";
}
Many thanks,
Paul
Paul Voyer
System/DB/PDM Administrator
Engineering Applications Support
Harris Corporation - Microwave Communication Division
mailto:pvoyer@;harris.com
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs