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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Screensaver preview

Status
Not open for further replies.

imagenetics

Programmer
Dec 8, 2003
66
PL
When writing a screensaver, what to do when the program is executed with "/p" parameter from Screen properties->Screensaver. How to display something/anything in the preview area (a monitor image)?
 
Hi,

in WinMain:


c = GetCommandLine();

while(*c != ' ') //move to space before switch
c++;

if(*(c + 2) == 'p' || *(c + 2) == 'P'){
preview = true;
hwnd = (HWND)atoi(c + 4);
RECT rect;
GetWindowRect(hwnd, &rect);
winwidth = rect.right - rect.left;
winheight = rect.bottom - rect.top;
...

for the preview window:

dwStyle = WS_CHILD | WS_VISIBLE; //window style
hwnd = CreateWindowEx(dwExStyle, ...

for the saver itself:

dwStyle = WS_POPUP | WS_VISIBLE; //window style
hwnd = CreateWindowEx(dwExStyle, ...

Hope this helps.
Bailsoft
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top