Author Topic: TabCtrl.inc  (Read 3499 times)

HSE

  • Member
  • *****
  • Posts: 2499
  • AMD 7-32 / i3 10-64
TabCtrl.inc
« 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:
Code: [Select]
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
Equations in Assembly: SmplMath

Biterider

  • Moderator
  • Member
  • *****
  • Posts: 1083
  • ObjAsm Developer
    • ObjAsm
Re: TabCtrl.inc
« Reply #1 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

HSE

  • Member
  • *****
  • Posts: 2499
  • AMD 7-32 / i3 10-64
Re: TabCtrl.inc
« Reply #2 on: June 27, 2017, 09:01:02 PM »
Perfect  :t

Thanks!
Equations in Assembly: SmplMath