|
Resist the temptation to redraw your entire client area when processing a paint message. You should get the invalid rectangle and only draw the contents that fall within it.
CDC::GetClipBox
The situation works best (looks professional) if you create an offscreen buffer(memDC) that is the size of the rectangle returned from CDC::GetClipBox and draw to it then blit it to the original dc when you are done drawing.
|
|
|
|
|
|
Thank you all for your help. Excuse me If I don't reply before but my pc crush in the last night. For the offscreen drawing I'm also now using it. But I have a doubt... In same part of my application I draw some of the object that I initialize (CLine,CRectangle and other object that I have created with their own Draw method) without use the offscreen buffer tecnique. How Can I use the offscreen buffer without use the OnDraw method? In other word how can I paint in some location of my code without use the central OnDraw method using double buffering? Another problem happens when I call InvalidateRect this function seems to be very very slow how could I replace It? Another question is: Will the program be faster if I use an SDI interface(I create an MDI application but now I have understood that I don't really need it)? Al least for multithreading I'm now using only two thread, the secondary thread is a working thread made in the "old way" (I have made a new class in order to make an efficient thread) and this thread doesn't interfere with the draw.
|
|
|
|
|
hello friends
i want coding for my problem.i have some file say text ,pdf or any type of file whatever size it have ,i want coding how to hide the size of that file or make a fake size of that file or convert it into a 0 byte.please help me in full coding in c++.
|
|
|
|
|
indiraagandhi wrote: ...or convert it into a 0 byte.
See here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Do You really want to trick the file attributes to make explorer showing a fake size? Why?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
because i am working on concealed msg system & i do not want to show the size of hide file to an unauthorised user , for that i want this code
|
|
|
|
|
Well, I think NTFS - Alternative Data Streams[^] will be a perfect solution for you.
First open a new stream for your file. The normal file api's will be enough. Then Save your data into the new stream and truncate the main stream. So in explorer it seems the file is empty as you wish and in the mean time, you have the hidden data under it as well. And obviously it needs NTFS file system.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
How to append a new menu item to global system menu. I.e. to system menu of all applications. Well, for a single application it can be done easly by using GetSystemMenu() . But how to do it system wide?
I saw one application doing the same. When i checked the dlls, of the application I could see the MouseHookProc() in exported functions and I guess that its doing it by a global mouse hook. But after long R&D I couldn't figure out how. Any hints guys?
Thanks & Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Well, even Jijo raj wasn't able to do that, so far...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I did expect you'll reply with some funny quotes.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
This time I have no technical answer, unfortunately...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Don't worry mate. At least you cheered up me!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
You can ask of your site.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Jijo,
I never tried this can't you use systemwide api hooking?
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
yeah! That seems to be a possibility. I could hook GetSystemMenu() and add another system wide window message hook for WM_COMMAND and handle the message. But I strongly feels that there is some easy way to do it.
Well, thanks Sarath for the thought. Ofcourse you always "Shares your thought"!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
What about Using EnumWindows to get all top level windows and then modify the menu? Also you will have to add hook for new window creation notifications. I dont know if it will work but just a thought..
Regards,
Sandip.
|
|
|
|
|
That's also a possibility to experiment. I think, in order to handle the message, i've to add one message hook as well. isn't it? Well, thanks a lot Sandeep and my 5 points.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
I haven't tried it with 'Mouse Hook', but did with 'Windows Procedure Hook'. Installed a hook for WH_CALLWNDPROC (Windows procedure) and handled the 'WM_INITMENU' message in the hook. Once you get the window handle in the hook, I hope you don't need any more clues....
- Malli...!
|
|
|
|
|
That seems to be a cool Idea! Let me try it out. Thanks a lot malli, and please accept my 5 points.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
My pleasure.....
- Malli...!
|
|
|
|
|
Hi guys,
I downloaded a zip utility source code. When I used it in my program I received:
..\Zip_Utils\zip.cpp(2992) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
I have the source. Of course, I can easily add '#include "stdafx.h"', but that is not the point.
The question is: what is so special of "stdafx.h" that require including it in every .cpp that I add???
P.S. I don't know does it matter, but I'm writing in VS2005 in C++ for Windows Mobile 5.0, native, without STL, WTL, MFC.
|
|
|
|
|
akirilov wrote: The question is: what is so special of "stdafx.h" that require including it in every .cpp that I add???
Because it's the key to using the precompiled header (.pch) file.
The bigger question is how was the project's author able to compile the project without making the changes you've had to?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Because it's the key to using the precompiled header (.pch) file.
So I have to include "stdafx.h" in every .cpp that I'm using?
Than probably I have to start reading about precompiled header (.pch) file...
|
|
|
|
|
akirilov wrote: So I have to include "stdafx.h" in every .cpp that I'm using?
Yes, if that's the way the project has been configured. You can, however, turn it off for individual files (e.g., C files).
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|