i have created a form using visual c++. all im trying to do is this when a button is clicked the form is gone and new window will be showen. i don't know if i should repaint the window or there is another solution? please help Rami
What I would do is display your game in the client area of the MainWindow of your app. In (possibly) Init_Instance() also call your form for the login. When the user has filled it in, just close that window and your game will already be behind it. You may need to refresh the screen afterwards so you don't get any artifacts.
Also, just noticed the "how to paint the whole thing" question.
myWindow.Invalidate(); http://msdn.microsoft.com/en-us/library/2dtwaxz7(VS.71).aspx
myWindow.InvalidateRect(LPCRECT lpRect, BOOL bErase = TRUE); http://msdn.microsoft.com/en-us/library/62w186xw(VS.71).aspx
Do not put it in the actual paint event, OnPaint().
I'm just answering the question.
Trap the button-click event, IOW, create a function for it and close the current window. Then call / create the new window in the same event / function. You'll most likely need a class level pointer to "hold" the current window.
No offense, but this would be a fairly bad design, unless you are making a "Wizard" type of construct. That is one window closing actually should bring up the next window.