Displaying a window

Hi everyone,
I have a problem in displaying a window.Here is my code

1
2
3
4
5
/*HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);*/
   HWND hWnd;
   hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
	   800, 500, 747,500, nullptr, nullptr, hInstance, nullptr);


I am using visual studio 2015 so it automatically creates a window with a simple menu.Since the size of the default window created by visual studio is not suitable for wish I adjusted the x and y axis.

I have no problem with my code but now my window is displaying in the bottom right corner of my PC.I have to drag it everytime I run my program.

I used CFF Explorer to and founded the imports of my Program and copied all the necessary ".dll" and made my program to run on another PC but The same problem occurs in that PC also.What should I do now?

Thank you

Last edited on
If you look up CreateWindow() on MSDN you'll see the 4th, 5th, 6th, and 7th parameters control x/y pixel location of initial position of top left corner, and pixel width and height.
Topic archived. No new replies allowed.