I have a task, which includes me creating a console process. For changing size of the window I use a flag STARTF_USECOUNTCHARS and members .dwYCountChars and .dwXCountChars
for (int i = 0; i < processes; i++)
{
stInfos[i].dwFlags = STARTF_USECOUNTCHARS;
stInfos[i].dwYCountChars = 100;
stInfos[i].dwXCountChars = 100;
cmdline = path + args + L" " + std::to_wstring(i);
if (CreateProcess(NULL, (LPWSTR)cmdline.c_str(), NULL, NULL, true, CREATE_NEW_CONSOLE | NORMAL_PRIORITY_CLASS, NULL, NULL, &stInfos[i], &prInfos[i]))
{
}
}
The code changes only the width of the console to fit my monitor width, for example when i set the size to be 800x800 chars. [The look of the console while setting it(the width is the size of my monitor)][1]
The height doesn't change and when setting the width smaller(500 chars for example) it still makes the window the width of the monitor.
The same happens when setting width smaller.
The flag STARTF_USESIZE and and members .dwYSize and .dwXSize don't work at all and the window creates with the same size as always
for (int i = 0; i < processes; i++)
{
stInfos[i].dwFlags = STARTF_USESIZE;
stInfos[i].dwYSize = 5000;
stInfos[i].dwXSize = 800;
cmdline = path + args + L" " + std::to_wstring(i);
if (CreateProcess(NULL, (LPWSTR)cmdline.c_str(), NULL, NULL, true, CREATE_NEW_CONSOLE | NORMAL_PRIORITY_CLASS, NULL, NULL, &stInfos[i], &prInfos[i]))
{
}
}
How can you change it? [1]: https://i.stack.imgur.com/uD6Pk.png