On my dialogbox I want to create a round red window like a red LED. This code is my attempt to do that.

invoke CreateWindowEx,0,addr szStatic,0,WS_CHILD or WS_BORDER or SS_CENTER,\
mov hLED,eax
invoke LoadBitmap,hInstance,20001
invoke SendMessage,hLED,BM_SETIMAGE,IMAGE_BITMAP,eax
invoke CreateRectRgn,100,100,116,116
invoke SetWindowRgn,hWin,eax,TRUE

The result is a grey square (image size) without the dialogbox. Can somebody enlighten my how to create the red dot.


If I change "CreateRectRgn" to "CreateEllipticRgn" a grey circular dot without the dialogbox is created.

These changes creates a red square dot on the dialog. Not a round one. How do I do?

invoke CreateWindowEx,WS_EX_TOPMOST,addr szStatic,0,WS_CHILD,\
mov hLED,eax
invoke CreateSolidBrush,000000FFh
mov hBr,eax
invoke CreateEllipticRgn,100,100,116,116
invoke SetWindowRgn,hLED,eax,TRUE
invoke ShowWindow,hLED,SW_SHOW
mov eax,lParam
.if eax==hLED
invoke SetBkMode,wParam,TRANSPARENT
mov eax,hBr
Posted on 2003-05-19 04:13:03 by minor28
Is there no one who knows how to create a round red window? The "CreateEllipticRgn" has no effect on the child window. Why?
Posted on 2003-05-20 01:15:00 by minor28
Have you looked at This Thread yet?

Posted on 2003-05-20 22:33:18 by NaN
hmm...so u want the LED as a lil thing in ur dialogbox?

the way u would do it is, u create an owner drawn child window, and then respond to those messages, this will let u draw it as a lil red dot, and u can also make it respond to mouse clicks and such, for instance make it change size or color
Posted on 2003-05-22 00:59:32 by AnotherWay83
Just another idea, i've done it with just two icon on the resource file, you change led RED to GREEN just enabling/disabling the red/green one.

Posted on 2003-05-22 05:52:28 by Bit7

I will work on the problem and see what I can do. I have looked at "This Thread yet?" and some other threads. All of them are so complecated. It must be a more simplier way to get a round red/green child window. I have succeeded to draw a round red/green window but not a round child window as I want.

Posted on 2003-05-22 15:46:29 by minor28