Problem with RegisterPowerSettingNotification and USER32.dll.
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Problem with RegisterPowerSettingNotification and USER32.dll.

  1. #1
    Join Date
    Jun 2010
    Posts
    23

    Problem with RegisterPowerSettingNotification and USER32.dll.

    Hello,

    When I call to the fanction RegisterPowerSettingNotification I get a runtime error:

    "The procedure entry point could not be located in the dynamic link library USER32.dll."

    I tried to replace user32.dll but its didnt help.

    My OS is windows xp, the code is:

    HPOWERNOTIFY m_hPowerSchemeNotify;
    m_hPowerSchemeNotify = RegisterPowerSettingNotification (
    NULL, &GUID_POWERSCHEME_PERSONALITY,
    DEVICE_NOTIFY_WINDOW_HANDLE );

    if ( NULL == m_hPowerSchemeNotify )
    ATLTRACE("Failed to register for notification of power scheme changes!\n");


    if anyone can guid me how can I solve this problam I would be very grateful for him.

    thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,060

    Re: Problem with RegisterPowerSettingNotification and USER32.dll.

    Never ever replace user32.DLL manually!

    Check the MSDN RegisterPowerSettingNotification, it clearly says you need at least Vista or Windows Server 2008. It will not work on XP.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center