hi,
I was trying to resize the toolbar in the child window,
but it seem doesn't work,
I tried use GetWindowRect under the WM_SIZE msg,,
but return failed
short source below, or have a look at the full source I have attached
please help me!
thankx in adv,
LOCAL r:RECT
LOCAL hChildToolBar1:DWORD
.........
.elseif uMsg==WM_CREATE
invoke CreateWindowEx, 0, addr szToolbarClassName, 0,\
WS_CHILD or WS_VISIBLE or TBSTYLE_TOOLTIPS or CCS_NOPARENTALIGN or\
CCS_NORESIZE or WS_BORDER or TBSTYLE_FLAT,\
0, -1, 1200, 46, hWnd, 0, hInstance, 0
mov hChildToolBar1, eax
.elseif uMsg==WM_SIZE
;invoke MessageBox,hWnd,addr ClosePromptMessage,addr AppName,MB_OK
this function doesn't work
invoke GetWindowRect, hChildToolBar1, addr r
.if eax==1
invoke MessageBox,hWnd,addr ClosePromptMessage,addr AppName,MB_OK
.endif
.........
I was trying to resize the toolbar in the child window,
but it seem doesn't work,
I tried use GetWindowRect under the WM_SIZE msg,,
but return failed
short source below, or have a look at the full source I have attached
please help me!
thankx in adv,
LOCAL r:RECT
LOCAL hChildToolBar1:DWORD
.........
.elseif uMsg==WM_CREATE
invoke CreateWindowEx, 0, addr szToolbarClassName, 0,\
WS_CHILD or WS_VISIBLE or TBSTYLE_TOOLTIPS or CCS_NOPARENTALIGN or\
CCS_NORESIZE or WS_BORDER or TBSTYLE_FLAT,\
0, -1, 1200, 46, hWnd, 0, hInstance, 0
mov hChildToolBar1, eax
.elseif uMsg==WM_SIZE
;invoke MessageBox,hWnd,addr ClosePromptMessage,addr AppName,MB_OK
this function doesn't work
invoke GetWindowRect, hChildToolBar1, addr r
.if eax==1
invoke MessageBox,hWnd,addr ClosePromptMessage,addr AppName,MB_OK
.endif
.........
hChildToolbar1 is local. Once you finished processing WM_CREATE and hit the ret, its value is no longer valid (for subsequent calls to the function).
This is tantemount to forgetting the "static" keyword in C, except there is no static keyword in assembler... Make it a global.
Mirno
This is tantemount to forgetting the "static" keyword in C, except there is no static keyword in assembler... Make it a global.
Mirno
:stupid:
thankx Mirno!:alright:
thankx Mirno!:alright:
hi,
since the handles are in the child window,
if I create more few child windows,,
how can I manage the handles in each child window locally or globaly???
the only thing comes into my mine is create a array of dynamic mem and save the handles in there,,
but this way cause extra works..
is there other ways???
thankx in adv,,,
since the handles are in the child window,
if I create more few child windows,,
how can I manage the handles in each child window locally or globaly???
the only thing comes into my mine is create a array of dynamic mem and save the handles in there,,
but this way cause extra works..
is there other ways???
thankx in adv,,,
most common way is to allocate one large structure for each child window. This struc can hold all data regarding this child window.
Alloc it during WM_CREATE and attach the pointer to the window with SetWindowLong (hwndChild, GWL_USERDATA, lpStruc).
Now you can get it back inside each message with lpStruc = GetWindowLong (hwndChild, GWL_USERDATA).
(Dont forget to free the struc inside WM_DESTROY).
typical child struct:
CHILD_DATA struc
hwndToolbar dd ?
hwndText dd ?
dwWidth dd ?
dwHeight dd ?
....
CHILD_DATA ends
Alloc it during WM_CREATE and attach the pointer to the window with SetWindowLong (hwndChild, GWL_USERDATA, lpStruc).
Now you can get it back inside each message with lpStruc = GetWindowLong (hwndChild, GWL_USERDATA).
(Dont forget to free the struc inside WM_DESTROY).
typical child struct:
CHILD_DATA struc
hwndToolbar dd ?
hwndText dd ?
dwWidth dd ?
dwHeight dd ?
....
CHILD_DATA ends
thankx beaster,
I will give it a try!
:alright:
I will give it a try!
:alright:
hi beaster,
I got another post of the same questions in another thread,
here,
I got stuck,
I follow exact what u show me,
but not work
here is
thankx in adv,thread
I got another post of the same questions in another thread,
here,
I got stuck,
I follow exact what u show me,
but not work
here is
thankx in adv,thread