The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: xandaz on March 14, 2010, 11:04:28 AM

Title: How to make an unsquare window?
Post by: xandaz on March 14, 2010, 11:04:28 AM
   Hey guys. i was trying to create an unsquare window but it didn't work out. i did sometihng like this :

        .elseif uMsg==WM_CREATE
               
                mov     edi,lParam
                assume  edi:PTR CREATESTRUCT

                .if     [edi].hWndParent==NULL
                        invoke  GetWindowRect,hWnd,addr rect
                        invoke  CreateEllipticRgnIndirect,addr rect
                        mov     hRgn1,eax
                        invoke  CreateRectRgnIndirect,addr rect
                        mov     hRgn2,eax
                        invoke  CombineRgn,hRgn1,hRgn2,hRgn1,RGN_DIFF
                       
                .endif
       
        .elseif uMsg==WM_PAINT
               
                invoke  BeginPaint,hWnd,addr ps
                invoke  SelectClipRgn,ps.hdc,hRgn1
                invoke  CreateSolidBrush,0ff0000h
                invoke  SelectObject,ps.hdc,eax
                invoke  PaintRgn,ps.hdc,eax
                invoke  EndPaint,hWnd,addr ps
       
Can someone explain this for me?
thanks once more and laterz
Title: Re: How to make an unsquare window?
Post by: Vortex on March 14, 2010, 11:07:52 AM
Custom windows shape by mob :

\masm32\examples\exampl06\mob\cws
Title: Re: How to make an unsquare window?
Post by: xandaz on March 14, 2010, 03:25:02 PM
   Thanks a lot Vortex. I'm checking it out.
   Ty and bye
Title: Re: How to make an unsquare window?
Post by: Bill Cravener on March 16, 2010, 11:12:38 AM
Custom window with rounded corners example using a bitmap.

Custom Window Example (http://www.quickersoft.com/examples/PasteIt.zip)
Title: Re: How to make an unsquare window?
Post by: xandaz on March 29, 2010, 10:01:22 PM
   Thanks a lot Bill. It's easier than i thought. I just used SetWindowRgn, and it seems to work dor any region or combined regions.
   Ty guys you're the best. Hopefully someday i'll know enough to be able to retribute the kindness you've shown me.
   Best regards from X :)
Title: Re: How to make an unsquare window?
Post by: xandaz on March 29, 2010, 10:07:02 PM
   Nice looking window btw Bill. :)
   Bye :)
Title: Re: How to make an unsquare window?
Post by: Bill Cravener on March 29, 2010, 11:16:39 PM
Thanks xandaz,

Really its not that difficult at all to achieve what you what to do in Windows. Get the Windows SDK. Determine what is is you wish to accomplish. Search the SDK and read, read, read. You'll soon find its right there in front of you.

To me reading the Windows SDK is like reading a good sex novel only it ain't fiction buddy, and like a good sex novel you get great gratification out of it. :bg