hi i am new to .net development,
i have created a service which has forms to interact with user. now before starting the service , i need to change the property of service to interact with desktop.after installing i need to do this every time. to solve this issue i found a code that changes the value of service property.i have used this following code in afterinstall callback method()
RegistryKey ckey = Registry.LocalM achine.OpenSubK ey(
@"SYSTEM\Curren tControlSet\Ser vices\WindowsSe rvice1", true);
// Good to always do error checking!
if(ckey != null)
{
// Ok now lets make sure the "Type" value is there,
//and then do our bitwise operation on it.
if(ckey.GetValu e("Type") != null)
{
ckey.SetValue(" Type", ((int)ckey.GetV alue("Type") | 256));
}
}
}
this code changes the property as allow service to interact with desktop. but when i am starting the service forms are not shown....
how to solve this issue?
thanks in advance..
i have created a service which has forms to interact with user. now before starting the service , i need to change the property of service to interact with desktop.after installing i need to do this every time. to solve this issue i found a code that changes the value of service property.i have used this following code in afterinstall callback method()
RegistryKey ckey = Registry.LocalM achine.OpenSubK ey(
@"SYSTEM\Curren tControlSet\Ser vices\WindowsSe rvice1", true);
// Good to always do error checking!
if(ckey != null)
{
// Ok now lets make sure the "Type" value is there,
//and then do our bitwise operation on it.
if(ckey.GetValu e("Type") != null)
{
ckey.SetValue(" Type", ((int)ckey.GetV alue("Type") | 256));
}
}
}
this code changes the property as allow service to interact with desktop. but when i am starting the service forms are not shown....
how to solve this issue?
thanks in advance..
Comment