Note that there are some explanatory texts on larger screens.

plurals
  1. POMy code which uses UpdateLayeredWindow doesn't work
    primarykey
    data
    text
    <p>I attampted to draw a irregular window with the UpdateLayeredWindow(), in msvc2008, xp sp3.<br> Here is part of my code:</p> <pre><code>//Add something(CreateWindowEx()): hwndCyauWnd = CreateWindowEx( /*WS_EX_TOOLWINDOW |*/ WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_LAYERED, lpwsCyauClassName, lpwsCyauWndName, WS_CLIPSIBLINGS | WS_POPUP, GetSystemMetrics(SM_CXSCREEN)-320, GetSystemMetrics(SM_CYSCREEN)-232, 320, 200, NULL, NULL, hInstance, NULL); //Skip Lines HDC hdcCyauWnd = GetDC(hwndCyauWnd); HDC hdcBuffer = CreateCompatibleDC(hdcCyauWnd); //HBITMAP hbmCyau = CreateCompatibleBitmap(hdcBuffer,120, 93); //SelectObject(hdcBuffer, hbmCyau); POINT ptZero = {0, 0}; POINT ptDrawPos = {0, 0}; RECT rctCyauWnd; GetWindowRect(hwndCyauWnd, &amp;rctCyauWnd); SIZE szCyauWnd={rctCyauWnd.right - rctCyauWnd.left, rctCyauWnd.bottom - rctCyauWnd.top}; BLENDFUNCTION blendPixelFunction = { AC_SRC_OVER, 0, 100, AC_SRC_ALPHA}; Graphics gphCyauWnd(hdcBuffer); Image imgCyau(L"surface0000.png"); gphCyauWnd.DrawImage(&amp;imgCyau, 0, 0, 125, 93); UpdateLayeredWindow(hwndCyauWnd, hdcCyauWnd, &amp;ptZero, &amp;szCyauWnd, hdcBuffer, &amp;ptZero, 0, //RGB(255, 255, 255), &amp;blendPixelFunction, ULW_ALPHA); while (GetMessage(&amp;msg, NULL, 0, 0)) { TranslateMessage(&amp;msg); DispatchMessage(&amp;msg); } return msg.wParam; </code></pre> <p>I have tried several method to use this function, but all failed, NOTHING APPEAR on the screen.<br> Could anybody tell me what happens and how to slove it? </p> <p>Add:<br> Whole source file have been upload to <a href="https://skydrive.live.com/redir.aspx?cid=ad741b27120b92fd&amp;resid=AD741B27120B92FD!195&amp;parid=AD741B27120B92FD!160&amp;authkey=!AK-l6sOqayj5Q_A" rel="nofollow">my skydrive</a>, anyone can edit, much appreciation! (I have become a poor underdog now...)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload