Jump to content

DllCall Newbie - What is the return type for ChangeDisplaySettingsEx function?


Recommended Posts

Hello! I am pretty new to DLL stuff and I have spent a lot of hours on crafting a DLL call for the ChangeDisplaySettingsEx function. I tried my code and DllCall reports success, that is good :). But I am not able to identify the "return type" parameter that I should use for DllCall. I tried STR which returned an empty string, I also tried INT which returned 0... According to Microsoft's documentation, the function should return of these:

Quote

Return value

The ChangeDisplaySettingsEx function returns one of the following values.

Return code Description
DISP_CHANGE_SUCCESSFUL

The settings change was successful.

DISP_CHANGE_BADDUALVIEW

The settings change was unsuccessful because the system is DualView capable.

DISP_CHANGE_BADFLAGS

An invalid set of flags was passed in.

DISP_CHANGE_BADMODE

The graphics mode is not supported.

DISP_CHANGE_BADPARAM

An invalid parameter was passed in. This can include an invalid flag or combination of flags.

DISP_CHANGE_FAILED

The display driver failed the specified graphics mode.

DISP_CHANGE_NOTUPDATED

Unable to write settings to the registry.

DISP_CHANGE_RESTART

The computer must be restarted for the graphics mode to work.

Can anyone help me out here? They all look like constants to me and I cannot find their values :unsure:.

Thanks in Advance! TD :thumbsup:

EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time)

DcodingTheWeb Forum - Follow for updates and Join for discussion

Link to comment
Share on other sites

from here:

http://www.math.uiuc.edu/~gfrancis/illimath/windows/aszgard_mini/bin/MinGW/include/winuser.h

#define DISP_CHANGE_SUCCESSFUL  0
#define DISP_CHANGE_RESTART 1
#define DISP_CHANGE_BADFLAGS    (-4)
#define DISP_CHANGE_BADPARAM    (-5)
#define DISP_CHANGE_FAILED  (-1)
#define DISP_CHANGE_BADMODE (-2)
#define DISP_CHANGE_NOTUPDATED  (-3)

 

Edited by kosamja
Link to comment
Share on other sites

Hello. Return type is Long.

LONG ChangeDisplaySettingsEx(
  _In_ LPCTSTR lpszDeviceName,
  _In_ DEVMODE *lpDevMode,
       HWND    hwnd,
  _In_ DWORD   dwflags,
  _In_ LPVOID  lParam
);

 

 

Saludos

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...