|
You guys should have won the war, about 50 years ago. We'd all be speaking German then, and everyone could understand the crap you're writing here.
--
Aber Ich werde auch Adolf genammt..
|
|
|
|
|
I think I made the language point in a far more polite manner about 90 minutes before your post. No need to be rude about it.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
C'mon, those f***ing German's think they own the whole f***ing world. Speak English, or don't speak at all!
--
Und jetzt kommen die Kamelen
|
|
|
|
|
Is the OnSetFocus a good place to swap the m_pMainWnd if I
have multiple top level windows?
Thank You
|
|
|
|
|
I've created my browser but how modify or delete the contextmenu in my application. I've tried to override the method OnContextMenu but it doesn't work!!
|
|
|
|
|
Does anyone here have any experience with using either or both the Windows Media Encoder SDK and/or the Windows Media Format SDK? If so I hope you can help me answer the following question. Using these SDKs I am able to create a profile, create an encoding session, and run this session, I only have one drawback. I cannot correctly specify the audio codec in the profile. I set the WM_MEDIA_TYPE.subtype parameter to be equal to the GUID of the codec I want to use and cannot properly create a profile. But, when I compare the .prx file this profile was saved to against another .prx file that a profile created using the profile manager (with the same parameters as the profile I created using the SDKs) I have one difference in the audio setup. There is a field named codecdata in the .prx file that differs, even though I have set the same parameters in both profiles (one created with the SDKs does not match up to the one I created with the profile manager). Can anyone help me with this problem? If so I will very much appreciate it! Thanks in advance.
Roger Printy
Software Engineer
TeraNex
Orlando, FL
|
|
|
|
|
Does anyone here have any experience with using either or both the Windows Media Encoder SDK and/or the Windows Media Format SDK? If so I hope you can help me answer the following question. Using these SDKs I am able to create a profile, create an encoding session, and run this session, I only have one drawback. I cannot correctly specify the audio codec in the profile. I set the WM_MEDIA_TYPE.subtype parameter to be equal to the GUID of the codec I want to use and cannot properly create a profile. But, when I compare the .prx file this profile was saved to against another .prx file that a profile created using the profile manager (with the same parameters as the profile I created using the SDKs) I have one difference in the audio setup. There is a field named codecdata in the .prx file that differs, even though I have set the same parameters in both profiles (one created with the SDKs does not match up to the one I created with the profile manager). Can anyone help me with this problem? If so I will very much appreciate it! Thanks in advance.
Roger Printy
Software Engineer
TeraNex
Orlando, FL
|
|
|
|
|
I have a static control.
In this control I want to draw a bitmap first (a compass) and afterwards I
draw the pointer (the pointer indicates which way the wind goes).
I do this in the OnPaint Function of the Class CWindrose (derived from CStatic).
This function looks like this:
void CWindrose::OnPaint()
{
DrawTransparent(...);
DrawPointer(...);
}
So everything works fine.
My problem is the flicker that appears everytime the OnPaint Function is called.
So:
How to call the bitmap to repaint just the pixels which are changed ???????
P.S.:
This is the Drawing function:
EFErr CWindrose::DrawTransparent(CDC *pDC, int x, int y, COLORREF crColour,CBitmap &Bmp)
{
COLORREF crOldBack = pDC->SetBkColor(RGB(255,255,255));
COLORREF crOldText = pDC->SetTextColor(0);
CDC dcImage, dcTrans;
// Create two memory dcs for the image and the mask
dcImage.CreateCompatibleDC(pDC);
dcTrans.CreateCompatibleDC(pDC);
// Select the image into the appropriate dc
CBitmap* pOldBitmapImage = dcImage.SelectObject(&Bmp);
// Create the mask bitmap
CBitmap bitmapTrans;
BITMAP bm1;
Bmp.GetBitmap(&bm1);
int nHeight= bm1.bmHeight;
BITMAP bm2;
Bmp.GetBitmap(&bm2);
int nWidth = bm2.bmWidth;
bitmapTrans.CreateBitmap(nWidth, nHeight, 1, 1, NULL);
// Select the mask bitmap into the appropriate dc
CBitmap* pOldBitmapTrans = dcTrans.SelectObject(&bitmapTrans);
// Build mask based on transparent colour
dcImage.SetBkColor(crColour);
dcTrans.BitBlt(0, 0, nWidth, nHeight, &dcImage, 0, 0, SRCCOPY);
// Do the work - True Mask method - cool if not actual display
pDC->BitBlt(x, y, nWidth, nHeight, &dcImage, 0, 0, SRCINVERT);
pDC->BitBlt(x, y, nWidth, nHeight, &dcTrans, 0, 0, SRCAND);
pDC->BitBlt(x, y, nWidth, nHeight, &dcImage, 0, 0, SRCINVERT);
// Restore settings
dcImage.SelectObject(pOldBitmapImage);
dcTrans.SelectObject(pOldBitmapTrans);
pDC->SetBkColor(crOldBack);
pDC->SetTextColor(crOldText);
RET_JA
}
|
|
|
|
|
you might want to take a look at CDC::GetClipRect. this will tell you the rect you need to update.
also, you might want to override OnDrawBackground, to avoid drawing the background...
-c
|
|
|
|
|
Am I right in thinking your OnPaint calls this function and passes it's DC pointer to it ? Any sort of drawing, especially the transparent drawing ( which involves three BLT's ) should be done to a buffer DC, and that DC copied to the screen in one blt. This will save you a world of hurt. Also, if you call Invalidate with a false parameter, it won't erase the background, saving you another flicker. You can override OnEraseBackground, as has been suggested, but I can't imagine it overly likely that you'll never want the erase the background ? For example, overriding it so it is never called will give you some interesting transparency effects where you can see the dialog underneath. ( before you get too excited, when you MOVE the dialog you can see where it WAS, not where it IS ).
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
hi,
this is my Win32 version you can see that I have extra CreateCompatibleBitmap and extra BitBlt.
Good luck,
Dror
void MyTransparentBlt( HDC hdcDest, int nXDest, int nYDest, int nWidth,
int nHeight, HDC hBmpDC/*, HBITMAP hBitmap*/, int nXSrc, int nYSrc,
COLORREF colorTransparent, HPALETTE hPal)
{
HDC hdcMask = ::CreateCompatibleDC( hdcDest );
HDC hdcTmp = ::CreateCompatibleDC( hdcDest );
HBITMAP bmMask = ::CreateBitmap( nWidth, nHeight, 1, 1, NULL );
HBITMAP hOldMaskBitmap = (HBITMAP)::SelectObject( hdcMask, bmMask );
HBITMAP hTmpBmp = CreateCompatibleBitmap(hdcDest, nWidth, nHeight);
HBITMAP hOldTmpBmp = (HBITMAP)::SelectObject(hdcTmp, hTmpBmp);
::BitBlt(hdcTmp, 0,0,nWidth, nHeight, hBmpDC, nXSrc, nYSrc, SRCCOPY );
::SetBkColor( hdcTmp, colorTransparent );
::SetTextColor( hBmpDC, RGB( 0, 0, 0 ) );
::BitBlt( hdcMask, 0, 0, nWidth, nHeight, hdcTmp, 0, 0, SRCCOPY );
HDC hdcOffScr = ::CreateCompatibleDC(hdcDest);
::SetBkMode(hdcOffScr, TRANSPARENT);
HBITMAP hbmOffScr = ::CreateBitmap(nWidth, nHeight,
(BYTE)GetDeviceCaps(hdcDest, PLANES),
(BYTE)GetDeviceCaps(hdcDest, BITSPIXEL),
NULL);
HBITMAP hbmOldOffScr = (HBITMAP)::SelectObject(hdcOffScr, hbmOffScr);
::BitBlt(hdcOffScr, 0, 0, nWidth, nHeight, hdcDest, nXDest, nYDest, SRCCOPY);
::SetBkColor( hBmpDC, RGB( 0, 0, 0 ) );
::SetTextColor( hBmpDC, RGB( 0xff, 0xff, 0xff ));
COLORREF crOldBackColor = ::GetBkColor( hdcDest );
COLORREF crOldTextColor = ::GetTextColor( hdcDest );
::SetBkColor( hdcOffScr, RGB( 0xff, 0xff, 0xff ) );
::SetTextColor( hdcOffScr, RGB( 0, 0, 0 ) );
::BitBlt( hdcOffScr, 0, 0, nWidth, nHeight, hBmpDC, 0, 0, SRCINVERT );
::BitBlt( hdcOffScr, 0, 0, nWidth, nHeight, hdcMask, 0, 0, SRCAND );
::BitBlt( hdcOffScr, 0, 0, nWidth, nHeight, hBmpDC, 0, 0, SRCINVERT );
::SetBkColor( hdcOffScr, crOldBackColor );
::SetTextColor( hdcOffScr, crOldTextColor );
::SetBkMode(hdcDest, TRANSPARENT);
::BitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcOffScr, 0, 0, SRCCOPY);
if ( hOldMaskBitmap )
::SelectObject( hdcMask, hOldMaskBitmap );
if ( hbmOldOffScr )
::SelectObject( hdcOffScr, hbmOldOffScr );
if ( hOldTmpBmp )
::SelectObject( hdcTmp, hOldTmpBmp );
::DeleteObject( hTmpBmp );
::DeleteObject( bmMask );
::DeleteObject( hbmOffScr );
::DeleteDC( hdcOffScr );
::DeleteDC( hdcTmp );
::DeleteDC( hdcMask );
}
|
|
|
|
|
I have a static control.
In this control I want to draw a bitmap first (a compass) and afterwards I
draw the pointer (the pointer indicates which way the wind goes).
I do this in the OnPaint Function of the Class CWindrose (derived from CStatic).
This function looks like this:
void CWindrose::OnPaint()
{
DrawTransparent(...);
DrawPointer(...);
}
So everything works fine.
My problem is the flicker that appears everytime the OnPaint Function is called.
So:
How to call the bitmap to repaint just the pixels which are changed ???????
P.S.:
This is the Drawing function:
EFErr CWindrose::DrawTransparent(CDC *pDC, int x, int y, COLORREF crColour,CBitmap &Bmp)
{
COLORREF crOldBack = pDC->SetBkColor(RGB(255,255,255));
COLORREF crOldText = pDC->SetTextColor(0);
CDC dcImage, dcTrans;
// Create two memory dcs for the image and the mask
dcImage.CreateCompatibleDC(pDC);
dcTrans.CreateCompatibleDC(pDC);
// Select the image into the appropriate dc
CBitmap* pOldBitmapImage = dcImage.SelectObject(&Bmp);
// Create the mask bitmap
CBitmap bitmapTrans;
BITMAP bm1;
Bmp.GetBitmap(&bm1);
int nHeight= bm1.bmHeight;
BITMAP bm2;
Bmp.GetBitmap(&bm2);
int nWidth = bm2.bmWidth;
bitmapTrans.CreateBitmap(nWidth, nHeight, 1, 1, NULL);
// Select the mask bitmap into the appropriate dc
CBitmap* pOldBitmapTrans = dcTrans.SelectObject(&bitmapTrans);
// Build mask based on transparent colour
dcImage.SetBkColor(crColour);
dcTrans.BitBlt(0, 0, nWidth, nHeight, &dcImage, 0, 0, SRCCOPY);
// Do the work - True Mask method - cool if not actual display
pDC->BitBlt(x, y, nWidth, nHeight, &dcImage, 0, 0, SRCINVERT);
pDC->BitBlt(x, y, nWidth, nHeight, &dcTrans, 0, 0, SRCAND);
pDC->BitBlt(x, y, nWidth, nHeight, &dcImage, 0, 0, SRCINVERT);
// Restore settings
dcImage.SelectObject(pOldBitmapImage);
dcTrans.SelectObject(pOldBitmapTrans);
pDC->SetBkColor(crOldBack);
pDC->SetTextColor(crOldText);
RET_JA
}
|
|
|
|
|
Hi all,
I currently working on a project where i need to embed at font in a
program, in the resource. The font must not be installed on the
system where the program runs, but only be available to the program when
the program runs.
My question how do i include a font (a true type font) in the resource,
and also how do i load it ? Can it be done ? Or is there another way
of doing this ??
Thanks,
Bo Helleskov/Denmak.
|
|
|
|
|
Did you ever get this working?
Cheers,
swine
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
How can I create a DC that is incompatible with the display?
Actually, what I really want to do is to always create and
work with 24-Bit images whatever the setting of my display
is. So, if I my monitor is set at 32-Bits. I'd still be
creating 24-bit images.
Right now, I create a DC that is compatible with the display.
Thus, the bitmaps are different depending on the display
properties.
eipangan
|
|
|
|
|
|
Hi, anybody who knows how to get / calculate the cpu-usage in % like the taskmanager of
Win 2000 does ?
Greatings Mario ///
--------------------
www.klangwerker.de
rocknix@lycos.de
--------------------
|
|
|
|
|
Look at the PERFMON example included with the MSDN
|
|
|
|
|
|
I have a problem.
I have a dialog box and in this dialog box there is a button. If I click this button it will open a new dialog box.
This new dialog box has a progress bar. My problem is, how can I trigger this new dialog box so that the progress bar will work after the dialog box is shown (without any using of other control ie: button, radio button or what ever). I try most of the ( WM_ ) message handler but I still can't found it.
|
|
|
|
|
Check out the doccumentation on CProgressCtrl, specifically: SetRange32, SetStep and StepIt.
|
|
|
|
|
Hi,
thanks for reading this. I'm working on a project where I have a large amount of structured data to manage. Similar to file directories. I've got a root folder, subfolders and eventually documents.
How do I deal with it in my program in a manner, that allows effectivly saving the data to a file (or multiple files?). Imagine me writing an application that stores the entire folder/file structure of a given disk. Each item (disk, folder, file) has it's own properties which have to be stored as well.
Any tips and links greatly appreceated.
Matthias
|
|
|
|
|
here is the question:
input: a directory name
output: All the files in that directory AND its sub-directories.
(in C/C++)
|
|
|
|
|
Take a look at the help in the MSDN of the functions related to this of the listboxes and comboboxes:
>> Dir and DlgDirList
You'll see that this is very easy.
PD. I think it can be done with a treeCtrl too.
(at last I must advice you that I'm just a begginer that some time ago had the same problem, it worked for me, but it can not-be the best solution)
|
|
|
|
|
I don't know how you would do it using the standard C library, but in Win32 use FindFirstFile and FindNextFile in a recursive function
|
|
|
|
|