Assuming you're using C# Program as your program type, the Program Code section needs to be in the form of a loop or function. For example:
When.ModuleParameterChanged((module, parameter) => {
if (module.Instance.Name == "MyModule"){
Program.Notify("MyModule", parameter.Value);
}
return true;
});
Program.GoBackground();
Depending on what you're doing, you could look for your module by name, or a type of module by domain or parameter if you plan on creating several of these modules.