There's more to this than you suppose.
First, what operating system?
Second, you need a window before you can have a background color.
Assuming you have Windows and know how to create a window, then the backgound color can be set with http://msdn.microsoft.com/en-us/libr...61(VS.85).aspx.
operation system is windows xp, i use quincy compiler. What is wrong with the line 17 ...load Icon?
//line 0
#include <windows.h>
LRESULT CALLBACK WindowFunc(HWND,UINT,WPARAM,LPARAM);
char szWinName[]= "MyWin";
int WINAPI WinMain(HINSTANCE hThisInst, HINSTANCE
hPrevInst, LPSTR lpszArgs,
int nWinMode)
{
HWND hwnd;
MSG msg;
WNDCLASSEX wcl;
wcl.cbSize=sizeof(WNDCLASSEX);
wcl.hInstance=hThisInst;
wcl.lpszClassName=szWinName;
wcl.lpfnWndProc=WindowFunc;
wcl.style=0;
wcl.hIcon = LoadIcon(NULL,IDI_APPLICATION);
//стил на иконата
wcl.hIconSm=LoadIcon(NULL,IDI_WINLOGO);
//стил на малката икона
wcl.hCursor=LoadCursor(NULL,IDC_ARROW);
//стил на курсора
wcl.lpszMenuName=NULL;
wcl.cbClsExtra=0;
wcl.cbWndExtra = 0;
//цветът на фона на прозореца да бъде бял
wcl.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
//регистриране на класа на прозореца
if(!RegisterClassEx(&wcl)) return 0;
hwnd = CreateWindow(
szWinName, "Windows Skeleton", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, HWND_DESKTOP, NULL,hThisInst, NULL);
ShowWindow(hwnd,nWinMode);
UpdateWindow(hwnd);
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WindowFunc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message) {
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, message, wParam, lParam);
}
return 0;
}