home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 14 / IOPROG_14.ISO / soft / sdkjava / sdkjava.exe / SDKJava.cab / Src / Win32Api / Comctl32.java < prev    next >
Encoding:
Java Source  |  1998-03-05  |  33.0 KB  |  1,069 lines

  1. // Copyright (C) 1997 Microsoft Corporation  All Rights Reserved
  2.  
  3. // These classes provide direct, low-overhead access to commonly used
  4. // Windows api. These classes use the new J/Direct feature.
  5. //
  6. // Information on how to use J/Direct to write your own declarations
  7. // can be found in the Microsoft SDK for Java 2.0.
  8.  
  9. package com.ms.win32;
  10.  
  11. /** @security(checkClassLinking=on) */
  12. public class Comctl32 {
  13.     public static int Animate_Create(int hwndP, int id, int dwStyle, int hInstance)
  14.     {
  15.         return User32.CreateWindow("SysAnimate32", null, dwStyle, 0, 0, 0, 0, hwndP, id, hInstance, win.NULL);
  16.     }
  17.     
  18.     /** @dll.import("COMCTL32", auto) */
  19.     public native static int CreateMappedBitmap (int hInstance, int idBitmap, int wFlags, COLORMAP lpColorMap, int iNumMaps);
  20.  
  21.  
  22.     /** @dll.import("COMCTL32", auto) */
  23.     public native static int CreateStatusWindow (int style, String lpszText, int hwndParent, int wID);
  24.  
  25.     /** @dll.import("COMCTL32", auto) */
  26.     public native static int CreateToolbarEx (int hwnd, int ws, int wID, int nBitmaps, int hBMInst, int wBMID, Object lpButtons, int iNumButtons, int dxButton, int dyButton, int dxBitmap, int dyBitmap, int uStructSize);
  27.  
  28.     /** @dll.import("COMCTL32", auto) */
  29.     public native static int CreateUpDownControl (int dwStyle, int x, int y, int cx, int cy, int hParent, int nID, int hInst, int hBuddy, int nUpper, int nLower, int nPos);
  30.  
  31.     public static int DateTime_GetMonthCal (int hdp)
  32.     {
  33.         return User32.SendMessage(hdp, win.DTM_GETMONTHCAL, 0, 0);
  34.     }
  35.  
  36.     public static int DateTime_GetMonthCalColor (int hdp, int iColor)
  37.     {
  38.         return User32.SendMessage(hdp, win.DTM_GETMCCOLOR, iColor, 0);
  39.     }
  40.  
  41.     public static int DateTime_GetMonthCalFont (int hdp)
  42.     {
  43.         return User32.SendMessage(hdp, win.DTM_GETMCFONT, 0, 0);
  44.     }
  45.  
  46.     public static int DateTime_GetRange (int hdp, int rgst)
  47.     {
  48.         return User32.SendMessage(hdp, win.DTM_GETRANGE, 0, rgst);
  49.     }
  50.  
  51.     public static int DateTime_GetSystemtime (int hdp, SYSTEMTIME pst)
  52.     {
  53.         return User32.SendMessage(hdp, win.DTM_GETSYSTEMTIME, 0, pst);
  54.     }
  55.  
  56.     public static boolean DateTime_SetFormat (int hdp, String sz)
  57.     {
  58.         return 0 != User32.SendMessage(hdp, win.DTM_SETFORMAT, 0, sz);
  59.     }
  60.  
  61.     public static int DateTime_SetMonthCalColor (int hdp, int iColor, int clr)
  62.     {
  63.         return User32.SendMessage(hdp, win.DTM_SETMCCOLOR, iColor, clr);
  64.     }
  65.  
  66.     public static int DateTime_SetMonthCalFont (int hdp, int hfont, int fRedraw)
  67.     {
  68.         return User32.SendMessage(hdp, win.DTM_SETMCFONT, hfont, fRedraw);
  69.     }
  70.  
  71.     public static boolean DateTime_SetRange (int hdp, int gd, int rgst)
  72.     {
  73.         return 0 != User32.SendMessage(hdp, win.DTM_SETRANGE, gd, rgst);
  74.     }
  75.  
  76.     public static boolean DateTime_SetSystemtime (int hdp, int gd, SYSTEMTIME pst)
  77.     {
  78.         return 0 != User32.SendMessage(hdp, win.DTM_SETSYSTEMTIME, gd, pst);
  79.     }
  80.  
  81.     /** @dll.import("COMCTL32", auto) */
  82.     public native static boolean DestroyPropertySheetPage (int anon0);
  83.  
  84.     /** @dll.import("COMCTL32", auto) */
  85.     public native static void DrawInsert (int handParent, int hLB, int nItem);
  86.  
  87.     /** @dll.import("COMCTL32", auto) */
  88.     public native static void DrawStatusText (int hDC, RECT lprc, String pszText, int uFlags);
  89.  
  90.     /** @dll.import("COMCTL32", auto) */
  91.     public native static void GetEffectiveClientRect (int hWnd, RECT lprc, int[] lpInfo);
  92.     
  93.     // Represent ImageList's only as ints.
  94.     public static int Header_CreateDragImage (int hwndHD, int i)
  95.     {
  96.         return User32.SendMessage(hwndHD, win.HDM_CREATEDRAGIMAGE, i, 0);
  97.     }
  98.     
  99.     public static boolean Header_DeleteItem (int hwndHD, int i)
  100.     {
  101.         return (0 != User32.SendMessage(hwndHD, win.HDM_DELETEITEM, i, 0) ? true : false);
  102.     }
  103.     
  104.     public static int Header_GetImageList (int hwndHD)
  105.     {
  106.         return User32.SendMessage(hwndHD, win.HDM_GETIMAGELIST, 0, 0);
  107.     }
  108.  
  109.     public static boolean Header_GetItem (int hwndHD, int i, HDITEM phdi)
  110.     {
  111.         return (0 != User32.SendMessage(hwndHD, win.HDM_GETITEM, i, phdi) ? true : false);
  112.     }
  113.     
  114.     public static int Header_GetItemCount (int hwndHD)
  115.     {
  116.         return User32.SendMessage(hwndHD, win.HDM_GETITEMCOUNT, 0, 0);
  117.     }
  118.     
  119.     public static boolean Header_GetItemRect (int hwndHD, int iItem, RECT lprc)
  120.     {
  121.         return (0 != User32.SendMessage(hwndHD, win.HDM_GETITEMRECT, iItem, lprc) ? true : false);
  122.     }
  123.  
  124.     public static int Header_GetOrderArray (int hwndHD, int iCount, int[] lpi)
  125.     {
  126.         return User32.SendMessage(hwndHD, win.HDM_GETORDERARRAY, iCount, lpi);
  127.     }
  128.     
  129.     public static int Header_InsertItem (int hwndHD, int i, HDITEM phdi)
  130.     {
  131.         return User32.SendMessage(hwndHD, win.HDM_INSERTITEM, i, phdi);
  132.     }
  133.     
  134.     public static boolean Header_Layout (int hwndHD, HDLAYOUT playout)
  135.     {
  136.         return (0 != User32.SendMessage(hwndHD, win.HDM_LAYOUT, 0, playout) ? true : false);
  137.     }
  138.     
  139.     public static int Header_OrderToIndex (int hwndHD, int i)
  140.     {
  141.         return User32.SendMessage(hwndHD, win.HDM_ORDERTOINDEX, i, 0);
  142.     }
  143.     
  144.     public static int Header_SetImageList (int hwndHD, int himl)
  145.     {
  146.         return User32.SendMessage(hwndHD, win.HDM_SETIMAGELIST, 0, himl);
  147.     }
  148.     
  149.     public static boolean Header_SetItem (int hwndHD, int i, HDITEM phdi)
  150.     {
  151.         return (0 != User32.SendMessage(hwndHD, win.HDM_SETITEM, i, phdi) ? true : false);
  152.     }
  153.  
  154.     public static int Header_SetHotDivider (int hwndHD, int fPos, int dw)
  155.     {
  156.         return User32.SendMessage(hwndHD, win.HDM_SETHOTDIVIDER, fPos, dw);
  157.     }
  158.  
  159.     public static int Header_SetOrderArray (int hwndHD, int iCount, int[] lpi)
  160.     {
  161.         return User32.SendMessage(hwndHD, win.HDM_SETORDERARRAY, iCount, lpi);
  162.     }
  163.     
  164.     /** @dll.import("COMCTL32", auto) */
  165.     public native static int ImageList_Add (int himl, int hbmImage, int hbmMask);
  166.     
  167.     /** @dll.import("COMCTL32", auto) */
  168.     public native static int ImageList_AddMasked (int himl, int hbmImage, int crMask);
  169.     
  170.     /** @dll.import("COMCTL32", auto) */
  171.     public native static boolean ImageList_BeginDrag (int himlTrack, int iTrack, int dxHotspot, int dyHotspot);
  172.     
  173.     /** @dll.import("COMCTL32", auto) */
  174.     public native static boolean ImageList_Copy (int himlDst, int iDst, int himlSrc, int iSrc, int uFlags);
  175.     
  176.     /** @dll.import("COMCTL32", auto) */
  177.     public native static int ImageList_Create (int cx, int cy, int flags, int cInitial, int cGrow);
  178.     
  179.     /** @dll.import("COMCTL32", auto) */
  180.     public native static boolean ImageList_Destroy (int himl);
  181.     
  182.     /** @dll.import("COMCTL32", auto) */
  183.     public native static boolean ImageList_DragEnter (int hwndLock, int x, int y);
  184.  
  185.     /** @dll.import("COMCTL32", auto) */
  186.     public native static boolean ImageList_DragLeave (int hwndLock);
  187.  
  188.     /** @dll.import("COMCTL32", auto) */
  189.     public native static boolean ImageList_DragMove (int x, int y);
  190.  
  191.     /** @dll.import("COMCTL32", auto) */
  192.     public native static boolean ImageList_DragShowNolock (boolean fShow);
  193.  
  194.     /** @dll.import("COMCTL32", auto) */
  195.     public native static boolean ImageList_Draw (int himl, int i, int hdcDst, int x, int y, int fStyle);
  196.  
  197.     /** @dll.import("COMCTL32", auto) */
  198.     public native static boolean ImageList_DrawEx (int himl, int i, int hdcDst, int x, int y, int dx, int dy, int rgbBk, int rgbFg, int fStyle);
  199.  
  200.     /** @dll.import("COMCTL32", auto) */
  201.     public native static boolean ImageList_EndDrag ();
  202.  
  203.     /** @dll.import("COMCTL32", auto) */
  204.     public native static int ImageList_GetBkColor (int himl);
  205.  
  206.     /** @dll.import("COMCTL32", auto) */
  207.     public native static int ImageList_GetDragImage (POINT ppt, POINT pptHotspot);
  208.  
  209.     /** @dll.import("COMCTL32", auto) */
  210.     public native static int ImageList_GetIcon (int himl, int i, int flags);
  211.  
  212.     /** @dll.import("COMCTL32", auto) */
  213.     public native static boolean ImageList_GetIconSize (int himl, int[] cx, int[] cy);
  214.  
  215.     /** @dll.import("COMCTL32", auto) */
  216.     public native static int ImageList_GetImageCount (int himl);
  217.  
  218.     /** @dll.import("COMCTL32", auto) */
  219.     public native static boolean ImageList_GetImageInfo (int himl, int i, IMAGEINFO pImageInfo);
  220.  
  221.     /** @dll.import("COMCTL32", auto) */
  222.     public native static int ImageList_LoadImage (int hi, String lpbmp, int cx, int cGrow, int crMask, int uType, int uFlags);
  223.  
  224.     /** @dll.import("COMCTL32", auto) */
  225.     public native static int ImageList_Merge (int himl1, int i1, int himl2, int i2, int dx, int dy);
  226.  
  227.  
  228.  
  229.     /** @dll.import("COMCTL32", auto) */
  230.     public native static boolean ImageList_Remove (int himl, int i);
  231.  
  232.     /** @dll.import("COMCTL32", auto) */
  233.     public native static boolean ImageList_Replace (int himl, int i, int hbmImage, int hbmMask);
  234.  
  235.     /** @dll.import("COMCTL32", auto) */
  236.     public native static int ImageList_ReplaceIcon (int himl, int i, int hicon);
  237.  
  238.     /** @dll.import("COMCTL32", auto) */
  239.     public native static int ImageList_SetBkColor (int himl, int clrBk);
  240.  
  241.     /** @dll.import("COMCTL32", auto) */
  242.     public native static boolean ImageList_SetDragCursorImage (int himlDrag, int iDrag, int dxHotspot, int dyHotspot);
  243.  
  244.     /** @dll.import("COMCTL32", auto) */
  245.     public native static boolean ImageList_SetIconSize (int himl, int cx, int cy);
  246.  
  247.     /** @dll.import("COMCTL32", auto) */
  248.     public native static boolean ImageList_SetImageCount (int himl, int uNewCount);
  249.  
  250.     /** @dll.import("COMCTL32", auto) */
  251.     public native static boolean ImageList_SetOverlayImage (int himl, int iImage, int iOverlay);
  252.  
  253.  
  254.  
  255.     /** @dll.import("COMCTL32", auto) */
  256.     public native static void InitCommonControls ();
  257.  
  258.     /** @dll.import("COMCTL32", auto) */
  259.     public native static boolean InitCommonControlsEx (INITCOMMONCONTROLSEX anon0);
  260.  
  261.     /** @dll.import("COMCTL32", auto) */
  262.     public native static int LBItemFromPt (int hLB, int x, int y, boolean bAutoScroll);
  263.  
  264.     public static int LBItemFromPt (int hLB, POINT pt, boolean bAutoScroll)
  265.     {
  266.         return LBItemFromPt(hLB, pt.x, pt.y, bAutoScroll);
  267.     }
  268.  
  269.     public static int ListView_ApproximateViewRect (int hwnd, short iWidth, short iHeight, int iCount)
  270.     {
  271.         return User32.SendMessage(hwnd, win.LVM_APPROXIMATEVIEWRECT, 0, (((int)iWidth) & 0xffff) | (((int)iHeight)<<16));
  272.     }
  273.  
  274.     public static boolean ListView_Arrange (int hwndLV, int code)
  275.     {
  276.         return 0 != User32.SendMessage(hwndLV, win.LVM_ARRANGE, code, 0);
  277.     }
  278.  
  279.     public static int ListView_CreateDragImage (int hwnd, int i, POINT lpptUpLeft)
  280.     {
  281.         return User32.SendMessage(hwnd, win.LVM_CREATEDRAGIMAGE, i, lpptUpLeft);
  282.     }
  283.  
  284.     public static int ListView_DeleteAllItems (int hwnd)
  285.     {
  286.         return User32.SendMessage(hwnd, win.LVM_DELETEALLITEMS, 0, 0);
  287.     }
  288.  
  289.     public static boolean ListView_DeleteColumn (int hwnd, int iCol)
  290.     {
  291.         return 0 != User32.SendMessage(hwnd, win.LVM_DELETECOLUMN, iCol, 0);
  292.     }
  293.  
  294.     public static boolean ListView_DeleteItem (int hwnd, int i)
  295.     {
  296.         return 0 != User32.SendMessage(hwnd, win.LVM_DELETEITEM, i, 0);
  297.     }
  298.  
  299.     public static int ListView_EditLabel (int hwndLV, int i)
  300.     {
  301.         return User32.SendMessage(hwndLV, win.LVM_EDITLABEL, i, 0);
  302.     }
  303.  
  304.     public static boolean ListView_EnsureVisible (int hwndLV, int i, boolean fPartialOk)
  305.     {
  306.         return 0 != User32.SendMessage(hwndLV, win.LVM_ENSUREVISIBLE, i, (fPartialOk ? 1 : 0));
  307.     }
  308.  
  309.     public static int ListView_FindItem (int hwnd, int iStart, LVFINDINFO plvfi)
  310.     {
  311.         return User32.SendMessage(hwnd, win.LVM_FINDITEM, iStart, plvfi);
  312.     }
  313.  
  314.     public static int ListView_GetBkColor (int hwnd)
  315.     {
  316.         return User32.SendMessage(hwnd, win.LVM_GETBKCOLOR, 0, 0);
  317.     }
  318.  
  319.     public static int ListView_GetCallbackMask (int hwnd)
  320.     {
  321.         return User32.SendMessage(hwnd, win.LVM_GETCALLBACKMASK, 0, 0);
  322.     }
  323.  
  324.     public static int ListView_GetCheckState (int hwndLV, int i)
  325.     {
  326.         return (User32.SendMessage(hwndLV, win.LVM_GETITEMSTATE, i, win.LVIS_STATEIMAGEMASK) >> 12) - 1;
  327.     }
  328.  
  329.     public static boolean ListView_GetColumn (int hwndLV, int iCol, LVCOLUMN pcol)
  330.     {
  331.         return 0 != User32.SendMessage(hwndLV, win.LVM_GETCOLUMN, iCol, pcol);
  332.     }
  333.  
  334.     public static boolean ListView_GetColumnOrderArray (int hwndLV, int iCount, int[] pi)
  335.     {
  336.         return 0 != User32.SendMessage(hwndLV, win.LVM_GETCOLUMNORDERARRAY, iCount, pi);
  337.     }
  338.  
  339.     public static int ListView_GetColumnWidth (int hwnd, int iCol)
  340.     {
  341.         return User32.SendMessage(hwnd, win.LVM_GETCOLUMNWIDTH, iCol, 0);
  342.     }
  343.  
  344.     public static int ListView_GetCountPerPage (int hwndLV)
  345.     {
  346.         return User32.SendMessage(hwndLV, win.LVM_GETCOUNTPERPAGE, 0, 0);
  347.     }
  348.  
  349.     public static int ListView_GetEditControl (int hwndLV)
  350.     {
  351.         return User32.SendMessage(hwndLV, win.LVM_GETEDITCONTROL, 0, 0);
  352.     }
  353.  
  354.     public static int ListView_GetExtendedListViewStyle (int hwndLV)
  355.     {
  356.         return User32.SendMessage(hwndLV, win.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
  357.     }
  358.  
  359.     public static int ListView_GetHeader (int hwnd)
  360.     {
  361.         return User32.SendMessage(hwnd, win.LVM_GETHEADER, 0, 0);
  362.     }
  363.  
  364.     public static int ListView_GetHotCursor (int hwnd)
  365.     {
  366.         return User32.SendMessage(hwnd, win.LVM_GETHOTCURSOR, 0, 0);
  367.     }
  368.  
  369.     public static int ListView_GetHotItem (int hwnd)
  370.     {
  371.         return User32.SendMessage(hwnd, win.LVM_GETHOTITEM, 0, 0);
  372.     }
  373.  
  374.     public static int ListView_GetImageList (int hwnd, int iImageList)
  375.     {
  376.         return User32.SendMessage(hwnd, win.LVM_GETIMAGELIST, iImageList, 0);
  377.     }
  378.  
  379.     public static int ListView_GetISearchString (int hwndLV, StringBuffer lpsz)
  380.     {
  381.         return User32.SendMessage(hwndLV, win.LVM_GETISEARCHSTRING, 0, lpsz);
  382.     }
  383.  
  384.     public static boolean ListView_GetItem (int hwnd, LVITEM pitem)
  385.     {
  386.         return 0 != User32.SendMessage(hwnd, win.LVM_GETITEM, 0, pitem);
  387.     }
  388.  
  389.     public static int ListView_GetItemCount (int hwnd)
  390.     {
  391.         return User32.SendMessage(hwnd, win.LVM_GETITEMCOUNT, 0, 0);
  392.     }
  393.  
  394.     public static boolean ListView_GetItemPosition (int hwnd, int i, POINT ppt)
  395.     {
  396.         return 0 != User32.SendMessage(hwnd, win.LVM_GETITEMPOSITION, i, ppt);
  397.     }
  398.  
  399.     public static boolean ListView_GetItemRect (int hwnd, int i, RECT prc, int code)
  400.     {
  401.         if(prc!=null)
  402.             prc.left = code;
  403.         return 0 != User32.SendMessage(hwnd, win.LVM_GETITEMRECT, i, prc);
  404.     }
  405.  
  406.     public static int ListView_GetItemSpacing (int hwndLV, int fSmall)
  407.     {
  408.         return User32.SendMessage(hwndLV, win.LVM_GETITEMSPACING, fSmall, 0);
  409.     }
  410.  
  411.     public static int ListView_GetItemState (int hwndLV, int i, int mask)
  412.     {
  413.         return User32.SendMessage(hwndLV, win.LVM_GETITEMSTATE, i, mask);
  414.     }
  415.  
  416.     public static void ListView_GetItemText (int hwndLV, int i, int iSubItem_, int pszText_, int cchTextMax_)
  417.     {
  418.         LVITEM ms_lvi = new LVITEM();
  419.         ms_lvi.iSubItem = iSubItem_;
  420.         ms_lvi.cchTextMax = cchTextMax_;
  421.         ms_lvi.pszText = pszText_;
  422.         User32.SendMessage(hwndLV, win.LVM_GETITEMTEXT, i, ms_lvi);
  423.     }
  424.  
  425.     public static void ListView_GetItemText (int hwndLV, int i, int iSubItem_, StringBuffer pszText_, int cchTextMax_)
  426.     {
  427.                 int nchars = pszText_.capacity();
  428.                 int buffer = com.ms.dll.DllLib.allocHGlobal(com.ms.dll.DllLib.systemDefaultCharSize *
  429.                                                             (nchars + 1));
  430.  
  431.                 try {
  432.                         LVITEM ms_lvi = new LVITEM();
  433.                 ms_lvi.iSubItem = iSubItem_;
  434.                 ms_lvi.cchTextMax = cchTextMax_;
  435.                 ms_lvi.pszText = buffer;
  436.                         User32.SendMessage(hwndLV, win.LVM_GETITEMTEXT, i, ms_lvi);
  437.                         pszText_.setLength(0);
  438.                         pszText_.append(com.ms.dll.DllLib.ptrToString(buffer));
  439.                 } finally {
  440.                         com.ms.dll.DllLib.freeHGlobal(buffer);
  441.                 }
  442.     }
  443.  
  444.     public static int ListView_GetNextItem (int hwnd, int i, short flags)
  445.     {
  446.         return User32.SendMessage(hwnd, win.LVM_GETNEXTITEM, i, (int)flags);
  447.     }
  448.  
  449.     public static boolean ListView_GetOrigin (int hwndLV, POINT ppt)
  450.     {
  451.         return 0 != User32.SendMessage(hwndLV, win.LVM_GETORIGIN, 0, ppt);
  452.     }
  453.  
  454.     public static int ListView_GetSelectedCount (int hwndLV)
  455.     {
  456.         return User32.SendMessage(hwndLV, win.LVM_GETSELECTEDCOUNT, 0, 0);
  457.     }
  458.     
  459.     // Pass in a pointer to a C string and get width
  460.     public static int ListView_GetStringWidth (int hwndLV, String psz)
  461.     {
  462.         return User32.SendMessage(hwndLV, win.LVM_GETSTRINGWIDTH, null, psz);
  463.     }
  464.     
  465.     public static int ListView_GetSubItemHitTest (int hwnd, LVHITTESTINFO plvhti)
  466.     {
  467.         return User32.SendMessage(hwnd, win.LVM_SUBITEMHITTEST, 0, plvhti);
  468.     }
  469.  
  470.     public static boolean ListView_GetSubItemRect (int hwnd, int iItem, int iSubItem, int code, RECT prc)
  471.     {
  472.         if(prc!=null) {
  473.             prc.top = iSubItem;
  474.             prc.left = code;
  475.         }
  476.         return 0 != User32.SendMessage(hwnd, win.LVM_GETSUBITEMRECT, iItem, prc);
  477.     }
  478.     
  479.     public static int ListView_GetTextBkColor (int hwnd)
  480.     {
  481.         return User32.SendMessage(hwnd, win.LVM_GETTEXTBKCOLOR, 0, 0);
  482.     }
  483.  
  484.     public static int ListView_GetTextColor (int hwnd)
  485.     {
  486.         return User32.SendMessage(hwnd, win.LVM_GETTEXTCOLOR, 0, 0);
  487.     }
  488.  
  489.     public static int ListView_GetTopIndex (int hwndLV)
  490.     {
  491.         return User32.SendMessage(hwndLV, win.LVM_GETTOPINDEX, 0, 0);
  492.     }
  493.  
  494.     public static boolean ListView_GetViewRect (int hwnd, RECT prc)
  495.     {
  496.         return 0 != User32.SendMessage(hwnd, win.LVM_GETVIEWRECT, 0, prc);
  497.     }
  498.  
  499.     public static int ListView_HitTest (int hwndLV, LVHITTESTINFO pinfo)
  500.     {
  501.         return User32.SendMessage(hwndLV, win.LVM_HITTEST, 0, pinfo);
  502.     }
  503.  
  504.     public static int ListView_InsertColumn (int hwnd, int iCol, LVCOLUMN pcol)
  505.     {
  506.         return User32.SendMessage(hwnd, win.LVM_INSERTCOLUMN, iCol, pcol);
  507.     }
  508.  
  509.     public static int ListView_InsertItem (int hwnd, LVITEM pitem)
  510.     {
  511.         return User32.SendMessage(hwnd, win.LVM_INSERTITEM, 0, pitem);
  512.     }
  513.  
  514.     public static boolean ListView_RedrawItems (int hwndLV, int iFirst, int iLast)
  515.     {
  516.         return 0 != User32.SendMessage(hwndLV, win.LVM_REDRAWITEMS, iFirst, iLast);
  517.     }
  518.  
  519.     public static boolean ListView_Scroll (int hwndLV, int dx, int dy)
  520.     {
  521.         return 0 != User32.SendMessage(hwndLV, win.LVM_SCROLL, dx, dy);
  522.     }
  523.  
  524.     public static boolean ListView_SetBkColor (int hwnd, int clrBk)
  525.     {
  526.         return 0 != User32.SendMessage(hwnd, win.LVM_SETBKCOLOR, 0, clrBk);
  527.     }
  528.  
  529.     public static boolean ListView_SetCallbackMask (int hwnd, int mask)
  530.     {
  531.         return 0 != User32.SendMessage(hwnd, win.LVM_SETCALLBACKMASK, mask, 0);
  532.     }
  533.  
  534.     public static boolean ListView_SetColumn (int hwndLV, int iCol, LVCOLUMN pcol)
  535.     {
  536.         return 0 != User32.SendMessage(hwndLV, win.LVM_SETCOLUMN, iCol, pcol);
  537.     }
  538.  
  539.     public static boolean ListView_SetColumnOrderArray (int hwndLV, int iCount, int[] pi)
  540.     {
  541.         return 0 != User32.SendMessage(hwndLV, win.LVM_SETCOLUMNORDERARRAY, iCount, pi);
  542.     }
  543.  
  544.     public static boolean ListView_SetColumnWidth (int hwnd, int iCol, short cx)
  545.     {
  546.         return 0 != User32.SendMessage(hwnd, win.LVM_SETCOLUMNWIDTH, iCol, (int)cx);
  547.     }
  548.  
  549.     public static int ListView_SetExtendedListViewStyle (int hwndLV, int dw)
  550.     {
  551.         return User32.SendMessage(hwndLV, win.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dw);
  552.     }
  553.  
  554.     public static int ListView_SetHotCursor (int hwnd, int hcur)
  555.     {
  556.         return User32.SendMessage(hwnd, win.LVM_SETHOTCURSOR, 0, hcur);
  557.     }
  558.  
  559.     public static int ListView_SetHotItem (int hwnd, int i)
  560.     {
  561.         return User32.SendMessage(hwnd, win.LVM_SETHOTITEM, i, 0);
  562.     }
  563.  
  564.     public static int ListView_SetImageList (int hwnd, int himl, int iImageList)
  565.     {
  566.         return User32.SendMessage(hwnd, win.LVM_SETIMAGELIST, iImageList, himl);
  567.     }
  568.  
  569.     public static int ListView_SetIconSpacing (int hwndLV, short cx, short cy)
  570.     {
  571.         return User32.SendMessage(hwndLV, win.LVM_SETICONSPACING, 0, (((int) cx) & 0xffff) | (((int)cy) << 16));
  572.     }
  573.  
  574.     public static boolean ListView_SetItem (int hwnd, LVITEM pitem)
  575.     {
  576.         return 0 != User32.SendMessage(hwnd, win.LVM_SETITEM, 0, pitem);
  577.     }
  578.  
  579.     public static int ListView_SetItemCount (int hwnd, int cItems)
  580.     {
  581.         return User32.SendMessage(hwnd, win.LVM_SETITEMCOUNT, cItems, 0);
  582.     }
  583.  
  584.     public static int ListView_SetItemCountEx (int hwnd, int cItems, int dwFlags)
  585.     {
  586.         return User32.SendMessage(hwnd, win.LVM_SETITEMCOUNT, cItems, dwFlags);
  587.     }
  588.  
  589.     public static boolean ListView_SetItemPosition (int hwnd, int i, short x, short y)
  590.     {
  591.         return 0 != User32.SendMessage(hwnd, win.LVM_SETITEMPOSITION, i, (((int) x) & 0xffff) | ((int)y<<16));
  592.     }
  593.  
  594.     public static void ListView_SetItemPosition32 (int hwnd, int i, int x, int y)
  595.     {
  596.         POINT ptNewPos = new POINT();
  597.         ptNewPos.x = x;
  598.         ptNewPos.y = y;
  599.         User32.SendMessage(hwnd, win.LVM_SETITEMPOSITION32, i, ptNewPos);
  600.     }
  601.  
  602.     public static int ListView_SetItemState (int hwndLV, int i, int data, int mask)
  603.     {
  604.         LVITEM ms_lvi = new LVITEM();
  605.         ms_lvi.stateMask = mask;
  606.         ms_lvi.state = data;
  607.         return User32.SendMessage(hwndLV, win.LVM_SETITEMSTATE, i, ms_lvi);
  608.     }
  609.  
  610.     public static void ListView_SetItemText (int hwndLV, int i, int iSubItem_, String pszText_)
  611.     {
  612.         LVITEM ms_lvi = new LVITEM();
  613.         ms_lvi.iSubItem = iSubItem_;
  614.                 int pszText = com.ms.dll.DllLib.stringToHGlobal(pszText_);
  615.  
  616.                 try {
  617.                   ms_lvi.pszText = pszText;
  618.           User32.SendMessage(hwndLV, win.LVM_SETITEMTEXT, i, ms_lvi);
  619.                 } finally {
  620.                   com.ms.dll.DllLib.freeHGlobal(pszText);
  621.                 }
  622.                 
  623.     }
  624.     
  625.     public static boolean ListView_SetTextBkColor (int hwnd, int clrTextBk)
  626.     {
  627.         return 0 != User32.SendMessage(hwnd, win.LVM_SETTEXTBKCOLOR, 0, clrTextBk);
  628.     }
  629.     
  630.     public static boolean ListView_SetTextColor (int hwnd, int clrText)
  631.     {
  632.         return 0 != User32.SendMessage(hwnd, win.LVM_SETTEXTCOLOR, 0, clrText);
  633.     }
  634.     
  635.     public static void ListView_SetWorkArea (int hwndLV, RECT prc)
  636.     {
  637.         User32.SendMessage(hwndLV, win.LVM_SETWORKAREA, 0, prc);
  638.     }
  639.  
  640.     public static boolean ListView_SortItems (int hwndLV, PFNLVCOMPARE _pfnCompare, int _lPrm)
  641.     {
  642.         return 0 != User32.SendMessage(hwndLV, win.LVM_SORTITEMS, _lPrm, _pfnCompare);
  643.     }
  644.  
  645.     public static boolean ListView_Update (int hwndLV, int i)
  646.     {
  647.         return 0 != User32.SendMessage(hwndLV, win.LVM_UPDATE, i, 0);
  648.     }
  649.  
  650.     /** @dll.import("COMCTL32", auto) */
  651.     public native static boolean MakeDragList (int hLB);
  652.  
  653.     /** @dll.import("COMCTL32", auto) */
  654.     public native static void MenuHelp (int uMsg, int wParam, int lParam, int hMainMenu, int hInst, int hwndStatus, int[] lpwIDs);
  655.  
  656.     public static int MonthCal_GetColor (int hmc, int iColor)
  657.     {
  658.         return User32.SendMessage(hmc, win.MCM_GETCOLOR, iColor, 0);
  659.     }
  660.  
  661.     public static boolean MonthCal_GetCurSel (int hmc, SYSTEMTIME pst)
  662.     {
  663.         return 0 != User32.SendMessage(hmc, win.MCM_GETCURSEL, 0, pst);
  664.     }
  665.  
  666.     public static int MonthCal_GetFirstDayOfWeek (int hmc)
  667.     {
  668.         return User32.SendMessage(hmc, win.MCM_GETFIRSTDAYOFWEEK, 0, 0);
  669.     }
  670.  
  671.     public static int MonthCal_GetMaxSelCount (int hmc)
  672.     {
  673.         return User32.SendMessage(hmc, win.MCM_GETMAXSELCOUNT, 0, 0);
  674.     }
  675.  
  676.     public static int MonthCal_GetMinReqRect (int hmc, RECT prc)
  677.     {
  678.         return User32.SendMessage(hmc, win.MCM_GETMINREQRECT, 0, prc);
  679.     }
  680.  
  681.     public static int MonthCal_GetMonthDelta (int hmc)
  682.     {
  683.         return User32.SendMessage(hmc, win.MCM_GETMONTHDELTA, 0, 0);
  684.     }
  685.  
  686.     public static int MonthCal_GetMonthRange (int hmc, int gmr, SYSTEMTIMEPAIR rgst)
  687.     {
  688.         return User32.SendMessage(hmc, win.MCM_GETMONTHRANGE, gmr, rgst);
  689.     }
  690.  
  691.     public static int MonthCal_GetRange (int hmc, SYSTEMTIMEPAIR rgst)
  692.     {
  693.         return User32.SendMessage(hmc, win.MCM_GETRANGE, 0, rgst);
  694.     }
  695.  
  696.     public static int MonthCal_GetSelRange (int hmc, SYSTEMTIMEPAIR rgst)
  697.     {
  698.         return User32.SendMessage(hmc, win.MCM_GETSELRANGE, 0, rgst);
  699.     }
  700.  
  701.     public static boolean MonthCal_GetToday (int hmc, SYSTEMTIME pst)
  702.     {
  703.         return 0 != User32.SendMessage(hmc, win.MCM_GETTODAY, 0, pst);
  704.     }
  705.  
  706.     public static int MonthCal_HitTest (int hmc, MCHITTESTINFO pinfo)
  707.     {
  708.         return User32.SendMessage(hmc, win.MCM_HITTEST, 0, pinfo);
  709.     }
  710.  
  711.     public static int MonthCal_SetColor (int hmc, int iColor, int clr)
  712.     {
  713.         return User32.SendMessage(hmc, win.MCM_SETCOLOR, iColor, clr);
  714.     }
  715.  
  716.     public static boolean MonthCal_SetCurSel (int hmc, SYSTEMTIME pst)
  717.     {
  718.         return 0 != User32.SendMessage(hmc, win.MCM_SETCURSEL, 0, pst);
  719.     }
  720.  
  721.     public static boolean MonthCal_SetDayState (int hmc, int cbds, int[] rgds)
  722.     {
  723.         return 0 != User32.SendMessage(hmc, win.MCM_SETDAYSTATE, cbds, rgds);
  724.     }
  725.  
  726.     public static int MonthCal_SetFirstDayOfWeek (int hmc, int iDay)
  727.     {
  728.         return User32.SendMessage(hmc, win.MCM_SETFIRSTDAYOFWEEK, 0, iDay);
  729.     }
  730.  
  731.     public static boolean MonthCal_SetMaxSelCount (int hmc, int n)
  732.     {
  733.         return 0 != User32.SendMessage(hmc, win.MCM_SETMAXSELCOUNT, n, 0);
  734.     }
  735.  
  736.     public static int MonthCal_SetMonthDelta (int hmc, int n)
  737.     {
  738.         return User32.SendMessage(hmc, win.MCM_SETMONTHDELTA, n, 0);
  739.     }
  740.  
  741.     public static boolean MonthCal_SetRange (int hmc, int gd, SYSTEMTIMEPAIR rgst)
  742.     {
  743.         return 0 != User32.SendMessage(hmc, win.MCM_SETRANGE, gd, rgst);
  744.     }
  745.  
  746.     public static boolean MonthCal_SetSelRange (int hmc, SYSTEMTIMEPAIR rgst)
  747.     {
  748.         return 0 != User32.SendMessage(hmc, win.MCM_SETSELRANGE, 0, rgst);
  749.     }
  750.  
  751.     public static int MonthCal_SetToday (int hmc, SYSTEMTIME pst)
  752.     {
  753.         return User32.SendMessage(hmc, win.MCM_SETTODAY, 0, pst);
  754.     }
  755.  
  756.     /** @dll.import("COMCTL32", auto) */
  757.     public native static boolean ShowHideMenuCtl (int hWnd, int uFlags, int[] lpInfo);
  758.  
  759.     public static int TabCtrl_AdjustRect (int hwnd, boolean bLarger, RECT prc)
  760.     {
  761.         return User32.SendMessage(hwnd, win.TCM_ADJUSTRECT, (bLarger?1:0), prc);
  762.     }
  763.  
  764.     public static boolean TabCtrl_DeleteItem (int hwnd, int i)
  765.     {
  766.         return 0 != User32.SendMessage(hwnd, win.TCM_DELETEITEM, i, 0);
  767.     }
  768.  
  769.     public static boolean TabCtrl_DeleteAllItems (int hwnd)
  770.     {
  771.         return 0 != User32.SendMessage(hwnd, win.TCM_DELETEALLITEMS, 0, 0);
  772.     }
  773.  
  774.     public static void TabCtrl_DeselectAll (int hwnd, int fExcludeFocus)
  775.     {
  776.         User32.SendMessage(hwnd, win.TCM_DESELECTALL, fExcludeFocus, 0);
  777.     }
  778.  
  779.     public static int TabCtrl_GetCurFocus (int hwnd)
  780.     {
  781.         return User32.SendMessage(hwnd, win.TCM_GETCURFOCUS, 0, 0);
  782.     }
  783.  
  784.     public static int TabCtrl_GetCurSel (int hwnd)
  785.     {
  786.         return User32.SendMessage(hwnd, win.TCM_GETCURSEL, 0, 0);
  787.     }
  788.  
  789.     public static int TabCtrl_GetImageList (int hwnd)
  790.     {
  791.         return User32.SendMessage(hwnd, win.TCM_GETIMAGELIST, 0, 0);
  792.     }
  793.  
  794.     public static boolean TabCtrl_GetItem (int hwnd, int iItem, TCITEM pItem)
  795.     {
  796.         return 0 != User32.SendMessage(hwnd, win.TCM_GETITEM, iItem, pItem);
  797.     }
  798.  
  799.     public static int TabCtrl_GetItemCount (int hwnd)
  800.     {
  801.         return User32.SendMessage(hwnd, win.TCM_GETITEMCOUNT, 0, 0);
  802.     }
  803.  
  804.     public static boolean TabCtrl_GetItemRect (int hwnd, int i, RECT prc)
  805.     {
  806.         return 0 != User32.SendMessage(hwnd, win.TCM_GETITEMRECT, i, prc);
  807.     }
  808.  
  809.     public static int TabCtrl_GetRowCount (int hwnd)
  810.     {
  811.         return User32.SendMessage(hwnd, win.TCM_GETROWCOUNT, 0, 0);
  812.     }
  813.  
  814.     public static int TabCtrl_GetToolTips (int hwnd)
  815.     {
  816.         return User32.SendMessage(hwnd, win.TCM_GETTOOLTIPS, 0, 0);
  817.     }
  818.  
  819.     public static int TabCtrl_HitTest (int hwndTC, TCHITTESTINFO pinfo)
  820.     {
  821.         return User32.SendMessage(hwndTC, win.TCM_HITTEST, 0, pinfo);
  822.     }
  823.  
  824.     public static int TabCtrl_InsertItem (int hwnd, int iItem, TCITEM pItem)
  825.     {
  826.         return User32.SendMessage(hwnd, win.TCM_INSERTITEM, iItem, pItem);
  827.     }
  828.  
  829.     public static void TabCtrl_RemoveImage (int hwnd, int i)
  830.     {
  831.         User32.SendMessage(hwnd, win.TCM_REMOVEIMAGE, i, 0);
  832.     }
  833.  
  834.     public static int TabCtrl_SetCurFocus (int hwnd, int i)
  835.     {
  836.         return User32.SendMessage(hwnd, win.TCM_SETCURFOCUS, i, 0);
  837.     }
  838.  
  839.     public static int TabCtrl_SetCurSel (int hwnd, int i)
  840.     {
  841.         return User32.SendMessage(hwnd, win.TCM_SETCURSEL, i, 0);
  842.     }
  843.  
  844.     public static int TabCtrl_SetImageList (int hwnd, int himl)
  845.     {
  846.         return User32.SendMessage(hwnd, win.TCM_SETIMAGELIST, 0, himl);
  847.     }
  848.  
  849.     public static boolean TabCtrl_SetItem (int hwnd, int iItem, TCITEM pItem)
  850.     {
  851.         return 0 != User32.SendMessage(hwnd, win.TCM_SETITEM, iItem, pItem);
  852.     }
  853.  
  854.     public static boolean TabCtrl_SetItemExtra (int hwndTC, int cb)
  855.     {
  856.         return 0 != User32.SendMessage(hwndTC, win.TCM_SETITEMEXTRA, cb, 0);
  857.     }
  858.  
  859.     public static int TabCtrl_SetItemSize (int hwnd, short x, short y)
  860.     {
  861.         return User32.SendMessage(hwnd, win.TCM_SETIMAGELIST, 0, (((int) x) & 0xffff) | (((int) y)<<16));
  862.     }
  863.  
  864.     public static int TabCtrl_SetMinTabWidth (int hwnd, int x)
  865.     {
  866.         return User32.SendMessage(hwnd, win.TCM_SETMINTABWIDTH, 0, x);
  867.     }
  868.  
  869.     public static void TabCtrl_SetPadding (int hwnd, short cx, short cy)
  870.     {
  871.         User32.SendMessage(hwnd, win.TCM_SETPADDING, 0, (((int) cx) & 0xffff) | (((int) cy)<<16));
  872.     }
  873.  
  874.     public static void TabCtrl_SetToolTips (int hwnd, int hwndTT)
  875.     {
  876.         User32.SendMessage(hwnd, win.TCM_SETTOOLTIPS, hwndTT, 0);
  877.     }
  878.  
  879.     public static int TreeView_CreateDragImage (int hwnd, int hitem)
  880.     {
  881.         return User32.SendMessage(hwnd, win.TVM_CREATEDRAGIMAGE, 0, hitem);
  882.     }
  883.  
  884.     public static boolean TreeView_DeleteAllItems (int hwnd)
  885.     {
  886.         return 0 != User32.SendMessage(hwnd, win.TVM_DELETEITEM, 0, win.TVI_ROOT);
  887.     }
  888.  
  889.     public static boolean TreeView_DeleteItem (int hwnd, int hitem)
  890.     {
  891.         return 0 != User32.SendMessage(hwnd, win.TVM_DELETEITEM, 0, hitem);
  892.     }
  893.  
  894.     public static int TreeView_EditLabel(int hwnd, int hitem)
  895.     {
  896.         return User32.SendMessage(hwnd, win.TVM_EDITLABEL, 0, hitem);
  897.     }
  898.  
  899.     public static boolean TreeView_EndEditLabelNow (int hwnd, int fCancel)
  900.     {
  901.         return 0 != User32.SendMessage(hwnd, win.TVM_ENDEDITLABELNOW, fCancel, 0);
  902.     }
  903.  
  904.     public static boolean TreeView_EnsureVisible (int hwnd, int hitem)
  905.     {
  906.         return 0 != User32.SendMessage(hwnd, win.TVM_ENSUREVISIBLE, 0, hitem);
  907.     }
  908.  
  909.     public static boolean TreeView_Expand (int hwnd, int hitem, int code)
  910.     {
  911.         return 0 != User32.SendMessage(hwnd, win.TVM_EXPAND, code, hitem);
  912.     }
  913.  
  914.     public static int TreeView_GetChild(int hwnd, int hitem)
  915.     {
  916.         return TreeView_GetNextItem(hwnd, hitem, win.TVGN_CHILD);
  917.     }
  918.  
  919.     public static int TreeView_GetCount (int hwnd)
  920.     {
  921.         return User32.SendMessage(hwnd, win.TVM_GETCOUNT, 0, 0);
  922.     }
  923.  
  924.     public static int TreeView_GetDropHilight(int hwnd)
  925.     {
  926.         return TreeView_GetNextItem(hwnd, win.NULL, win.TVGN_DROPHILITE);
  927.     }
  928.  
  929.     public static int TreeView_GetEditControl (int hwnd)
  930.     {
  931.         return User32.SendMessage(hwnd, win.TVM_GETEDITCONTROL, 0, 0);
  932.     }
  933.  
  934.     public static int TreeView_GetFirstVisible(int hwnd)
  935.     {
  936.         return TreeView_GetNextItem(hwnd, win.NULL, win.TVGN_FIRSTVISIBLE);
  937.     }
  938.  
  939.     public static int TreeView_GetImageList (int hwnd, int iImage)
  940.     {
  941.         return User32.SendMessage(hwnd, win.TVM_GETIMAGELIST, iImage, 0);
  942.     }
  943.  
  944.     public static int TreeView_GetIndent (int hwnd)
  945.     {
  946.         return User32.SendMessage(hwnd, win.TVM_GETINDENT, 0, 0);
  947.     }
  948.  
  949.     public static int TreeView_GetISearchString (int hwndTV, StringBuffer lpsz)
  950.     {
  951.         return User32.SendMessage(hwndTV, win.TVM_GETISEARCHSTRING, 0, lpsz);
  952.     }
  953.  
  954.     public static boolean TreeView_GetItem (int hwnd, TV_ITEM pitem)
  955.     {
  956.         return 0 != User32.SendMessage(hwnd, win.TVM_GETITEM, 0, pitem);
  957.     }
  958.  
  959.     public static boolean TreeView_GetItemRect (int hwnd, int hitem, RECT prc, int code)
  960.     {
  961.         prc.left = hitem;
  962.         return 0 != User32.SendMessage(hwnd, win.TVM_GETITEMRECT, code, prc);
  963.     }
  964.  
  965.     public static int TreeView_GetNextItem (int hwnd, int hitem, int code)
  966.     {
  967.         return User32.SendMessage(hwnd, win.TVM_GETNEXTITEM, code, hitem);
  968.     }
  969.  
  970.     public static int TreeView_GetNextSibling(int hwnd, int hitem)
  971.     {
  972.         return TreeView_GetNextItem(hwnd, hitem, win.TVGN_NEXT);
  973.     }
  974.  
  975.     public static int TreeView_GetNextVisible(int hwnd, int hitem)
  976.     {
  977.         return TreeView_GetNextItem(hwnd, hitem, win.TVGN_NEXTVISIBLE);
  978.     }
  979.  
  980.     public static int TreeView_GetParent(int hwnd, int hitem)
  981.     {
  982.         return TreeView_GetNextItem(hwnd, hitem, win.TVGN_PARENT);
  983.     }
  984.  
  985.     public static int TreeView_GetPrevSibling(int hwnd, int hitem)
  986.     {
  987.         return TreeView_GetNextItem(hwnd, hitem, win.TVGN_PREVIOUS);
  988.     }
  989.  
  990.     public static int TreeView_GetPrevVisible(int hwnd, int hitem)
  991.     {
  992.         return TreeView_GetNextItem(hwnd, hitem, win.TVGN_PREVIOUSVISIBLE);
  993.     }
  994.  
  995.     public static int TreeView_GetRoot(int hwnd)
  996.     {
  997.         return TreeView_GetNextItem(hwnd, win.NULL, win.TVGN_ROOT);
  998.     }
  999.  
  1000.     public static int TreeView_GetSelection(int hwnd)
  1001.     {
  1002.         return TreeView_GetNextItem(hwnd, win.NULL, win.TVGN_CARET);
  1003.     }
  1004.  
  1005.     public static int TreeView_GetVisibleCount (int hwnd)
  1006.     {
  1007.         return User32.SendMessage(hwnd, win.TVM_GETVISIBLECOUNT, 0, 0);
  1008.     }
  1009.  
  1010.     public static int TreeView_HitTest (int hwnd, TV_HITTESTINFO lpht)
  1011.     {
  1012.         return User32.SendMessage(hwnd, win.TVM_HITTEST, 0, lpht);
  1013.     }
  1014.  
  1015.     public static int TreeView_InsertItem (int hwnd, TV_INSERTSTRUCT lpis)
  1016.     {
  1017.         return User32.SendMessage(hwnd, win.TVM_INSERTITEM, 0, lpis);
  1018.     }
  1019.  
  1020.     public static int TreeView_Select(int hwnd, int hitem, int code)
  1021.     {
  1022.         return User32.SendMessage(hwnd, win.TVM_SELECTITEM, code, hitem);
  1023.     }
  1024.  
  1025.     public static int TreeView_SelectDropTarget(int hwnd, int hitem)
  1026.     {
  1027.         return TreeView_Select(hwnd, hitem, win.TVGN_DROPHILITE);
  1028.     }
  1029.  
  1030.     public static int TreeView_SelectItem(int hwnd, int hitem)
  1031.     {
  1032.         return TreeView_Select(hwnd, hitem, win.TVGN_CARET);
  1033.     }
  1034.  
  1035.     public static int TreeView_SelectSetFirstVisible(int hwnd, int hitem)
  1036.     {
  1037.         return TreeView_Select(hwnd, hitem, win.TVGN_FIRSTVISIBLE);
  1038.     }
  1039.  
  1040.     public static int TreeView_SetImageList (int hwnd, int himl, int iImage)
  1041.     {
  1042.         return User32.SendMessage(hwnd, win.TVM_SETIMAGELIST, iImage, himl);
  1043.     }
  1044.  
  1045.     public static boolean TreeView_SetIndent (int hwnd, int indent)
  1046.     {
  1047.         return 0 != User32.SendMessage(hwnd, win.TVM_SETINDENT, indent, 0);
  1048.     }
  1049.  
  1050.     public static boolean TreeView_SetItem (int hwnd, TV_ITEM pitem)
  1051.     {
  1052.         return 0 != User32.SendMessage(hwnd, win.TVM_SETITEM, 0, pitem);
  1053.     }
  1054.  
  1055.     public static boolean TreeView_SortChildren (int hwnd, int hitem, int recurse)
  1056.     {
  1057.         return 0 != User32.SendMessage(hwnd, win.TVM_SORTCHILDREN, recurse, hitem);
  1058.     }
  1059.  
  1060.     public static boolean TreeView_SortChildrenCB (int hwnd, TV_SORTCB psort, int recurse)
  1061.     {
  1062.         return 0 != User32.SendMessage(hwnd, win.TVM_SORTCHILDRENCB, recurse, psort);
  1063.     }
  1064.  
  1065.     /** @dll.import("COMCTL32", auto) */
  1066.     public native static boolean _TrackMouseEvent (TRACKMOUSEEVENT lpEventTrack);
  1067. }
  1068.  
  1069.