|
When terraserver.com was a free service and all the 1 meter images were available it used to have this feature. It would use an ActiveX control inside IE to draw the images, but if you tried to "PrintScreen" and paste in Paint you would get their logo!
They accomplished this by drawing directly to video memory perhaps using DirectX.
|
|
|
|
|
Thank you for the reply.
But I could paste.Am I wrong?
>They accomplished this by drawing directly to video memory perhaps using >DirectX.
Sure.I tried by using DirectX.
But I don't want to use as special a thing-"special API." as possible.
Can we draw object like drawing mouse pointer?
|
|
|
|
|
You do it using hooks - or at least thats how I usually do )
Add a low level keyboard hook (see SetWindowsHookEx in MSDN) and then swollow the print screen key when it comes along - there is an example in MSDN that explains it well for disabling CTRL-ALT-DEL - the principle is the same for print screen, except you are stuck with hooks and can't use things like policys to disable the key.
See here http://msdn.microsoft.com/msdnmag/issues/02/09/CQA/
|
|
|
|
|
Thank you for the reply.
But The capture softaware can capture.
For example,I can capture using software with timer.or I can copy desktop-view with timer.
I thought ,,,
Isn't there API what drawing the mouse cursor?
Is it impossible also by the method that using Assembly in C++?
|
|
|
|
|
Sorry, I'm struggeling to understand your English )
Are you saying you want to prevent ANY app capturing the screen, either by the "print screen" method or programmtically via something like GetDC(NULL)?
The preventing "print screen" method is easy - use a hook.
Preventing someone doing it programmtically (unless they do it programmtically by simulating a print screen key, which most don't) is MUCH more challengling. You are talking here about intercepting internal API calls and for the functions that capture the screen (killing off GetDC() will work for most of them, just make sure you only kill the call if the parameter is NULL ) ). For this, you'll need a driver - certianally on Win 9x.
For a start, go to www.sysinternals.com and download the code for RegMon - this intercepts the calls to Reg... functions and logs them - you need to do the same for functions that capture the screen and see if you can prevent the call from going any further.
Good luck, you'll need it.
|
|
|
|
|
I am sorry that a reply is overdue.
The your explanation is filtering driver?
I don't want to install dll file in system directory.
I want to realize using exe file as much as possible.
It cannot but give up, if impossible.
But Thank you very much,Diddy!
|
|
|
|
|
You're welcome It is a tricky one to do, essentially you are trying to disable a Windows API call, not trival by any means.
You might want to look at http://research.microsoft.com/sn/detours if you don't fancy doing a driver.
You don't strictly need to use a driver, if you only wan't to run on NT/XP or 2k. Look at the code for RegMon as suggested.
Running on the other platforms (95, 98 and ME) is more tricky, but still possiable without using a driver.
I have only ever written things to intercept API calls - never to complete disable them - though you may be able to do it like that - when you have a call to GetDC(NULL) come through (which would give you a device context to the "desktop window" - IE the complete screen - it's how most sceen capture programs work) you could simply return a DC that has a dummy bitmap in it - it's quite easy to do.
Good luck
|
|
|
|
|
Hi,
I would like to delete all the characters after ".pvd" in a CString variable.
How can I keep all the characters before and including ".pvd" and delete all the characters after it???????
Ehsan Behboudi
|
|
|
|
|
CString str = "test.pvd sth"
int index = str.Find(".pvd");
if(index == -1)
return;
str = str.Left(index + 4);
It should work, though I did not compile it
See CString class header for all possible methods
:P
|
|
|
|
|
You use the combination of Find and Delete member functions. An example:
CString csText = "I am .pvd and I rock the world !";<DIV>
csText.Delete( csText.Find(".pvd") + strlen(".pvd"), 4000 ); This code fragment would look for the starting point of the ".pvd", then move forward based on the length of the search string, and delete from this point forwards until 4000 characters are removed or the end of the string is reached (more likely).
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Antti Keskinen wrote:
csText.Delete( csText.Find(".pvd") + strlen(".pvd"), 4000 );
I think that this doesn't work
Carlos Antollini
Do you know piFive[^] ?
|
|
|
|
|
A quick Win32 console application supporting MFC on the .Net 2003: The code issued for the compiler:
CString csText = "I rock the .pdv world !";<DIV>
csText.Delete( csText.Find( ".pdv" ) + (int)strlen(".pdv"), 4000 );<DIV>
AfxMessageBox( (LPCTSTR) csText, MB_OK ); This code fragment, when run, displays the console window and pops up a message box reading: "I rock the .pdv". Logical conclusion: the code works, and your assumption of it's non-functionality was misplaced.
I know your reply comment was meant humorous, but please.. I am tired of fixing things that aren't broken just because there are people in the wide world who think they know better. I don't mean anything malicious with this nor do I want to make you feel bad in any way, but I just don't find it funny. If you believe that you have more accurate information over a matter, present it, and perhaps point out the things that are incorrect in the earlier postings.
It's just that this time, I was correct, you were wrong, and the code worked flawlessly and did precise what it was supposed to do. Perhaps next time, the situation will be reversed, and I'll be the one in need of learning new stuff
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hello, I'm new to this forum/website/ and C++!
The problem I'm having is that my loop repeats even when I enter a value of 'Y', 'y', 'N', or 'n'. I want it to break after one of these values have been entered and return it. Please advise.
Even if I enter Y, N, y, or n it still does the while loop. I'm trying to get it to repeat the loop ONLY if the value of the variable isn't one of the above. Please advise.
char searchAgain()
{
char rSearch;
do
{
cout << "Search again? (Y/N): ";
cin >> rSearch;
}while (rSearch != 'Y' || rSearch != 'y' || rSearch != 'N' || rSearch != 'n');
return rSearch;
}
"Criticism comes easier than craftsmanship" - Zeuxis
|
|
|
|
|
CarteBlanche wrote:
(rSearch != 'Y' || rSearch != 'y' || rSearch != 'N' || rSearch != 'n');
Change the || to && and it should do what you want.
right now you're saying if it's not Y or y or N or n, then continue looping... but, if you switch it to "if it's not Y and y and N and n", it'll exit the loop. or, it should at least.
|
|
|
|
|
Ahh, ok. That makes sense now. Thank you kindly
|
|
|
|
|
This is because you use the standard input stream (cin). This will read characters from the input stream into the designated buffer. As you will first type 'Y' and then press enter, the rSearch will end up showing the NULL character '\0'.
If you are using Visual Studio and/or Windows OS, consider utilizing the _getch function instead of the standard input stream. See MSDN with a keyword for more information about the function.
Code example:
#include <conio.h><DIV>
char rSearch;
do
{
cout << "Search again ? (Y/N): ";
_getch( rSearch );
rSearch = toupper( rSearch );
} while ( rSearch != 'Y' && rSearch != 'N' );
If you are programming on Linux and thus have no access _getch , consider creating a buffer of two or more characters, then using the input stream operation again, only this time checking the first character of the buffer. However, if user inserts more characters than the buffer can hold, the result is unpredictable. You can fix this by using the cin.get routine instead, with a fixed amount of characters read.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Wow, thanks. Much appreciated.
|
|
|
|
|
Hi,
What is the syntax to count the number of characters in a CString ?
Ehsan Behboudi
|
|
|
|
|
You should get able to use the GetLength function.
strMyString.GetLength();
- monrobot13
|
|
|
|
|
If you want to save to file, you may want to use GetLength()*sizeof(TCHAR), where TCHAR in Unicode environment is defined as two byte type.
|
|
|
|
|
hi mr2003,
you know what, you have a complete part of Visual Studio called MSDN... have you ever heard about it ?
if you have a look at CString Class members, i'm sure you can find that answer by yourself...
nevermind, everybody start to learn one day...
see you later i hope
TOXCCT
|
|
|
|
|
we all have good days and bad days, my friend !!!
Ehsan Behboudi
|
|
|
|
|
ey guy, that was just... a joke! humor!!!
You're probably better than me in coding, so keep cool man !
TOXCCT
|
|
|
|
|
Hello!
Right!
But anyway I know many good coders that know nothing about MFC
By the way: there exist empty global CString object (I am talking about vc60). By changing that object, every empty one will be initialized by the changed value. It can be achieved by changing newly created CString object in incorrect way of course. (Something like getting to inner char pointer, or calling GetBuffer without a release)
Funny results
|
|
|
|
|
I need to insert a page break after every hyperlink, if I try the InsertBreak then it replaces the hyperlink text/link, how do it make it happen after this link ?
Many Thanks,
Lee.
Hyperlinks hyplnks;
Hyperlink hyplnk;
Range rg = testDoc.GetContent();
hyplnks.AttachDispatch(rg.GetHyperlinks());
for (long j=1;j<=hyplnks.GetCount()-1;j++)
{
COleVariant n = COleVariant((long)j);
hyplnk.AttachDispatch(hyplnks.Item(n));
Range oSecRange = hyplnk.GetRange();
oSecRange.InsertBreak(COleVariant((long)7)); // 7 = wdPageBreak
}
|
|
|
|