11/* --------------------------------------------------------------
2- | Display Position Editor v1.3.2 |
2+ | Display Position Editor v1.3.3 |
33 | By Benjamin J. Pryor |
44 |--------------------------------------------------------------|
55 | A simple command line utility to accurately set the relative |
@@ -54,13 +54,13 @@ void set_display_pos(int argc, char** argv) {
5454
5555 wcout << endl << " Applying position {" << argv[(3 * i) + 2 ] << " , " << argv[(3 * i) + 3 ] << " } to Display #" << argv[(3 * i) + 1 ] << " ..." << endl;
5656
57- if (EnumDisplayDevicesW (NULL , stoi (argv[(3 * i) + 1 ]) - 1 , &dmInfo, EDD_GET_DEVICE_INTERFACE_NAME) != 0 ) {
57+ if (EnumDisplayDevicesW (NULL , stol (argv[(3 * i) + 1 ]) - 1 , &dmInfo, EDD_GET_DEVICE_INTERFACE_NAME) != 0 ) {
5858
5959 if (EnumDisplaySettingsExW (dmInfo.DeviceName , ENUM_CURRENT_SETTINGS, &dmMode, EDS_RAWMODE) != 0 ) {
6060
6161 dmMode.dmFields = DM_POSITION;
62- dmMode.dmPosition .x = stoi (argv[(3 * i) + 2 ]);
63- dmMode.dmPosition .y = stoi (argv[(3 * i) + 3 ]);
62+ dmMode.dmPosition .x = stol (argv[(3 * i) + 2 ]);
63+ dmMode.dmPosition .y = stol (argv[(3 * i) + 3 ]);
6464
6565 if (ChangeDisplaySettingsExW (dmInfo.DeviceName , &dmMode, NULL , CDS_GLOBAL | CDS_UPDATEREGISTRY, NULL ) == DISP_CHANGE_SUCCESSFUL)
6666 wcout << " Done!" << endl << endl;
@@ -82,7 +82,7 @@ void set_display_pos(int argc, char** argv) {
8282void list_displays (void ) {
8383 DISPLAY_DEVICE displayDevice{ sizeof displayDevice, };
8484
85- for (int i = 0 ; EnumDisplayDevices (nullptr , i, &displayDevice, EDD_GET_DEVICE_INTERFACE_NAME); i++) {
85+ for (long i = 0 ; EnumDisplayDevices (nullptr , i, &displayDevice, EDD_GET_DEVICE_INTERFACE_NAME); i++) {
8686 wcout << endl;
8787 wcout << " Display #" << i + 1 << endl;
8888 wcout << " Device name: " << displayDevice.DeviceName << endl;
@@ -104,7 +104,7 @@ void list_displays(void) {
104104}
105105
106106void show_help (void ) {
107- wcout << endl << " DPEdit 1.3.2 " << endl;
107+ wcout << endl << " DPEdit 1.3.3 " << endl;
108108 wcout << " A command line utility to accurately position displays in a multi-monitor setup." << endl << endl;
109109 wcout << " Usage: dpedit.exe [/H] [/?]" << endl;
110110 wcout << " dpedit.exe /L" << endl;
0 commit comments