そのプログラムだとウィンドウを表示して何かキー入力があったら終了するってことになりますね。
箱を描画したいのでしたら描画関連の関数を使えば表示できると思います。
#include "DxLib.h"
int WINAPI WinMain(HINSTANCE hI, HINSTANCE hP, LPSTR lpC, int nC)
{
ChangeWindowMode(TRUE);
if(DxLib_Init()==-1)return(-1);
int BoxWidth, BoxHeight;
BoxWidth = 50;
BoxHeight = 50;
int DrawPosX, DrawPosY;
DrawPosX = (640 - BoxWidth) / 2;
DrawPosY = (480 - BoxHeight) / 2;
int Color;
Color = GetColor(255, 0, 0);
DrawBox(DrawPosX, DrawPosY, DrawPosX + BoxWidth, DrawPosY + BoxHeight, Color, true);
WaitKey();
DxLib_End();
return(0);
}
これで画面中央に赤い四角が表示されますが。質問の内容はこういうことではないんですかね…?