Ignore:
Timestamp:
Feb 18, 2000, 6:13:39 PM (26 years ago)
Author:
cbratschi
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/treeview.c

    r2814 r2820  
    1 /* $Id: treeview.c,v 1.27 2000-02-17 17:26:51 cbratschi Exp $ */
     1/* $Id: treeview.c,v 1.28 2000-02-18 17:13:39 cbratschi Exp $ */
    22/* Treeview control
    33 *
     
    3434
    3535 - bug in SetScrollInfo/ShowScrollBar: WM_SIZE and WM_NCPAINT problems (i.e. RegEdit)
    36  - WM_HSCROLL: some rects are wrong
    3736 - TVS_FULLROWSELECT
    3837 - TVS_SINGLEEXPAND
     
    4544#include "winbase.h"
    4645#include "wingdi.h"
     46#include "winnls.h"
    4747#include "commctrl.h"
    4848#include "comctl32.h"
     
    7979static BOOL    TREEVIEW_CalcItems(HWND hwnd,HDC hdc,TREEVIEW_INFO *infoPtr);
    8080static LRESULT TREEVIEW_EnsureVisible(HWND hwnd,HTREEITEM hItem);
     81static VOID    TREEVIEW_ISearch(HWND hwnd,CHAR ch);
    8182
    8283static LRESULT CALLBACK TREEVIEW_Edit_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
     
    578579  TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd);
    579580
    580   //TRACE("\n");
    581581  return (LRESULT) infoPtr->clrText;
    582582}
     
    735735       * Get a dotted pen
    736736       */
    737 #ifdef OS2LINEHACK //CB: workaround for Open32 PS_DOT bug
     737#ifdef OS2LINEHACK
    738738      TREEVIEW_Polyline(hdc,points,2,infoPtr->clrLine);
    739739#else
     
    13161316  BOOL ownDC = FALSE,changedLeftTop = FALSE;
    13171317  DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
     1318  INT maxCX,maxCY;
     1319  INT xDiff = 0,yDiff = 0;
    13181320
    13191321  GetClientRect(hwnd,&rect);
     
    14071409  infoPtr->uTotalHeight = y;
    14081410
    1409   if (item && item->visible)
    1410   {
    1411     INT xDiff = 0,yDiff = 0;
    1412 
    1413     //check cx and cy
    1414 #if 0  //CB: next step
    1415     if ((infoPtr->cy > 0) && (item->rect.bottom < infoPtr->uVisibleHeight))
    1416     {
    1417       INT oldCY = infoPtr->cy;
    1418 
    1419       infoPtr->cy = infoPtr->uTotalHeight-infoPtr->uVisibleHeight;
    1420       if (infoPtr->cy < 0) infoPtr->cy = 0;
    1421       yDiff = infoPtr->cy-oldCY;
    1422     }
    1423 
    1424     changedLeftTop = xDiff || yDiff;
    1425     if (changedLeftTop)
    1426     {
    1427       iItem = (INT)infoPtr->TopRootItem;
    1428       item = NULL;
    1429       indent = 0;
    1430 MessageBeep(MB_OK);
    1431       while (iItem)
    1432       {
    1433         item = &infoPtr->items[iItem];
    1434         OffsetRect(&item->rect,xDiff,yDiff);
    1435         OffsetRect(&item->text,xDiff,yDiff);
    1436         OffsetRect(&item->expandBox,xDiff,yDiff);
    1437         OffsetRect(&item->bitmap,xDiff,yDiff);
    1438         OffsetRect(&item->statebitmap,xDiff,yDiff);
    1439 
    1440 
    1441         if ((item->firstChild) && (item->state & TVIS_EXPANDED))
     1411  //check cx and cy
     1412  maxCY = infoPtr->uTotalHeight-infoPtr->uVisibleHeight;
     1413  if (maxCY < 0) maxCY = 0;
     1414  if (infoPtr->cy > maxCY)
     1415  {
     1416    yDiff = maxCY-infoPtr->cy;
     1417    infoPtr->cy = maxCY;
     1418  }
     1419
     1420  maxCX = infoPtr->uTotalWidth-infoPtr->uVisibleWidth;
     1421  if (maxCX < 0) maxCX = 0;
     1422  if (infoPtr->cx > maxCX)
     1423  {
     1424    xDiff = maxCX-infoPtr->cx;
     1425    infoPtr->cx = maxCX;
     1426  }
     1427
     1428  changedLeftTop = xDiff || yDiff;
     1429  if (changedLeftTop)
     1430  {
     1431    iItem = (INT)infoPtr->TopRootItem;
     1432    item = NULL;
     1433    indent = 0;
     1434
     1435    while (iItem)
     1436    {
     1437      item = &infoPtr->items[iItem];
     1438      OffsetRect(&item->rect,xDiff,yDiff);
     1439      OffsetRect(&item->text,xDiff,yDiff);
     1440      OffsetRect(&item->expandBox,xDiff,yDiff);
     1441      OffsetRect(&item->bitmap,xDiff,yDiff);
     1442      OffsetRect(&item->statebitmap,xDiff,yDiff);
     1443
     1444      if ((item->firstChild) && (item->state & TVIS_EXPANDED))
     1445      {
     1446        iItem = (INT)item->firstChild;
     1447        indent++;
     1448      } else
     1449      {
     1450        iItem = (INT)item->sibling;
     1451        while ((!iItem) && (indent > 0))
    14421452        {
    1443           iItem = (INT)item->firstChild;
    1444           indent++;
    1445         } else
    1446         {
     1453          indent--;
     1454          item = &infoPtr->items[(INT)item->parent];
    14471455          iItem = (INT)item->sibling;
    1448           while ((!iItem) && (indent > 0))
    1449           {
    1450             indent--;
    1451             item = &infoPtr->items[(INT)item->parent];
    1452             iItem = (INT)item->sibling;
    1453           }
    14541456        }
    1455       } /* while */
    1456     }
    1457 #endif
    1458   }
    1459 
    1460   if (!(dwStyle & TVS_NOSCROLL))
     1457      }
     1458    } /* while */
     1459  }
     1460
     1461  if (!(dwStyle & TVS_NOSCROLL) && (infoPtr->uVisibleHeight > 0) && (infoPtr->uVisibleWidth > 0))
    14611462  {
    14621463    if (infoPtr->uTotalHeight > infoPtr->uVisibleHeight)
     
    15981599  TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd);
    15991600
    1600 //  TRACE (treeview, " %d\n",wParam);
    1601 
    1602   switch (wParam) {
    1603         case TV_REFRESH_TIMER:
    1604                 KillTimer (hwnd, TV_REFRESH_TIMER);
    1605                 infoPtr->Timer &= ~TV_REFRESH_TIMER_SET;
    1606                 TREEVIEW_CalcItems(hwnd,0,infoPtr);
    1607                 TREEVIEW_Refresh(hwnd);
    1608                 return 0;
    1609 
    1610         case TV_EDIT_TIMER:
    1611                 KillTimer (hwnd, TV_EDIT_TIMER);
    1612                 infoPtr->Timer &= ~TV_EDIT_TIMER_SET;
    1613                 if (infoPtr->editItem)
    1614                    TREEVIEW_EditLabel(hwnd,infoPtr->editItem,TRUE);
    1615                 return 0;
    1616         default:
    1617 //              ERR (treeview,"got unknown timer\n");
    1618                 break;
     1601  switch (wParam)
     1602  {
     1603    case TV_REFRESH_TIMER:
     1604      KillTimer (hwnd, TV_REFRESH_TIMER);
     1605      infoPtr->Timer &= ~TV_REFRESH_TIMER_SET;
     1606      TREEVIEW_CalcItems(hwnd,0,infoPtr);
     1607      TREEVIEW_Refresh(hwnd);
     1608      return 0;
     1609
     1610    case TV_EDIT_TIMER:
     1611      KillTimer (hwnd, TV_EDIT_TIMER);
     1612      infoPtr->Timer &= ~TV_EDIT_TIMER_SET;
     1613      if (infoPtr->editItem)
     1614        TREEVIEW_EditLabel(hwnd,infoPtr->editItem,TRUE);
     1615      return 0;
     1616
     1617    case TV_ISEARCH_TIMER:
     1618      KillTimer(hwnd,TV_ISEARCH_TIMER);
     1619      infoPtr->Timer &= ~TV_ISEARCH_TIMER_SET;
     1620      return 0;
    16191621 }
    16201622
     
    26272629}
    26282630
    2629 static LRESULT
    2630 TREEVIEW_Size (HWND hwnd, WPARAM wParam, LPARAM lParam)
     2631static LRESULT TREEVIEW_Size (HWND hwnd, WPARAM wParam, LPARAM lParam)
    26312632{
    26322633  TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd);
     
    26352636  {
    26362637    if (TREEVIEW_CalcItems(hwnd,0,infoPtr))
     2638#if 1 //CB: synchron update conflicts with Odin32 implementation -> check and fix
     2639      TREEVIEW_QueueRefresh(hwnd);
     2640#else
    26372641      TREEVIEW_Refresh(hwnd); //because size redraw isn't set
     2642#endif
    26382643  }
    26392644
     
    26482653  if (infoPtr->hwndEdit) SetFocus(hwnd);
    26492654
    2650   //CB: todo: check styles
    26512655  infoPtr->uInternalStatus |= TV_CALCALL;
    26522656  TREEVIEW_QueueRefresh(hwnd);
     
    26662670TREEVIEW_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
    26672671{
     2672  LPCREATESTRUCTA lpcs = (LPCREATESTRUCTA)lParam;
    26682673  TREEVIEW_INFO *infoPtr;
    26692674  DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
     
    26862691  infoPtr->uInternalStatus = 0;
    26872692  if (IsWindowUnicode(hwnd)) infoPtr->uInternalStatus |= TV_UNICODE;
    2688   infoPtr->uNumItems=0;
     2693  infoPtr->uNumItems = 0;
    26892694  infoPtr->clrBk   = GetSysColor (COLOR_WINDOW);
    26902695  infoPtr->clrLine = GetSysColor (COLOR_WINDOWTEXT);
     
    26962701  infoPtr->himlState = NULL;
    26972702  infoPtr->uItemHeight = -1;
     2703  infoPtr->uRealItemHeight = 0;
     2704  infoPtr->uVisibleHeight = lpcs->cy;
     2705  infoPtr->uTotalHeight = 0;
     2706  infoPtr->uVisibleWidth = lpcs->cx;
     2707  infoPtr->uTotalWidth = 0;
     2708
    26982709  GetTextMetricsA (hdc, &tm);
    26992710  infoPtr->hFont = GetStockObject (DEFAULT_GUI_FONT);
    27002711  GetObjectA (infoPtr->hFont, sizeof (LOGFONTA), &logFont);
    2701   logFont.lfWeight=FW_BOLD;
     2712  logFont.lfWeight = FW_BOLD;
    27022713  infoPtr->hBoldFont = CreateFontIndirectA (&logFont);
    27032714
    27042715  infoPtr->items = NULL;
    27052716  infoPtr->selectedItem = 0;
    2706   infoPtr->clrText=-1;        /* use system color */
    2707   infoPtr->dropItem=0;
    2708   infoPtr->insertMarkItem=0;
    2709   infoPtr->insertBeforeorAfter=0;
    2710   infoPtr->pCallBackSort=NULL;
     2717  infoPtr->clrText = -1;        /* use system color */
     2718  infoPtr->dropItem = 0;
     2719  infoPtr->insertMarkItem = 0;
     2720  infoPtr->insertBeforeorAfter = 0;
     2721  infoPtr->pCallBackSort = NULL;
    27112722  infoPtr->uScrollTime = 300;  /* milliseconds */
    27122723  infoPtr->hwndEdit = 0;
    2713 
    2714   infoPtr->hwndToolTip=0;
     2724  infoPtr->pszISearch = NULL;
     2725  infoPtr->uISearchLen = 0;
     2726
     2727  infoPtr->hwndToolTip = 0;
    27152728  if (!(dwStyle & TVS_NOTOOLTIPS))
    27162729  {
     
    27552768    infoPtr->himlState = ImageList_Create (16, 16,ILC_COLOR | ILC_MASK, 15, 1);
    27562769
    2757     //CB: MSDN docu says: uses DrawFrameControl
     2770    //MSDN docu says: uses DrawFrameControl but never believe what they write
    27582771    hbmLoad = LoadBitmapA (COMCTL32_hModule, MAKEINTRESOURCEA(IDT_CHECK));
    27592772    nIndex = ImageList_AddMasked (infoPtr->himlState, hbmLoad, CLR_DEFAULT);
     
    27692782{
    27702783   TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd);
    2771 
    2772 //   TRACE (treeview,"\n");
    27732784
    27742785   TREEVIEW_RemoveTree (hwnd);
     
    27832794
    27842795   DeleteObject(infoPtr->hBoldFont);
     2796   COMCTL32_Free(infoPtr->pszISearch);
    27852797   COMCTL32_Free (infoPtr);
    27862798
     
    32813293  TREEVIEW_ITEM *wineItem;
    32823294  RECT rect;
    3283   UINT status,x,y;
     3295  UINT status;
     3296  INT x,y;
    32843297
    32853298  if (!lpht) return 0;
     
    36693682     goto setfocus;
    36703683
    3671 //CB: todo: check ht.flags for WM_HSCROLL!
    3672 
    36733684  /*
    36743685   * If the style allow editing and the node is already selected
     
    39593970
    39603971  GetObjectA (infoPtr->hFont, sizeof (LOGFONTA), &logFont);
    3961   logFont.lfWeight=FW_BOLD;
     3972  logFont.lfWeight = FW_BOLD;
    39623973  DeleteObject(infoPtr->hBoldFont);
    39633974  infoPtr->hBoldFont = CreateFontIndirectA (&logFont);
    39643975
    3965   hdc = GetDC (0);
     3976  hdc = GetDC(hwnd);
    39663977  hOldFont = SelectObject (hdc, hFont);
    39673978  GetTextMetricsA (hdc, &tm);
    39683979  height= tm.tmHeight + tm.tmExternalLeading;
    3969   if (height>infoPtr->uRealItemHeight)
    3970     infoPtr->uRealItemHeight=height;
     3980  if (height > infoPtr->uRealItemHeight)
     3981    infoPtr->uRealItemHeight = height;
    39713982  SelectObject (hdc, hOldFont);
    3972   ReleaseDC (0, hdc);
     3983  ReleaseDC(hwnd,hdc);
    39733984
    39743985  if (lParam)
     
    39783989    TREEVIEW_CalcItems(hwnd,0,infoPtr);
    39793990    TREEVIEW_Refresh(hwnd);
    3980   }
     3991  } else infoPtr->uInternalStatus |= TV_CALCALL;
    39813992
    39823993  return 0;
     
    41654176  if (control)
    41664177  {
    4167     DWORD scrollMsg = 0;
     4178    INT scrollMsg = -1;
    41684179    BOOL horz = FALSE;
    41694180
     
    41714182    {
    41724183      case VK_UP:
    4173 //CB: todo: VK_UP doesn't work
    41744184        scrollMsg = SB_LINELEFT;
    41754185        break;
     
    41974207        break;
    41984208    }
    4199     if (scrollMsg)
     4209    if (scrollMsg != -1)
    42004210    {
    42014211      SendMessageA(hwnd,horz ? WM_HSCROLL:WM_VSCROLL,MAKELONG(scrollMsg,0),0);
     
    43154325    default:
    43164326      break;
    4317  }
     4327  }
    43184328
    43194329  if (hNewSelection)
     
    43304340
    43314341  return FALSE;
     4342}
     4343
     4344static LRESULT TREEVIEW_Char(HWND hwnd,WPARAM wParam,LPARAM lParam)
     4345{
     4346  CHAR ch = (CHAR)wParam;
     4347
     4348  TREEVIEW_ISearch(hwnd,ch);
     4349
     4350  return 0;
    43324351}
    43334352
     
    43934412}
    43944413
    4395 static LRESULT TREEVIEW_GetISearchString(HWND hwnd,LPSTR lpsz,BOOL unicode)
    4396 {
    4397   //CB: todo: MSDN documentation is useless
    4398 
    4399   return 0;
     4414static BOOL TREEVIEW_Compare(HWND hwnd,TREEVIEW_ITEM *item,LPWSTR text,INT textlen)
     4415{
     4416  if (item->pszText == LPSTR_TEXTCALLBACKW)
     4417    TREEVIEW_SendDispInfoNotify(hwnd,item,TVN_GETDISPINFO,TVIF_TEXT);
     4418  if (item->pszText == LPSTR_TEXTCALLBACKW) return FALSE;
     4419
     4420  //simulate lstrcmpniW
     4421  return CompareStringW(LOCALE_SYSTEM_DEFAULT,NORM_IGNORECASE,item->pszText,MIN(lstrlenW(item->pszText),textlen),text,textlen) == 2;
     4422}
     4423
     4424static TREEVIEW_ITEM* TREEVIEW_SearchChildren(HWND hwnd,TREEVIEW_INFO *infoPtr,TREEVIEW_ITEM *item,TREEVIEW_ITEM *stop,LPWSTR text,INT textlen)
     4425{
     4426  TREEVIEW_ITEM *child,*child2;
     4427
     4428  if (!(item->firstChild && (item->state & TVIS_EXPANDED))) return NULL;
     4429
     4430  child = &infoPtr->items[(INT)item->firstChild];
     4431  while (child)
     4432  {
     4433    if (child == stop) return NULL;
     4434    if (TREEVIEW_Compare(hwnd,child,text,textlen)) return child;
     4435    child2 = TREEVIEW_SearchChildren(hwnd,infoPtr,child,stop,text,textlen);
     4436    if (child2) return child2;
     4437    if (child->sibling) child = &infoPtr->items[(INT)child->sibling];
     4438    else return NULL;
     4439  }
     4440
     4441  return NULL;
     4442}
     4443
     4444static TREEVIEW_ITEM* TREEVIEW_Search(HWND hwnd,TREEVIEW_INFO *infoPtr,INT iItem,LPWSTR text,INT textlen)
     4445{
     4446  TREEVIEW_ITEM *item,*start;
     4447  BOOL found = FALSE;
     4448
     4449  item = start = &infoPtr->items[iItem];
     4450
     4451  if (TREEVIEW_Compare(hwnd,item,text,textlen)) found = TRUE; else
     4452  {
     4453    //search start to end
     4454    while (item->sibling || item->parent)
     4455    {
     4456      TREEVIEW_ITEM *child = TREEVIEW_SearchChildren(hwnd,infoPtr,item,NULL,text,textlen);
     4457
     4458      if (child)
     4459      {
     4460        found = TRUE;
     4461        item = child;
     4462        break;
     4463      }
     4464
     4465      item = TREEVIEW_GetNextListItem(hwnd,infoPtr,item);
     4466      if (item && TREEVIEW_Compare(hwnd,item,text,textlen))
     4467      {
     4468        found = TRUE;
     4469        break;
     4470      }
     4471    }
     4472    if (!found)
     4473    {
     4474      iItem = (INT)infoPtr->TopRootItem;
     4475      item = &infoPtr->items[iItem];
     4476      //search first to start
     4477      while (item != start)
     4478      {
     4479        TREEVIEW_ITEM *child;
     4480
     4481        if (TREEVIEW_Compare(hwnd,item,text,textlen))
     4482        {
     4483          found = TRUE;
     4484          break;
     4485        }
     4486        child = TREEVIEW_SearchChildren(hwnd,infoPtr,item,start,text,textlen);
     4487
     4488        if (child)
     4489        {
     4490          found = TRUE;
     4491          item = child;
     4492          break;
     4493        }
     4494        if (item->sibling) item = &infoPtr->items[(INT)item->sibling];
     4495        else break;
     4496      }
     4497    }
     4498  }
     4499
     4500  return found ? item:NULL;
     4501}
     4502
     4503static VOID TREEVIEW_ISearch(HWND hwnd,CHAR ch)
     4504{
     4505  TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd);
     4506  LPWSTR newString;
     4507  INT len,iItem;
     4508  CHAR ch2[2];
     4509  TREEVIEW_ITEM *item;
     4510
     4511  //check timer
     4512  if (infoPtr->Timer & TV_ISEARCH_TIMER_SET)
     4513  {
     4514    KillTimer(hwnd,TV_ISEARCH_TIMER);
     4515    infoPtr->Timer &= ~TV_ISEARCH_TIMER_SET;
     4516  } else if (infoPtr->uISearchLen > 0)
     4517  {
     4518    COMCTL32_Free(infoPtr->pszISearch);
     4519    infoPtr->pszISearch = NULL;
     4520    infoPtr->uISearchLen = 0;
     4521  }
     4522
     4523  //prepare new search string
     4524  len = infoPtr->uISearchLen+1;
     4525  newString = COMCTL32_Alloc((len+1)*sizeof(WCHAR));
     4526
     4527  if (infoPtr->uISearchLen > 0) lstrcpyW(newString,infoPtr->pszISearch);
     4528
     4529  ch2[0] = ch;
     4530  ch2[1] = 0;
     4531  lstrcpyAtoW((LPWSTR)&newString[len-1],(LPSTR)&ch2);
     4532
     4533  //search
     4534
     4535  iItem = infoPtr->selectedItem ? (INT)infoPtr->selectedItem:(INT)infoPtr->TopRootItem;
     4536  item = TREEVIEW_Search(hwnd,infoPtr,iItem,newString,len);
     4537  if (!item && infoPtr->pszISearch)
     4538  {
     4539    TREEVIEW_ITEM *next;
     4540//CB: todo: must press key twice to go to the next item
     4541    item = &infoPtr->items[iItem];
     4542    next = TREEVIEW_GetNextListItem(hwnd,infoPtr,item);
     4543    if (!next) next = &infoPtr->items[(INT)infoPtr->TopRootItem];
     4544    if (next && (next != item))
     4545    {
     4546      next = TREEVIEW_Search(hwnd,infoPtr,(INT)next->hItem,infoPtr->pszISearch,infoPtr->uISearchLen);
     4547      if (next)
     4548        TREEVIEW_SelectItem(hwnd,(WPARAM)TVGN_CARET,(LPARAM)next->hItem);
     4549    }
     4550    COMCTL32_Free(newString);
     4551    return;
     4552  }
     4553
     4554  //done
     4555  if (item)
     4556  {
     4557    COMCTL32_Free(infoPtr->pszISearch);
     4558    infoPtr->pszISearch = newString;
     4559    infoPtr->uISearchLen = len;
     4560    TREEVIEW_SelectItem(hwnd,(WPARAM)TVGN_CARET,(LPARAM)item->hItem);
     4561    SetTimer(hwnd,TV_ISEARCH_TIMER,TV_ISEARCH_DELAY,0);
     4562    infoPtr->Timer |= TV_ISEARCH_TIMER_SET;
     4563  } else
     4564  {
     4565    COMCTL32_Free(newString);
     4566    MessageBeep(0xFFFFFFFF);
     4567  }
     4568}
     4569
     4570static LRESULT TREEVIEW_GetISearchString(HWND hwnd,LPWSTR lpsz,BOOL unicode)
     4571{
     4572  TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd);
     4573
     4574  if (infoPtr->uISearchLen == 0) return 0;
     4575
     4576  if (unicode)
     4577    lstrcpyW(lpsz,infoPtr->pszISearch);
     4578  else
     4579    lstrcpyWtoA((LPSTR)lpsz,infoPtr->pszISearch);
     4580
     4581  return infoPtr->uISearchLen;
    44004582}
    44014583
     
    44304612TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
    44314613{
    4432    if (uMsg==WM_CREATE)
    4433                 return TREEVIEW_Create (hwnd, wParam, lParam);
     4614   if (uMsg == WM_CREATE)
     4615     return TREEVIEW_Create (hwnd, wParam, lParam);
    44344616
    44354617   if (!TREEVIEW_GetInfoPtr(hwnd))
    4436        return DefWindowProcA (hwnd, uMsg, wParam, lParam);
    4437 
    4438     switch (uMsg) {
     4618     return DefWindowProcA (hwnd, uMsg, wParam, lParam);
     4619
     4620    switch (uMsg)
     4621    {
    44394622        case TVM_INSERTITEMA:
    44404623          return TREEVIEW_InsertItem(hwnd,wParam,lParam,FALSE);
     
    45174700
    45184701        case TVM_GETISEARCHSTRINGA:
    4519                 return TREEVIEW_GetISearchString(hwnd,(LPSTR)lParam,FALSE);
     4702                return TREEVIEW_GetISearchString(hwnd,(LPWSTR)lParam,FALSE);
    45204703
    45214704        case TVM_GETISEARCHSTRINGW:
    4522                 return TREEVIEW_GetISearchString(hwnd,(LPSTR)lParam,TRUE);
     4705                return TREEVIEW_GetISearchString(hwnd,(LPWSTR)lParam,TRUE);
    45234706
    45244707        case TVM_GETTOOLTIPS:
     
    46024785        case WM_KEYDOWN:
    46034786                return TREEVIEW_KeyDown (hwnd, wParam, lParam);
     4787
     4788        case WM_CHAR:
     4789                return TREEVIEW_Char(hwnd,wParam,lParam);
    46044790
    46054791        case WM_SETFOCUS:
Note: See TracChangeset for help on using the changeset viewer.