I am working on a program that would create a window with no title bar which has the WM_CLOSE message procedure set to return 0. So far, I got this:
LRESULT CALLBACK WindowEventProc(HWND hWindow, UINT uMsg,WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT Paint;
HDC hdc;
switch (uMsg)
{
case WM_DESTOY:
PostQuitMessage (0);
return 0;
case WM_CLOSE:
return 0;
case WM_PAINT:
hdc=BeginPaint(hWindow,&Paint);
//here should go the code for painting
EndPaint(hWindow, &Paint);
return 0L;
}
return DefWindowProc(hWindow, uMsg, wParam, lParam);
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow)
{
GetDesktopSize(h,w);
WNDCLASSEX KlasaOkna;
ZeroMemory (&KlasaOkna, sizeof(WNDCLASSEX));
KlasaOkna.cbSize = sizeof(WNDCLASSEX);
KlasaOkna.hInstance = hInstance;
KlasaOkna.lpfnWndProc = WindowEventProc;
KlasaOkna.lpszClassName = Name.c_str();
KlasaOkna.hCursor = LoadCursor(NULL, IDC_ARROW);
KlasaOkna.hIcon = LoadIcon(NULL, IDI_APPLICATION);
KlasaOkna.hbrBackground = (HBRUSH) COLOR_WINDOW;
RegisterClassEx (&KlasaOkna);
HWND hwn;
hwn = CreateWindowEx(NULL,Name.c_str(),"",WS_MYSET,0,0,w,h,NULL,NULL,hInstance,NULL);
SetWindowPos(hwn,HWND_TOPMOST,0,0,w,h,NULL);
SetWindowLong(hwn, GWL_STYLE, 0);
ShowWindow (hwn, SW_SHOWMAXIMIZED);
MSG msg;
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
}
which works as intended, but now comes the hardest thing - I'd like the window to open a website in its client area. I think the best way to maintain the site's functionality is opening it through a browser. There surely is a way to paint an internet browser into my window, but I cannot think of any, neither could I find it in MSDN. Does anyone know how to do it?