I have windows application, i need to maximize the window/form.
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HT_CAPTION = 0x2;
SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
int WM_SIZE = 0x0005;
int SIZE_MAXIMIZED = 2;
SendMessage(Main, WM_SIZE, SIZE_MAXIMIZED, 0);
As described in the documentation,
WM_SIZE is a notification, sent to the window in the event of the window's size changing. Sending it to a window won't change the size of the window. Your sending
WM_NCLBUTTONDOWN appears to be an attempt to fake a click in the caption bar. That won't work, at least not the way you've done it.
ShowWindowAsync passing the handle of the window that you wish to maximize, and