Jump to content
TheDcoder

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

Recommended Posts

TheDcoder

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:


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

If I have hurt or offended you in anyway, Please accept my apologies, I never (regardless of the situation) mean to do that to anybody!!!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites
kosamja

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
  • Like 1

Share this post


Link to post
Share on other sites
Danyfirex

Hello. Return type is Long.

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

 

 

Saludos

  • Like 1

Share this post


Link to post
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

×