X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=imports.cpp;h=064ba27c589bf96367ac4c0f397cd7508a22eef7;hb=2bc7df40fe52fe9e86e382926f7653b55ee02038;hp=62571311ef17feb55df5a3a993c995913e420568;hpb=6500f75954f9d96d35d4aa2749d36807704c1cb3;p=nssm.git diff --git a/imports.cpp b/imports.cpp index 6257131..064ba27 100644 --- a/imports.cpp +++ b/imports.cpp @@ -82,6 +82,15 @@ int get_imports() { } else if (error != ERROR_MOD_NOT_FOUND) return 5; + imports.user32 = get_dll(_T("user32.dll"), &error); + if (imports.user32) { + imports.RegisterPowerSettingNotification = (RegisterPowerSettingNotification_ptr) get_import(imports.user32, "RegisterPowerSettingNotification", &error); + if (! imports.RegisterPowerSettingNotification) { + if (error != ERROR_PROC_NOT_FOUND) return 9; + } + } + else if (error != ERROR_MOD_NOT_FOUND) return 8; + return 0; }