|
-
Sep 16th, 2002, 07:00 PM
#1
Thread Starter
Fanatic Member
Rendering graphics to desktop
kindof like how those little screenmate things do
-
Sep 16th, 2002, 07:08 PM
#2
Frenzied Member
Could use regions to do it.
Z.
-
Sep 16th, 2002, 08:21 PM
#3
Thread Starter
Fanatic Member
-
Sep 16th, 2002, 08:22 PM
#4
Frenzied Member
-
Sep 16th, 2002, 09:17 PM
#5
Hyperactive Member
This is the MFC way of doing, copied from the book 'Practical Visual C++ 6".
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);
Bcos the above code draws straight into the desktop, you must make reparations and clean up in the WM_DESTROY message.
PHP Code:
// ** tell windows to redraw its desktop and all child windows
GetDesktopWindow->RedrawWindow(NULL,NULL,
RDW_ERASE+RDW_INVALIDATE+RDW_ALLCHILDREN+RDW_ERASENOW);
If u want to do it the win32 API, I think it is not difficult to figure it out as
"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().
-
Sep 16th, 2002, 09:22 PM
#6
Hyperactive Member
Food for thought
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.
Last edited by transcendental; Sep 16th, 2002 at 09:25 PM.
-
Sep 17th, 2002, 11:57 AM
#7
You can choose not to ShowWindow with MFC. Look at the CYourApp::InitInstance method.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Sep 17th, 2002, 11:58 AM
#8
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.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Sep 17th, 2002, 06:50 PM
#9
Thread Starter
Fanatic Member
i want to draw to desktop (that looks like its drawing to a window). i was gonna use setpixel, will it still work right?
-
Sep 17th, 2002, 08:10 PM
#10
Hyperactive Member
Setpixel is extremely slow. Try to use Bitblt() if possble.
-
Sep 17th, 2002, 08:11 PM
#11
Hyperactive Member
Originally posted by CornedBee
You can choose not to ShowWindow with MFC. Look at the CYourApp::InitInstance method.
Thanks.
-
Sep 17th, 2002, 09:01 PM
#12
Frenzied Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|