Click here to Skip to main content
15,905,420 members
Home / Discussions / C#
   

C#

 
Generalread more bytes Pin
levi's22-Aug-05 19:44
levi's22-Aug-05 19:44 
GeneralRe: read more bytes Pin
HumanOsc23-Aug-05 0:15
HumanOsc23-Aug-05 0:15 
GeneralRe: read more bytes Pin
levi's23-Aug-05 17:39
levi's23-Aug-05 17:39 
GeneralContext menu in windows explorer Pin
Anonymous22-Aug-05 18:55
Anonymous22-Aug-05 18:55 
GeneralDetect SMTP MailServer Pin
machocr22-Aug-05 17:18
machocr22-Aug-05 17:18 
GeneralOwnerDraw PropertyGrid Pin
Shane Stevens22-Aug-05 15:51
Shane Stevens22-Aug-05 15:51 
GeneralTotal newb needs help. Pin
tomlog22-Aug-05 14:16
tomlog22-Aug-05 14:16 
GeneralRe: Total newb needs help. Pin
Christian Graus22-Aug-05 14:31
protectorChristian Graus22-Aug-05 14:31 
tomlog wrote:
RegistryKey regkey;/* new Microsoft.Win32 Registry Key */
regkey = Registry.LocalMachine.CreateSubKey(@"System\CurrentControlSet\Control\Session Manager\Environment"); //Set global environment variable
regkey.SetValue("IPv4Pri", ipaddress);
Registry.LocalMachine.Flush();
SendNotifyMessage(HWND_BROADCAST,WM_SETTINGCHANGE,0,0);


First of all, you should condense the first two lines into one, create and initialise in the one line.

Secondly, I suspect you need to call CreateSubKey one key at a time, this code is assuming everything except the last item already exists. That's assuming it's being written at all, as I read the rest of your post, I wonder what the problem could be ?

tomlog wrote:
I'm trying to get the "SendNotifyMessage(HWND_BROADCAST,WM_SETTINGCHANGE,0,0);" thing to work and having a great amount of difficulty. It doesn't even recognize the SendNotifyMessage method.

SendNotifyMessage is not supported in C# without pInvoke[^]. Once you import it, you can use it, but this also means that you need to use pInvoke to catch the message.

tomlog wrote:
Any insights on how I can "publish" my new registry setting so any new windows opened will have the key available?

If you wrote something to the registry then all programs can see it. The problem is letting them know, apparently.



Christian Graus - Microsoft MVP - C++
GeneralRe: Total newb needs help. Pin
tomlog23-Aug-05 6:30
tomlog23-Aug-05 6:30 
GeneralRe: Total newb needs help. Pin
Christian Graus23-Aug-05 13:27
protectorChristian Graus23-Aug-05 13:27 
GeneralProblem getting drag and drop to work between listbox with mode set to MultiExtended Pin
22-Aug-05 13:04
suss22-Aug-05 13:04 
GeneralRe: Problem getting drag and drop to work between listbox with mode set to MultiExtended Pin
Luis Alonso Ramos22-Aug-05 18:58
Luis Alonso Ramos22-Aug-05 18:58 
GeneralRe: Problem getting drag and drop to work between listbox with mode set to MultiExtended Pin
Member 221063323-Aug-05 12:34
Member 221063323-Aug-05 12:34 
Generalcomparing computation Pin
Sasuko22-Aug-05 12:57
Sasuko22-Aug-05 12:57 
GeneralRe: comparing computation Pin
Christian Graus22-Aug-05 13:04
protectorChristian Graus22-Aug-05 13:04 
Generaladding 2 buttons to a data grid Pin
Member 221087122-Aug-05 11:56
Member 221087122-Aug-05 11:56 
GeneralRe: adding 2 buttons to a data grid Pin
Christian Graus22-Aug-05 12:07
protectorChristian Graus22-Aug-05 12:07 
GeneralRe: adding 2 buttons to a data grid Pin
Member 221087122-Aug-05 13:37
Member 221087122-Aug-05 13:37 
GeneralRe: adding 2 buttons to a data grid Pin
Christian Graus22-Aug-05 13:57
protectorChristian Graus22-Aug-05 13:57 
GeneralRe: adding 2 buttons to a data grid Pin
Member 221087122-Aug-05 15:58
Member 221087122-Aug-05 15:58 
GeneralCould you please... Pin
KORCARI22-Aug-05 10:53
KORCARI22-Aug-05 10:53 
GeneralRe: Could you please... Pin
Christian Graus22-Aug-05 10:57
protectorChristian Graus22-Aug-05 10:57 
GeneralRe: Could you please... Pin
KORCARI22-Aug-05 18:01
KORCARI22-Aug-05 18:01 
GeneralRe: Could you please... Pin
Christian Graus22-Aug-05 18:23
protectorChristian Graus22-Aug-05 18:23 
QuestionHow to pass variables through URL in CGI Pin
Handy Su22-Aug-05 10:51
Handy Su22-Aug-05 10:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.