Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8420259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T02:50:42+00:00 2026-06-10T02:50:42+00:00

what am trying to do is getting my Screen info like resolution/refresh rate etc:

  • 0

what am trying to do is getting my Screen info like resolution/refresh rate etc:

#pragma once
#include < windows.h >
#include <string>
#include <sstream>

struct DesktopScreenInfo
{
    int Width;
    int Height;
    int ScreenDepth;
    int FrameRate;
    std::string ScreenInfoString;
};

class DesktopScreen
{
public:
    DesktopScreen(void);
    ~DesktopScreen(void);

    DesktopScreenInfo GetScreenInfo();
private:
    DISPLAY_DEVICE GetPrimaryDevice();
};

#include "DesktopScreen.h"

DesktopScreen::DesktopScreen(void)
{
}

DesktopScreen::~DesktopScreen(void)
{
}

DISPLAY_DEVICE DesktopScreen::GetPrimaryDevice(){
    int index=0;
    DISPLAY_DEVICE dd;
    dd.cb = sizeof(DISPLAY_DEVICE);

    while (EnumDisplayDevices(NULL, index++, &dd, 0))
    {
        if (dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) return dd;
    }
    return dd;
}

DesktopScreenInfo DesktopScreen::GetScreenInfo(){
    DISPLAY_DEVICE dd = GetPrimaryDevice();
    DesktopScreenInfo info;
    DEVMODE dm;
    dm.dmSize = sizeof(DEVMODE);

    if (!EnumDisplaySettings(dd.DeviceName, ENUM_CURRENT_SETTINGS, &dm))
    {
        //printf("EnumDisplaySettings failed:%d\n", GetLastError());
        return info;
    }
    info.Width = dm.dmPelsWidth;
    info.Height = dm.dmPelsHeight;
    info.ScreenDepth = dm.dmBitsPerPel;
    info.FrameRate = dm.dmDisplayFrequency;
    std::stringstream ss;
    ss << info.Width << "x" << info.Height << ":" << info.ScreenDepth << "@" << info.FrameRate;
    info.ScreenInfoString = ss.str();
}

but when am trying to build it , it gives me this errors

Error   2   error LNK2019: unresolved external symbol __imp__EnumDisplayDevicesA@16 referenced in function "private: struct _DISPLAY_DEVICEA __thiscall DesktopScreen::GetPrimaryDevice(void)" (?GetPrimaryDevice@DesktopScreen@@AAE?AU_DISPLAY_DEVICEA@@XZ)
Error   3   error LNK2019: unresolved external symbol __imp__EnumDisplaySettingsA@12 referenced in function "public: struct DesktopScreenInfo __thiscall DesktopScreen::GetScreenInfo(void)" (?GetScreenInfo@DesktopScreen@@QAE?AUDesktopScreenInfo@@XZ)

I have no clue what is wrong :S

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T02:50:44+00:00Added an answer on June 10, 2026 at 2:50 am

    You need to link with user32.lib.

    (The documentation for those APIs tells you at the bottom of the page which library to link with.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create Preference Screen with a Checkbox control. <CheckBoxPreference android:summaryOn=@string/mySummaryOn android:summaryOff=@string/mySummaryOff android:key=myCB
I am trying to create a full-screen preview like this Themeforest link has, What
I am trying to print some debugging info (FPS, camera location and rotation, etc)
I am getting White Screen of Death while trying to clear the cache in
I'm getting crazy trying to make a bigger JScrollBar. I would like to do
I am trying to capture the screen whilst my windows mobile application is running.
I am getting error trying to run my asp code for executing stored proc.
I am putting together a dynamic photo gallery and getting stuck trying to place
Getting 401 errors when trying to use ASP.NET back end in load balanced environment
I´m getting this error while trying to commit to a svn repository: svn: MKACTIVITY

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.