lemming999
Programmer
As you can see i dont use the WM_PAINT function because this code is more efficient for drawing to screen for my program. However this button here won't appear on screen.
I'm a really novice programmer and i'm trying to tweak another program so i dont know where I am going wrong.
hwndMagnify is declared globally, and the drawmap function completely clears the screen and fills in the screen
while( WM_QUIT != msg.message )
{
if( g_bActive )
bGotMsg = PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE );
else
bGotMsg = GetMessage( &msg, NULL, 0U, 0U );
if( bGotMsg )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
else
{
ShowWindow(hwndMagnify, SW_SHOW);
m.drawMap(d.getHdc(),cxClient,cyClient);
B.DrawAllBuildings(d.getHdc(), cxClient, cyClient);
if (sim != NULL)
{
sim->update();
sim->drawVehicles(d.getHdc(),cxClient,cyClient);
}
d.pageFlip(cxClient,cyClient);
}
}
.............................
.............................
case WM_CREATE:
hdc = GetDC (hWnd);
hwndMagnify = CreateWindow("button", "Rotate 90°",WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 55, 1,40 , 1, hWnd, HMENU(IDC_STUC1),hInst, NULL) ;
return 0;
I'm a really novice programmer and i'm trying to tweak another program so i dont know where I am going wrong.
hwndMagnify is declared globally, and the drawmap function completely clears the screen and fills in the screen
while( WM_QUIT != msg.message )
{
if( g_bActive )
bGotMsg = PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE );
else
bGotMsg = GetMessage( &msg, NULL, 0U, 0U );
if( bGotMsg )
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
else
{
ShowWindow(hwndMagnify, SW_SHOW);
m.drawMap(d.getHdc(),cxClient,cyClient);
B.DrawAllBuildings(d.getHdc(), cxClient, cyClient);
if (sim != NULL)
{
sim->update();
sim->drawVehicles(d.getHdc(),cxClient,cyClient);
}
d.pageFlip(cxClient,cyClient);
}
}
.............................
.............................
case WM_CREATE:
hdc = GetDC (hWnd);
hwndMagnify = CreateWindow("button", "Rotate 90°",WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 55, 1,40 , 1, hWnd, HMENU(IDC_STUC1),hInst, NULL) ;
return 0;