I found previous messages posted as "windows layer storage/transmission" where
the idea was to keep an image of each window instead of the whole screen,
improving switching between windows, etc.
Doing so would also be great for another reason: transparent (also known as
"layered") windows are not supported by the current version of VNC for
windows. Such windows simply don't appear on the VNC viewer but the mouse and
keyboard events are correctly sent.
It is unfortunate because capturing the image of a layered window is easy:
GetWindowDC(hWnd) and then blit somewhere in a bitmap in memory.
Furthermore, Windows keeps the whole (unclipped) content of these layered
windows in memory, meaning that you get the whole image of the window, even if
clipped by other windows or even if this window is completely off screen.
This means that:
- supporting layered windows should be easy on the server side (Of course,
implementing the layered effects on the VNC client would require implementing
transparency between the received images.)
- it would be easy to implement the ideas mentioned in the thread "windows
layer storage/transmission", having each window image
It is easy to set an existing window as a layered window:
#define WS_EX_LAYERED           0x00080000
typedef BOOL (WINAPI *lpfnSetLayeredWindowAttributes)(HWND hWnd, COLORREF
cr,BYTE bAlpha, DWORD dwFlags);
lpfnSetLayeredWindowAttributes m_pSetLayeredWindowAttributes;
HMODULE hUser32 = GetModuleHandle(_T("USER32.DLL"));
m_pSetLayeredWindowAttributes =
(lpfnSetLayeredWindowAttributes)GetProcAddress(hUser32,
"SetLayeredWindowAttributes");
SetWindowLong(hWnd,GWL_EXSTYLE, m_hooked_style | WS_EX_LAYERED);
m_pSetLayeredWindowAttributes(hWnd,RGB(0,0,0),128,1);
On Windows XP machines, you can also use the new PrintWindow API to get the
unclipped content of a window. This function is interesting because you don't
have to make the windows "layered" (which somewhat decreases the performance
of the server machine). On the other hand, layered windows will receive all
WM_PAINT events even when the layered window is underneath other windows. I am
not sure this is the case with normal windows...
Laurent.
---------------------------------------------------------------------
To unsubscribe, mail [EMAIL PROTECTED] with the line:
'unsubscribe vnc-list' in the message BODY
See also: http://www.uk.research.att.com/vnc/intouch.html
---------------------------------------------------------------------


Reply via email to