News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

BegingPaint to GetDC - Problems

Started by RHL, April 20, 2012, 09:10:51 PM

Previous topic - Next topic

RHL

hey! , it worked :D  :red
I do not know, but now work yes! dave,  surely was the bitmap ID :S
im sorry guys, my bad!! fuk! sorry :S but is rare...


.ELSEIF uMsg==WM_COMMAND
;invoke BeginPaint,hstatic,addr PS
invoke GetDC,hstatic
mov hdc1,eax
invoke CreateCompatibleDC,hdc1
mov hdc2,eax
invoke CreateCompatibleDC,hdc1
mov hdc3,eax

invoke SelectObject,hdc2,hBITMAP
mov hBmpOrg2,eax
invoke  CreateCompatibleBitmap,hdc1,64,64
       invoke  SelectObject,hdc3,eax
mov     hBmpOrg3,eax                           ;save the original handle from hdc3
invoke  BitBlt,hdc3,0,0,64,64,hdc2,0,0,SRCCOPY ;i try copy to temporary....
       invoke  BitBlt,hdc1,0,0,30,30,hdc3,0,0,SRCCOPY ;now, copy to static control
       invoke  SelectObject,hdc3,hBmpOrg3
       invoke  DeleteObject,eax
       invoke  SelectObject,hdc2,hBmpOrg2
       invoke  DeleteObject,eax
      invoke  DeleteDC,hdc3
      invoke  DeleteDC,hdc2
      invoke  ReleaseDC,hstatic,hdc1
  xor eax,eax
  ret


thanks all, for your time :bg, jochen ,sorry, you had reason, should have copied all the code

dedndave

try putting another window in front of it, then moving it away   :P

jj2007

Quote from: dedndave on April 22, 2012, 01:16:42 AM
try putting another window in front of it, then moving it away   :P

WM_PAINT does not trigger the redraw, you have to click again. It's by design (but RHL may change design soon, I guess)

Greetz to Z,
J

dedndave

Z sends a K, Jochen   :P

yah - it's hard for him to read all that painting and drawing documentation
even so - it's a lot to absorb if you speak English - lol
then - you have to play around with it before it really sinks in

at the moment, i am working on some image display code that Keith wanted to play with
it takes a lot of careful examination to see when scroll bars etc are updated
i just learned that status bar borders don't seem to work with xp theme/common controls 6
if i disable the manifest, i get exactly what i asked for - no xp theme, of course
and another one that apparently never did work - TBS_DOWNISLEFT
point being - reading the documentation is not always enough