Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i resize a specific window after it's created?

I want to resize some game window (DirectX) after it has been created, the game window allows resizing by mouse from the edges. But i want to automate this because it's quite hard to do this by mouse: cursor is invisible at the edges and i must de-focus the window first to be able to resize by clicking at the edges. To be clear: i have no sources for this game, so i must make my own program to do this.

How can this be done? Or better: is there already existing programs to do these things?

like image 402
Newbie Avatar asked Feb 25 '23 12:02

Newbie


1 Answers

There might be problems, but its better to try simple things first.

As your post tagged with C++ I suppose you're looking for WinAPI solution. Try this one:


int width = 640;
int height = 480;

HWND handle = ::FindWindow(NULL, _T("Window title"));

::SetWindowPos(handle, 0, 0, 0, width, height, SWP_NOMOVE | SWP_NOOWNERZORDER | SWP_NOZORDER);
like image 171
yurymik Avatar answered Mar 06 '23 17:03

yurymik