Virtual screen creation in Windows?

new topic     » topic index » view thread      » older message » newer message

HELP,

Hey All

I hoped someone might give me a pointer to why "memdc" who is assigned a value
in
WM_CREATE has no ID in WM_PAINT ?

global function WndProc(atom hwnd, atom iMsg, atom wParam, atom lParam)
    atom hdc
    atom memdc
    atom hbit
    atom ps
    atom rect
    object junk
    integer hbrush

    ps = allocate(64)
    rect = allocate(16)
    if iMsg = WM_CREATE then
        hdc = c_func(xGetDC, {hwnd})
        memdc = c_func(xCreateCompatibleDC, {hdc})
        hbit = c_func(xCreateCompatibleBitmap, {hdc, xScreen, yScreen})
        if not c_func(xSelectObject,{memdc, hbit}) then end if
        hbrush = (ps)
        if not c_func(GetStockObject, {WHITE_BRUSH}) then end if
        if not c_func(xSelectObject, {memdc, hbrush} ) then end if
        if not c_func(xPatBlt, {memdc, 0, 0, xScreen, yScreen, PATCOPY}) then
end if
        if not c_func(xRectangle, {memdc, 10, 10, 100, 100}) then end if
        c_proc(xReleaseDC, {hwnd, hdc})
        junk = c_func(xInvalidateRect, {hwnd, NULL, 0})
 return 0
    elsif iMsg = WM_PAINT then
          hdc = c_func(BeginPaint, {hwnd, ps})
         if not c_func(xBitBlt, {hdc, 0, 0, xScreen, yScreen, memdc, 0, 0,
SRCCOPY}) then end if
         c_proc(EndPaint, {hwnd, ps})
 return 0

As always thanks in advance.

Euman

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu