Im using a static control to display a bitmap, I use WM_CREATE to create the controls and make the region... I set the rgn to the window but the bitmap is drawn onto the window going past the set rgn. I used move window and it move the rgn with the bitmap in that region attached to it, but the bitmap part not in the region stays... Is there a way to stop the bitmap from being drawn outside the regioned window? (I use SendMessage with the control handle and use SETBITMAP to set the bitmap)
Posted on 2000-12-02 19:55:00 by plu
Ahoy, because nobody answers ... ;================================================================ ; WM_CREATE (value=01h) message received ? ;---------------------------------------------------------------- WP1_uMsg_01h: cmp eax,1h ;WM_CREATE message recieved jne WP1_uMsg_02h ;if not skip mov eax,WP1_hWnd ;store handle main window mov handleWindow,eax ; ;---------------------------------------------------------------- ; API "CreateWindowExA" with a predefined class name (STATIC). ; The return value in EAX is the handle of the new window. ;---------------------------------------------------------------- push 0h ;lpParam, extra pointer data push hInstance ;hInstance, handle program push 700h ;hMenu, the child-window ID push WP1_hWnd ;hWndParent, parent window push 44h ;intnHeight, window height push 44h ;intnWidth, window width push STATIC_yPos ;inty, vertical position push STATIC_xPos ;intx, horizontal position push 5400000Eh ;dwStyle,static window style ;WS_CHILD = 40000000h ;WS_VISIBLE = 10000000h ;WS_CLIBSIBLINGS= 4000000h ;SS_BITMAP = 0Eh push OFFSET STATIC_Name ;lpWindowName, window name push OFFSET STATIC_Class ;lpClassName, class name push 0h ;dwExStyle,look in WIN32.HLP call CreateWindowExA ;- API Function - mov handleSTATIC1,eax ;hwnd, handle of window ;---------------------------------------------------------------- ; API "CreateEllipticRgn" creates an elliptical region. ;---------------------------------------------------------------- push 42h ;y-coordinate push 42h ;x-coordinate push 2h ;y-coordinate upper-left push 2h ;x-coordinate upper-left call CreateEllipticRgn ;- API Function - mov handleRegion1,eax ;handle of region ;---------------------------------------------------------------- ; "SetWindowRgn" assigns the region defined above to a window. ;---------------------------------------------------------------- push 1h ;bRedraw, window redraw flag push handleRegion1 ;hRgn, handle to region push handleSTATIC1 ;hWnd, handle of window call SetWindowRgn ;- API Function - Now you can move the static window via: ;---------------------------------------------------------------- ; API "MoveWindow" changes the pos and dim of the STATIC window. ; I assign a region to the STATIC window handle on WM_CREATE. ;---------------------------------------------------------------- push 01h ;bRepaint, repaint flag push 44h ;nHeight, height push 44h ;nWidth, width push STATIC_yPos ;Y, vertical position push STATIC_xPos ;X, horizontal position push handleSTATIC1 ;hWnd, handle of window call MoveWindow ;- API Function - ;---------------------------------------------------------------- ; API "UpdateWindow" updates the area of the specified window. ; WM_PAINT message is send ;---------------------------------------------------------------- push handleWindow ;hwnd, handle of window call UpdateWindow ;- API Function - This will work if I make no mistake while cut and paste this msg. so long Test
Posted on 2000-12-04 07:59:00 by Test Department
I got all that... I just need to keep the bitmap from being painted outside the regioned window, the regioned windows parent window is the application window (hWnd) the regioned windows name is hPic1. It paints the bitmap to the window, how can I paint it to the region?
Posted on 2000-12-04 18:21:00 by plu