News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

TVN_SELCHANGED doesn't work using DialogBoxParamW

Started by ramguru, December 02, 2005, 10:36:11 PM

Previous topic - Next topic

ramguru

Hi guys
I don't understand what I'm doing wrong or what is missing. The problem is that using DialogBoxParam, this code suppose to and really works OK, but when I put W (want unicode support) at the end it doesn't work at all, meaning TVN_SELCHANGED never occurs ... why ???

m2m    hInstance, FUNC(GetModuleHandle, 0)
invoke InitCommonControls
invoke DialogBoxParamW, hInstance, 1000, 0, ADDR DlgProc, 0
invoke ExitProcess, 0
DlgProc proc hWin:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD
mov    eax, uMsg
...
.elseif eax==WM_NOTIFY
mov eax, wParam
.if eax==1001
mov ebx, lParam
mov eax, (NMTREEVIEW ptr [ebx]).hdr.code
.if eax==TVN_SELCHANGED
mov eax, (NMTREEVIEW ptr [ebx]).itemNew.lParam
mov l_param, eax
mov eax, (NMTREEVIEW ptr [ebx]).itemNew.hItem
mov new_item, eax
mov tvi._mask, TVIF_PARAM
invoke MessageBox, 0, 0, 0, MB_OK ; This is how I check if event occurs
...
DlgProc endp

Igor

I know that this is very old thread but i had the same problem and found solution by pure coincidence. Hopefully this will be useful to someone.

There is a different message for unicode control, so when using DialogBoxParamW you need to catch TVN_SELCHANGEDW (note that there is a W at the end).