Steve Harper wrote:
> On Tue, 9 Jul 2002 [EMAIL PROTECTED] wrote:
> ....
> 
>>If you mean that you want processes that are already running to see
>>the new settings, then I don't think that there is any way to do that
>>without at least restarting those processes.
>>
>>HTH
>>
>>--
>>Brian Raven
>>
>>echo "ICK, NOTHING WORKED!!!  You may have to diddle the includes.";;
>>             -- Larry Wall in Configure from the perl distribution
> 
> ...
> 
> This is off-topic, but I thought it might be of interest.
> Microsoft alleges you can do this, but the process in question must listen
> for and respond to the WM_SETTINGCHANGE window message.  Unfortunately,
> the CMD shell does NOT listen for this message so what you say is true.
> If Microsoft ever see's fit to fix this in some later release of the OS,
> you can make the system know there's a change with the (C call):
> 
>       //Propagate change to system
>       SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0,
>               (LPARAM) "Environment", SMTO_ABORTIFHUNG,
>               5000, dwReturnValue);
> 
> Converting this to a perl compatible call with something like Aldo
> Calpini's Win32::API module or an XS module is left as an exercise for the
> reader.  :-)

I think this works (not 100% sure):

use constant HWND_BROADCAST => 0xFFFF;
use constant WM_SETTINGCHANGE => 0x001A;

my $SendMessage = new Win32::API("user32", "SendMessage", [(qw(N N P P)],
   'N') or die 'Get SendMessage: ', Win32::FormatMessage(Win32::GetLastError());

$SendMessage->Call(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 'Environment') or
   die 'Call SendMessage: ', Win32::FormatMessage(Win32::GetLastError());



-- 
   ,-/-  __      _  _         $Bill Luebkert   ICQ=162126130
  (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
   / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/

_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to