TheDcoder Posted August 14, 2017 Share Posted August 14, 2017 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 . Thanks in Advance! TD 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 More sharing options...
kosamja Posted August 14, 2017 Share Posted August 14, 2017 (edited) 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 August 14, 2017 by kosamja TheDcoder 1 Link to comment Share on other sites More sharing options...
Danyfirex Posted August 14, 2017 Share Posted August 14, 2017 Hello. Return type is Long. LONG ChangeDisplaySettingsEx( _In_ LPCTSTR lpszDeviceName, _In_ DEVMODE *lpDevMode, HWND hwnd, _In_ DWORD dwflags, _In_ LPVOID lParam ); Saludos TheDcoder 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
TheDcoder Posted August 14, 2017 Author Share Posted August 14, 2017 Thanks both of you! 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now