F
fasecero
Guest
I am looking for someone very knowledgeable in win32 for this question. To make a transparent listview we can use the following message
SendMessage(hwndLV, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_TRANSPARENTBKGND, LVS_EX_TRANSPARENTBKGND);
this causes the listview background to be drawn in the WM_PRINTCLIENT message of the listview parent window
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_PRINTCLIENT:
{
HDC hDC = wParam;
// we can draw the listview background here using the device context hDC
// for example using GDI
// ...
// ...
return 1;
}
break;
}
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
This makes very easy to draw an image on the HDC. But my intention is to put behind the listview a VIDEO.
But unfortunately everything that has to do with video files requires as parameter a window handle (HWND) instead of a device context.
For example, I was studying windows 7 sdk and I found this fact again and again. In MEDIA FUNDATION, for instance, a video can be displayed in a window using MFPCreateMediaPlayer, which ask for an HWND parameter instead of an HDC. The same goes for all the directshow examples, they always ask for an HWND instead of an HDC.
My question is, then, is there any way to draw a video on an HDC? Please I really need this.
Continue reading...
SendMessage(hwndLV, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_TRANSPARENTBKGND, LVS_EX_TRANSPARENTBKGND);
this causes the listview background to be drawn in the WM_PRINTCLIENT message of the listview parent window
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_PRINTCLIENT:
{
HDC hDC = wParam;
// we can draw the listview background here using the device context hDC
// for example using GDI
// ...
// ...
return 1;
}
break;
}
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
This makes very easy to draw an image on the HDC. But my intention is to put behind the listview a VIDEO.
But unfortunately everything that has to do with video files requires as parameter a window handle (HWND) instead of a device context.
For example, I was studying windows 7 sdk and I found this fact again and again. In MEDIA FUNDATION, for instance, a video can be displayed in a window using MFPCreateMediaPlayer, which ask for an HWND parameter instead of an HDC. The same goes for all the directshow examples, they always ask for an HWND instead of an HDC.
My question is, then, is there any way to draw a video on an HDC? Please I really need this.
Continue reading...