Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Full Screen Window

Status
Not open for further replies.

adholioshake

Programmer
Feb 9, 2003
136
Hello.
I am attempting to write some code to make a screensaver. I have tried to make a fullsize window that covers the whole desktop, but one that does not have a titlebar. So far I have been unsuccessful in my attempts. Can anyone tell me what I need to do to make this full screen window without a titlebar? Thanks, Adam.
 
//Get desktop size:
SIZE szDesktop = GetDesktopSize();

//Create the window:
if(!(m_hwndPOS=CreateWindow(m_pszWndClassName, m_pszWndClassName, WS_POPUP, 0, 0, szDesktop.cx, szDesktop.cy, NULL, NULL, _Module.m_hInst, NULL))) {
g_Log.WriteErrorEx(IDS_LOG_E_CREATEPOSWND, GetLastError());
return FALSE;
}

Greetings,
Rick
 
I'm sorry forgot something:

SIZE GetDesktopSize()
//Returns the dimensions of the current dekstop.
{
HDC hdcDesktop = GetDC(NULL);

SIZE szDesktop = {0};
szDesktop.cx = GetDeviceCaps(hdcDesktop, HORZRES);
szDesktop.cy = GetDeviceCaps(hdcDesktop, VERTRES);

ReleaseDC(NULL, hdcDesktop);

return szDesktop;
}

Greetings,
Rick
 
Thanks, Rick.
I tried a different approach, but your way works better.
I used:
Code:
POINT scrmax;
scrmax.x = GetSystemMetrics(SM_CXSCREEN);
scrmax.y = GetSystemMetrics(SM_CYSCREEN);
I didn't use WS_POPUP as a windows style though, and this was neccessary. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top