|
Hello,I am interrested in "Windows Media Player Technorogy".
There is "prevent screen capture by user" .
The WMP play a MPEG file.
The user push "Print Screen" key,and copy to clipboad.
but the part of picture in clipboad is black.
I want to realize that function.
I researched around "WM_PRINT" and callback function.
but I can't.
Is there any solution?
|
|
|
|
|
Is it the reaction to WM_COPY? Or is WMP constantly checking the clipboard?
BTW. This is one of the reasons why I never use WMP - sorry Redmond!
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
I want to create the below function.
for example,
My Aplication draw only the circle.
The user push the "print screen" key.
But The picture of my aplication's view is black.
And,,,
I think that WMP doesn't constantly chacking the clipboad.
|
|
|
|
|
One of possible soultion that I'm coming with would be:
1. register one of your hidden windows as ClipBoard viewer, so when capture happens you'll get WM_DRAWCLIPBOARD message (see SetClipboardViewer());
2. on receiving WM_DRAWCLIPBOARD you may look into content and somehow figure out if bitmap(metafile) is something coming from your drawing window (based on size for example and or some other specific features) or maybe empty clipboard always when there is bitmap/metafile in it;
3. If it's you -- post message to your main wnd that will empty clipbrd...
...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
This is not actually something WMP does intentionally, it is just an artifact of using overlay surfaces from the video driver. You can do this yourself using DirectDraw. You can't do it with GDI.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Thank you for replies.
I want to try method of replies.
Thank you!!
|
|
|
|
|
I use regsvr32 to register my dll,but it only register for the user that I register in its account,not gor all user. Any idea?
Mazy
No sig. available now.
|
|
|
|
|
Mazdak wrote:
...but it only register for the user that I register in its account,not gor all user.
How are you verifying this?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
i have a problems to remote controling of IIS server (i mean creating FTP, Web sites and managing it). If some one tell me where i can read about it or see some codes on C++ or C# i will be very happy... TNX
|
|
|
|
|
Could anyone spot the problems with the codes below? Just have a look on the DIB section, assuming functions in CBCLass and CAClass are prefectly working except this one. This section of codes run okay by calling it one or twice but will crash when call it more often. I am wrapping this code below with managed C++.
Any potential problem?
<br />
CBClass::function(unsigned int uiDegree)<br />
{<br />
HBITMAP hBmp = this->getCxImage()->MakeBitmap(GetDC(0));<br />
ASSERT(hBmp!= NULL);<br />
CAClass oTempImage(GetDC(0), hBmp);
bool bRet = oTempImage.Rotate(uiDegree);<br />
HBITMAP hRotatedBmp = oTempImage.GetDIB();<br />
ASSERT(hRotatedBmp!= NULL);<br />
this->getCxImage()->CreateFromHBITMAP(hRotatedBmp);<br />
::DeleteObject(hRotatedBmp);<br />
<br />
return bRet;<br />
}<br />
thank you.
Sonork 100.41263:Anthony_Yio
|
|
|
|
|
How to insert Button to titleBar of window?
(where minimize, restore, close buttons is placed)
or how to get pointer to TitleBar window ?
Thanks.
|
|
|
|
|
Look up WM_NCPAINT , WM_NCLBUTTONDOWN , etc.
|
|
|
|
|
|
Hi guys
I'm trying to do something similar to a sports results tray info, and I was thinking to get the results from a web page to later show them in the tray.
There is an easy way to get part of text from an html page programatically?
Best Regards
Dr.pi
|
|
|
|
|
Yes, you can use IE automation. Search MSDN for IHTMLDocument .
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Another idea..
In the past I have used the following function to pull HTML code from a url.. I then parse the HTML code and pull out the info I want.. Not sure if this is what your looking for but here's some code..
CString strUrl,
strBuff,
strError;
CInternetSession mysession;
CStdioFile* remotefile;
char httpbuff[4096];
int numbytes;
strUrl = _T("HTTP://www.someurl.com/index.htm");
strError = _T("SUCCESS");
TRY
{
remotefile = mysession.OpenURL(strUrl,1,INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_RELOAD);
while (numbytes = remotefile->Read(httpbuff, sizeof(httpbuff)-1))
{
httpbuff[NULL];
strBuff += (CString)httpbuff;
}
mysession.Close();
remotefile->Close();
delete remotefile;
}
CATCH_ALL(error)
{
TCHAR szCause[4096];
error->GetErrorMessage(szCause,4096,NULL);
strError.Format("%s",szCause);
}
END_CATCH_ALL;
if(!strError.CompareNoCase(_T("SUCCESS")))
{
}
else
{
}
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Please if there is someone who knows how to pass an input parameter to a query for selecting data from a view with parameter.
I have a "MS Access" View called "Income" and this view has a parameter pDate.
The SQL used to create the View is something like this:
SELECT AVG(TROL) AS MROL, AVG(TEURO) AS MEURO, AVG(TUSD) AS MUSD
FROM Total
WHERE date > pDate;
pDate is a parameter.
I have a class CDBIncome : public CRecordset
and a recordset
CDBIncome rsIncome;
I don't know how to pass the pDate parameter to rsIncome;
If somebody knows how to do this, please write the code to do this.
Code for DoFieldExchange(CFieldExchange* pFX)
and code for query. And anything I should know.
Thank you.
|
|
|
|
|
|
I have tried to add this code to
DoFieldExchange(CFieldExchange* pFX)
{
..............................
pFX->SetFieldType( CFieldExchange::inputParam );
RFX_Text( pFX, _T("[pDate]"), m_dateDate );
}
I have declared
CString m_dateDate;
CDBIncome::CDBIncome(CDatabase* pdb)
: CRecordset(pdb)
{
//{{AFX_FIELD_INIT(CDBMedie)
m_MROL = 0.0;
m_MEURO = 0.0;
m_MUSD = 0.0;
m_nFields = 3;
m_nParams= 1;
//}}AFX_FIELD_INIT
m_nDefaultType = snapshot;
}
and
{
CDBIncome rsIncome(&theApp.m_DB);
rsIncome.m_dateDate = ...(my date to pass as parameter)
rsIncome.Open();
}
But i get this error to few parameters and everything i try i receive errors
|
|
|
|
|
Here's one way:
CString CDBIncome::GetDefaultSQL()
{
CString strQuery;
strQuery.Format("SELECT AVG(TROL) AS MROL, AVG(TEURO) AS MEURO, AVG(TUSD) AS MUSD FROM Total WHERE date > '%s'", m_strSomeDateValue);
return strQuery;
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thanks, it does the work, but this isn't a parametrized query.
I want to know how to pass parameters to a view.
|
|
|
|
|
Ahh, that's a different request! You'll want to read this article.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
For a technical drafting program, i need to draw truetype fonts with total control on their height : for example i want a text of exactly 10mm high.
The problem is in interpretation of height; for truetype fonts, this height is made of 3 arts : Descent (part under the baseline), Ascent (part over the baseline), InternalLeading (some space above the character). All these values are returned by pDC->GetTextMetrics() when you have selected a font in the pDC.
In my case, when i say i want a font 10 mm high, it means a font whose characters above the baseline (such as digits) will be 10 mm high. This convention is used by programs such as Autocad, MicroStation, ...
For creating a CFont object, you have to fill a LOGFONT struct with the properties of the font, such as font name, height, weight, ... But as said before, the height specified here include descent + ascent + leading. Here is how i try to get what i want :
CFont *pOldFont, newfont;
TEXTMETRIC Metrics;
LOGFONT lf;
double HcarFromFont, HcarWanted;
memset(&lf, 0, sizeof(LOGFONT));
strcpy(lf.lfFaceName, "Arial");
// HcarWanted is the required height (say 10 mm) converted in pixels;
// the height must be specified in logical units, which are pixels because the the current mapMode is MM_TEXT.
HcarWanted = 10 /* mm */ * ConversionFactor; // ConversionFactor translates mm in pixels
// set the height - this is just a first try :
lf.lfHeight = - (long)HcarWanted; // note the minus sign, this is normal (see doc. for LOGFONT)
... // set others font properties
newfont.CreateFontIndirect(&lf);
pOldFont = pDC->SelectObject(&newfont);
pDC->GetTextMetrics(&Metrics); // get metrics (in pixels) for the font just created
// read the current height for ascent part :
HcarFromFont = Metrics.tmAscent - Metrics.tmInternalLeading;
// here is the trick : the height of the ascent part is of course smaller than the required height;
// so i correct the total height (lf.lfHeight) so that the ascent part grows up to the required height :
lf.lfHeight = (long) (lf.lfHeight * (HcarWanted / HcarFromFont));
// example : let's say that HcarWanted is 100 pixels and that GetTextMetrics()
// returned HcarFromFont = Metrics.tmAscent - Metrics.tmInternalLeading = 60;
// so the new lf.lfHeight is multiplied by * 100/60 = 1.66
newfont.Detach();
newfont.DeleteObject();
newfont.CreateFontIndirect(&lf); // recreate the font with the corrected height
pDC->SelectObject(&newfont);
// the following lines just check that the new height of the ascent part is very near of the required height :
pDC->GetTextMetrics(&Metrics);
HcarFromFont = Metrics.tmHeight - Metrics.tmInternalLeading;
Problem : the resulting height on screen is near the required height but there is still an error up to 20 %; for a same specified height, some fonts are smaller, some are bigger.
JPG
|
|
|
|
|
Have you considered working in a different mapping mode, for example, MM_LOMETRIC ?
If you want to implement printing, using such a device-independent mapping mode will seriously simplify your code.
One thing that will bite you is that MM_LOMETRIC has the y axis increasing from the bottom of the screen to the top, unlike MM_TEXT which is the other way round. By default, the (0, 0) position is still in the top left of the window.
You can implement zooms and pans simply by modifying the window and viewport extents.
For more information, see Mapping Modes and Translations[^].
|
|
|
|
|
I have made tests with 2 mapping modes :
on screen : mapmode = MM_TEXT : 1 logical unit = 1 pixel
when printing : mapmode = MM_LOMETRIC : 1 logical unit = .1 mm
The problem stays independently of the map mode; i don't think it's a problem
of map mode, since for a same mapmode and a same lfHeight (in the LOGFONT struct),
the effective height of the text will vary with the font.
And my problem is not only that the height changes with the font : for a given font i want that the height of the 'ascent' part of the font is precisely 10 mm, and i can't get that. For example i want digits (these characters have no descent part) of exactly 10 mm.
(Of course i don't set lfHeight = 10, but i apply a factor converting mm to pixels; i know this factor is correct, i use it for drawing lines).
|
|
|
|