kindof like how those little screenmate things do
Printable View
kindof like how those little screenmate things do
Could use regions to do it.
Z.
whats regions?
MSDN it =).
Z.
This is the MFC way of doing, copied from the book 'Practical Visual C++ 6".
Bcos the above code draws straight into the desktop, you must make reparations and clean up in the WM_DESTROY message.PHP Code:// ** Get a pointer to the desktop window
CWnd * pDesktop = GetDesktopWindow();
// ** Get a pointer to it's device context
CDC * pDC = pDesktop->GetWindowDC();
//* Do your drawing here
// pDC->blahblah()
// After drawing
pDesktop->ReleaseDC(pDC);
If u want to do it the win32 API, I think it is not difficult to figure it out asPHP Code:// ** tell windows to redraw its desktop and all child windows
GetDesktopWindow->RedrawWindow(NULL,NULL,
RDW_ERASE+RDW_INVALIDATE+RDW_ALLCHILDREN+RDW_ERASENOW);
"In most cases, you'll find that the MFC class member function is implemented as a call to the native API" --Visual C++ 5 Bible
I have to say this, before I get shot down, that MFC does not encapsulate all the Win32 APIs.
I'm also interested to make a screen saver (after I'm finished with my current project) but I will do it the Win32 API's way bcos I can choose not to ShowWindow().
I tried changing the extension of screen saver that came with windows from *.scr to *.exe and execute them by double clicking.
They showed me a options dialog for the screen saver
If I double-clicked the same file with *.scr extension, it is the screen saver.
Of course, before that, I copied the file to another directory.:D
You can choose not to ShowWindow with MFC. Look at the CYourApp::InitInstance method.
A screensaver is only an executable with the extension changed to .scr, which accepts a special set of parameters. You can look it up somewhere in the MSDN.
i want to draw to desktop (that looks like its drawing to a window). i was gonna use setpixel, will it still work right?
Setpixel is extremely slow. Try to use Bitblt() if possble.
Thanks.Quote:
Originally posted by CornedBee
You can choose not to ShowWindow with MFC. Look at the CYourApp::InitInstance method.
Use regions... =).
Z.