News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Graphic Static

Started by digelo, January 20, 2013, 01:23:58 AM

Previous topic - Next topic

jj2007

Messages = child
Messages MAIN = parent

Messages MAIN
chg:msgCount    132
uMsg            16
# debChgMsg #   WM_SYSCOMMAND <<<< the click in the upper right corner

Messages MAIN
chg:msgCount    133
uMsg            70
# debChgMsg #   WM_CLOSE

...
Messages
chg:msgCount    140
uMsg            641
# debChgMsg #   WM_KILLFOCUS

...
Messages
chg:msgCount    144
uMsg            130
# debChgMsg #   WM_DESTROY

Messages MAIN
chg:msgCount    145
uMsg            130
# debChgMsg #   WM_DESTROY

dedndave

well - the destroy operation is not quite automatic for WM_CLOSE

when a window receives a WM_CLOSE message, the default processing is to call DestroyWindow
if the WndProc for that window processes the WM_CLOSE message without calling DefWindowProc,
and without calling DestroyWindow, then it may not be destroyed
this gives the coder an opportunity to offer an "ok to close" message box or something similar

WM_CLOSE is sent to "ask" a window to shut down
WM_DESTROY is sent to tell a window it is being destroyed
when WM_DESTROY is sent, the window has already been removed from the screen
but - WndProc is obviously still handling this one message

xandaz

   thanks... been away for a while. Thanks for the replies. Yeah beacause i was getting errors. But i used HeapAllocs and there was no need for freeing.

jj2007

Quote from: xandaz on February 04, 2013, 10:51:35 AMBut i used HeapAllocs and there was no need for freeing.

Even Microsoft believes that ExitProcess does that job. My practical experience is that if a proggie that made a huge HeapAlloc crashes, the system can become so slow that you are forced to reboot. Remember that HeapAlloc passes huge requests on to VirtualAlloc.

xandaz

   well jj... i haven't experienced anything of the sort but it's useful information. thanks

xandaz

   well , my brothers and sisters. After having made that counter i tried to make the as if it could be reused several times in different controls but it doesn't seem to work. only the first two are visible and the second misses the titlles and the other two, well.... the windows were created but i can't see them.

dedndave

            invoke  CreateWindowEx,WS_EX_STATICEDGE,addr CounterClass,addr ci,WS_VISIBLE+WS_CHILD+WS_CLIPSIBLINGS,\
                        0,0,rect.right,rect.bottom,hWnd,0,hInstance,0
            mov     hCounter1,eax
            invoke  CreateWindowEx,WS_EX_STATICEDGE,addr CounterClass,addr ci2,WS_VISIBLE+WS_CHILD+WS_CLIPSIBLINGS,\
                        rect.right,0,rect.right,rect.bottom,hWnd,0,hInstance,0
            mov     hCounter2,eax
            invoke  CreateWindowEx,WS_EX_CLIENTEDGE,addr CounterClass,addr ci3,WS_VISIBLE+WS_CHILD+WS_CLIPSIBLINGS,\
                         rect.right,rect.bottom,rect.right,rect.bottom,hWnd,0,hInstance,0
            mov     hCounter3,eax
            invoke  CreateWindowEx,WS_EX_CLIENTEDGE,addr CounterClass,addr ci4,WS_VISIBLE+WS_CHILD+WS_CLIPSIBLINGS,\
                       0,rect.bottom,rect.right,rect.bottom,hWnd,0,hInstance,0
            mov     hCounter4,eax


1) i think you intend the first 2 to use StaticClass
2) notice the positions x,y,width,height - some of them are outside the main client
the first one fills the client area   :P
3) i think it's a good idea to assign unique control identifiers for child windows (hMenu parm)

for testing, just put constants in there for position and size - then put some vars when you have it working

xandaz

    sure thing dave. it was just a rough example...