I have a problem with hibernation and wake up events. When I go into hibernation using C# code
Application.SetSuspendState(PowerState.Hibernate, true, false);
everything works fine and computer wakes up on events. The problem is when I just close the lid having hibernation as action. In this case computer never came back and the only way to start it was by pressing the power button. Of course I could set lid close action to none and always go into hibernation using app but that is not the best solution.
I would like to know what is the difference between these two hibernations. I thought this should be the same but seems it is not. Is there a way to modify hibernation action on lid close to work the same as this one called from C# code?