The MASM Forum

Projects => ObjAsm => Topic started by: HSE on June 27, 2017, 09:21:29 AM

Title: TabCtrl.inc
Post by: HSE on June 27, 2017, 09:21:29 AM
Hi Biterider!

The TabControl in the package make other buttons invisibles.

The solution was to create an specific window like parent of TabCtrl   :eusa_boohoo:

After some time fighting to remove the interference of tab controls with siblings buttons (the same parent) the solution is incredible short:Method TabIptor.OnNotify, uses ebx, wParam:WPARAM, lParam:LPARAM
    local TCI:TC_ITEM
   
    SetObject esi
    mov ebx, lParam
    .if [ebx].NMHDR.code == TCN_SELCHANGING       ;Hide current window
      mov TCI.imask, TCIF_PARAM
      invoke SendMessage, [ebx].NMHDR.hwndFrom, TCM_GETCURSEL, 0, 0
      lea ecx, TCI
      invoke SendMessage, [ebx].NMHDR.hwndFrom, TCM_GETITEM, eax, ecx
      invoke ShowWindow, TCI.lParam, SW_HIDE
      xor eax, eax                                ;Allow the selection to change   eax = FALSE
    .elseif [ebx].NMHDR.code == TCN_SELCHANGE     ;Show new window
      mov TCI.imask, TCIF_PARAM
      invoke SendMessage, [ebx].NMHDR.hwndFrom, TCM_GETCURSEL, 0, 0
      lea ecx, TCI
      invoke SendMessage, [ebx].NMHDR.hwndFrom, TCM_GETITEM, eax, ecx
      invoke ShowWindow, TCI.lParam, SW_SHOWDEFAULT
    .endif
mov eax, 0                                   <-------------- Just this line -------------------<
MethodEnd



Regards. HSE
Title: Re: TabCtrl.inc
Post by: Biterider on June 27, 2017, 03:39:29 PM
Hi HSE
I think it issue can be the remaining notifications that fall through the if/elseif conditions.
If you have the muse, please try something like:

else
   xor eax, eax
endif

Biterider
Title: Re: TabCtrl.inc
Post by: HSE on June 27, 2017, 09:01:02 PM
Perfect  :t

Thanks!