The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Chambao on July 16, 2005, 09:04:05 PM

Title: tabcontrol problem, child window disappears
Post by: Chambao on July 16, 2005, 09:04:05 PM
hi people

I am using resource files, and I am having some problems with a tabcontrol and its child window.
when I change the tab's caption using TCM_SETITEM the child window disappears.
this is part of my code.

;-- WM_INITDIALOG
;-- insertar el primer tab
mov tab.imask, TCIF_TEXT
mov tab.pszText, offset szMessage
mov tab.cchTextMax, sizeof szMessage
call SendDlgItemMessage, handle, ID_TABCONTROL, TCM_INSERTITEM, 0, addr tab

;-- crear dlg del primer tab
call GetDlgItem, handle, ID_TABCONTROL
mov hTabControl, eax
call CreateDialogParam, lparam, ID_DLGTAB, eax, offset TabWndProc, 0
mov hTabWnd, eax


I change it this way

mov tab.imask, TCIF_TEXT
mov tab.pszText, esi ; esi points to new caption
call SendDlgItemMessage, hMainWnd, ID_TABCONTROL, TCM_SETITEM, 0, addr tab



thank you.
Title: Re: tabcontrol problem, child window disappears
Post by: Chambao on July 17, 2005, 09:36:39 AM
This is an Example I downloaded from RadAsm webpage.
when I change a Tab's caption its child window disappears, and i dont know how to fix it.
here is the source code.


[attachment deleted by admin]
Title: Re: tabcontrol problem, child window disappears
Post by: diablo2oo2 on July 17, 2005, 05:57:02 PM
use this code to create a tab window:

invoke GetModuleHandle,0
invoke CreateDialogParam,eax,ID_DLGTAB,handle,offset TabWndProc,0 ;handle= Handle of Parent Window
mov hTabWnd, eax


you can try this to show the window again after you changed the caption:

invoke ShowWindow,hTabWnd,SW_SHOW
Title: Re: tabcontrol problem, child window disappears
Post by: Chambao on July 22, 2005, 04:46:46 PM
I tried it before but it didn't work
someone told me about InvalidateRect and it worked  :U
thank you
Title: Re: tabcontrol problem, child window disappears
Post by: Bros on December 30, 2006, 09:58:29 PM
Hello

I think that

invoke UpdateWindow,hTabWnd

should also work....