xj qian
2024-07-01 2ae36e271599ea723348132dd7c8a7e139162d18
jrj/xframe/xcontrol/xcombobox.hpp
@@ -18,133 +18,133 @@
public:
    int GetCurSel()
    {
        int CB_GETCURSEL  = 0x0147;
        return SendMessage(GetHWND(),CB_GETCURSEL,0,0);
        int CB_GETCURSEL_  = 0x0147;
        return SendMessage(GetHWND(),CB_GETCURSEL_,0,0);
    }
    int SetCurSel( int nIndex)
    {
        int CB_SETCURSEL  = 0x014E;
        return SendMessage(GetHWND(),CB_SETCURSEL,nIndex,0);
        int CB_SETCURSEL_  = 0x014E;
        return SendMessage(GetHWND(),CB_SETCURSEL_,nIndex,0);
    }
            
    int GetCount()
    {
        int CB_GETCOUNT = 0x0146;
        return SendMessage(GetHWND(),CB_GETCOUNT,0,0);
        int CB_GETCOUNT_ = 0x0146;
        return SendMessage(GetHWND(),CB_GETCOUNT_,0,0);
    }
            
   string GetLBText(int nIndex)
    {
        int CB_GETLBTEXT    =  0x0148;
        int CB_GETLBTEXTLEN  =  0x0149;
        int nLen = SendMessage(GetHWND(),CB_GETLBTEXTLEN ,nIndex,0);
        int CB_GETLBTEXT_    =  0x0148;
        int CB_GETLBTEXTLEN_  =  0x0149;
        int nLen = SendMessage(GetHWND(),CB_GETLBTEXTLEN_ ,nIndex,0);
        string str = new wchar_t[nLen+1];
        SendMessage(GetHWND(),CB_GETLBTEXT ,nIndex, (LPARAM)str);
        SendMessage(GetHWND(),CB_GETLBTEXT_ ,nIndex, (LPARAM)str);
        return str;
    }
   string GetLBText()
    {
        int CB_GETLBTEXT    =  0x0148;
        int CB_GETLBTEXTLEN  =  0x0149;
        int CB_GETLBTEXT_    =  0x0148;
        int CB_GETLBTEXTLEN_  =  0x0149;
        int nIndex = GetCurSel();
        int nLen = SendMessage(GetHWND(),CB_GETLBTEXTLEN ,nIndex,0);
        int nLen = SendMessage(GetHWND(),CB_GETLBTEXTLEN_ ,nIndex,0);
         string str = new wchar_t[nLen+1];
        SendMessage(GetHWND(),CB_GETLBTEXT ,nIndex, (LPARAM)str);
        SendMessage(GetHWND(),CB_GETLBTEXT_ ,nIndex, (LPARAM)str);
        return str;
    }
    int SetItemIndex(int nIndex)
    {
        int CB_SETCURSEL = 0x014E;
        return SendMessage(GetHWND(),CB_SETCURSEL ,nIndex, 0);
        int CB_SETCURSEL_ = 0x014E;
        return SendMessage(GetHWND(),CB_SETCURSEL_ ,nIndex, 0);
    }
            
   int AddItem(string str)
    {
        int CB_ADDSTRING =  0x0143;
        return SendMessage(GetHWND(),CB_ADDSTRING  ,(WPARAM)0,(LPARAM)str);
        int CB_ADDSTRING_ =  0x0143;
        return SendMessage(GetHWND(),CB_ADDSTRING_  ,(WPARAM)0,(LPARAM)str);
    }
            
   int FindString(string str)
    {
        int CB_FINDSTRINGEXACT = 0x0158;
        return SendMessage(GetHWND(),CB_FINDSTRINGEXACT,0,(LPARAM)str);
        int CB_FINDSTRINGEXACT_ = 0x0158;
        return SendMessage(GetHWND(),CB_FINDSTRINGEXACT_,0,(LPARAM)str);
    }
   int DeleteItem(int nIndex)
    {
        int CB_DELETESTRING = 0x0144;
        return SendMessage(GetHWND(),CB_DELETESTRING,nIndex,0);
        int CB_DELETESTRING_ = 0x0144;
        return SendMessage(GetHWND(),CB_DELETESTRING_,nIndex,0);
    }
   int SelectString( int nIndex,string str) 
    {
        int CB_SELECTSTRING  = 0x014D;
        return SendMessage(GetHWND(),CB_SELECTSTRING,nIndex,(LPARAM)str);
        int CB_SELECTSTRING_  = 0x014D;
        return SendMessage(GetHWND(),CB_SELECTSTRING_,nIndex,(LPARAM)str);
    }
   int InsertString( int nIndex,string str) 
    {
        int CB_INSERTSTRING  = 0x014A;
        return SendMessage(GetHWND(),CB_INSERTSTRING,nIndex,(LPARAM)str);
        int CB_INSERTSTRING_  = 0x014A;
        return SendMessage(GetHWND(),CB_INSERTSTRING_,nIndex,(LPARAM)str);
    }
   int InsertString( string str) 
    {
        int CB_INSERTSTRING  = 0x014A;
        return SendMessage(GetHWND(),CB_INSERTSTRING,0,(LPARAM)str);
        int CB_INSERTSTRING_  = 0x014A;
        return SendMessage(GetHWND(),CB_INSERTSTRING_,0,(LPARAM)str);
    }
   int ResetContent() 
    {
        int CB_RESETCONTENT  =  0x014B;
        return SendMessage(GetHWND(),CB_RESETCONTENT,0,0);
        int CB_RESETCONTENT_  =  0x014B;
        return SendMessage(GetHWND(),CB_RESETCONTENT_,0,0);
    }
   int SetItemData(int nIndex, LPARAM p) 
    {
        int CB_SETITEMDATA  =   0x0151;
        return SendMessage(GetHWND(),CB_SETITEMDATA,nIndex,p);
        int CB_SETITEMDATA_  =   0x0151;
        return SendMessage(GetHWND(),CB_SETITEMDATA_,nIndex,p);
    }
   int GetItemData() 
    {
        int CB_GETITEMDATA  =   0x0150;
        int CB_GETITEMDATA_  =   0x0150;
        int nIndex = GetCurSel();
        if(nIndex < 0) 
        return -1;
        else
        return SendMessage(GetHWND(),CB_GETITEMDATA,nIndex,0);
        return SendMessage(GetHWND(),CB_GETITEMDATA_,nIndex,0);
    }
   LPARAM GetItemData(int nIndex) 
    {
        int CB_GETITEMDATA  =   0x0150;
        return SendMessage(GetHWND(),CB_GETITEMDATA,nIndex,0);
        int CB_GETITEMDATA_  =   0x0150;
        return SendMessage(GetHWND(),CB_GETITEMDATA_,nIndex,0);
    }
   int AddItem(string str, int p)
    {
        int CB_ADDSTRING =  0x0143;
        int h = SendMessage(GetHWND(),CB_ADDSTRING  ,0,(LPARAM)str);
        int CB_ADDSTRING_ =  0x0143;
        int h = SendMessage(GetHWND(),CB_ADDSTRING_  ,0,(LPARAM)str);
        SetItemData( h, p);
        return h;
    }
   
   int AddItem(string str, string p)
    {
        int CB_ADDSTRING =  0x0143;
        int h = SendMessage(GetHWND(),CB_ADDSTRING  ,0,(LPARAM)str);
        int CB_ADDSTRING_ =  0x0143;
        int h = SendMessage(GetHWND(),CB_ADDSTRING_  ,0,(LPARAM)str);
        SetItemData( h, (LPARAM)p);
        return h;
    }
   int InsertString( string str, LPARAM p) 
    {
        int CB_INSERTSTRING  = 0x014A;
        int h =  SendMessage(GetHWND(),CB_INSERTSTRING,0,(LPARAM)str);
        int CB_INSERTSTRING_  = 0x014A;
        int h =  SendMessage(GetHWND(),CB_INSERTSTRING_,0,(LPARAM)str);
    
        SetItemData( h, p);
        return h;
@@ -154,133 +154,133 @@
   /////
   static int GetCurSel(HWND hWnd)
   {
       int CB_GETCURSEL = 0x0147;
       return SendMessage(hWnd, CB_GETCURSEL, 0, 0);
       int CB_GETCURSEL_ = 0x0147;
       return SendMessage(hWnd, CB_GETCURSEL_, 0, 0);
   }
   static int SetCurSel(HWND hWnd,int nIndex)
   {
       int CB_SETCURSEL = 0x014E;
       return SendMessage(hWnd, CB_SETCURSEL, nIndex, 0);
       int CB_SETCURSEL_ = 0x014E;
       return SendMessage(hWnd, CB_SETCURSEL_, nIndex, 0);
   }
   static int GetCount(HWND hWnd)
   {
       int CB_GETCOUNT = 0x0146;
       return SendMessage(hWnd, CB_GETCOUNT, 0, 0);
       int CB_GETCOUNT_ = 0x0146;
       return SendMessage(hWnd, CB_GETCOUNT_, 0, 0);
   }
   static string GetLBText(HWND hWnd,int nIndex)
   {
       int CB_GETLBTEXT = 0x0148;
       int CB_GETLBTEXTLEN = 0x0149;
       int nLen = SendMessage(hWnd, CB_GETLBTEXTLEN, nIndex, 0);
       int CB_GETLBTEXT_ = 0x0148;
       int CB_GETLBTEXTLEN_ = 0x0149;
       int nLen = SendMessage(hWnd, CB_GETLBTEXTLEN_, nIndex, 0);
       string str = new wchar_t[nLen + 1];
       SendMessage(hWnd, CB_GETLBTEXT, nIndex, (LPARAM)str);
       SendMessage(hWnd, CB_GETLBTEXT_, nIndex, (LPARAM)str);
       return str;
   }
   static string GetLBText(HWND hWnd)
   {
       int CB_GETLBTEXT = 0x0148;
       int CB_GETLBTEXTLEN = 0x0149;
       int CB_GETLBTEXT_ = 0x0148;
       int CB_GETLBTEXTLEN_ = 0x0149;
       int nIndex = GetCurSel(hWnd);
       int nLen = SendMessage(hWnd, CB_GETLBTEXTLEN, nIndex, 0);
       int nLen = SendMessage(hWnd, CB_GETLBTEXTLEN_, nIndex, 0);
       string str = new wchar_t[nLen + 1];
       SendMessage(hWnd, CB_GETLBTEXT, nIndex, (LPARAM)str);
       SendMessage(hWnd, CB_GETLBTEXT_, nIndex, (LPARAM)str);
       return str;
   }
   static int SetItemIndex(HWND hWnd,int nIndex)
   {
       int CB_SETCURSEL = 0x014E;
       return SendMessage(hWnd, CB_SETCURSEL, nIndex, 0);
       int CB_SETCURSEL_ = 0x014E;
       return SendMessage(hWnd, CB_SETCURSEL_, nIndex, 0);
   }
   static int AddItem(HWND hWnd,string str)
   {
       int CB_ADDSTRING = 0x0143;
       return SendMessage(hWnd, CB_ADDSTRING, (WPARAM)0, (LPARAM)str);
       int CB_ADDSTRING_ = 0x0143;
       return SendMessage(hWnd, CB_ADDSTRING_, (WPARAM)0, (LPARAM)str);
   }
   static int FindString(HWND hWnd,string str)
   {
       int CB_FINDSTRINGEXACT = 0x0158;
       return SendMessage(hWnd, CB_FINDSTRINGEXACT, 0, (LPARAM)str);
       int CB_FINDSTRINGEXACT_ = 0x0158;
       return SendMessage(hWnd, CB_FINDSTRINGEXACT_, 0, (LPARAM)str);
   }
   static int DeleteItem(HWND hWnd,int nIndex)
   {
       int CB_DELETESTRING = 0x0144;
       return SendMessage(hWnd, CB_DELETESTRING, nIndex, 0);
       int CB_DELETESTRING_ = 0x0144;
       return SendMessage(hWnd, CB_DELETESTRING_, nIndex, 0);
   }
   static int SelectString(HWND hWnd,int nIndex, string str)
   {
       int CB_SELECTSTRING = 0x014D;
       return SendMessage(hWnd, CB_SELECTSTRING, nIndex, (LPARAM)str);
       int CB_SELECTSTRING_ = 0x014D;
       return SendMessage(hWnd, CB_SELECTSTRING_, nIndex, (LPARAM)str);
   }
   static int InsertString(HWND hWnd,int nIndex, string str)
   {
       int CB_INSERTSTRING = 0x014A;
       return SendMessage(hWnd, CB_INSERTSTRING, nIndex, (LPARAM)str);
       int CB_INSERTSTRING_ = 0x014A;
       return SendMessage(hWnd, CB_INSERTSTRING_, nIndex, (LPARAM)str);
   }
   static int InsertString(HWND hWnd,string str)
   {
       int CB_INSERTSTRING = 0x014A;
       return SendMessage(hWnd, CB_INSERTSTRING, 0, (LPARAM)str);
       int CB_INSERTSTRING_ = 0x014A;
       return SendMessage(hWnd, CB_INSERTSTRING_, 0, (LPARAM)str);
   }
   int ResetContent(HWND hWnd)
   {
       int CB_RESETCONTENT = 0x014B;
       return SendMessage(hWnd, CB_RESETCONTENT, 0, 0);
       int CB_RESETCONTENT_ = 0x014B;
       return SendMessage(hWnd, CB_RESETCONTENT_, 0, 0);
   }
   static int SetItemData(HWND hWnd,int nIndex, LPARAM p)
   {
       int CB_SETITEMDATA = 0x0151;
       return SendMessage(hWnd, CB_SETITEMDATA, nIndex, p);
       int CB_SETITEMDATA_ = 0x0151;
       return SendMessage(hWnd, CB_SETITEMDATA_, nIndex, p);
   }
   static int GetItemData(HWND hWnd)
   {
       int CB_GETITEMDATA = 0x0150;
       int CB_GETITEMDATA_ = 0x0150;
       int nIndex = GetCurSel(hWnd);
       if (nIndex < 0)
           return -1;
       else
           return SendMessage(hWnd, CB_GETITEMDATA, nIndex, 0);
           return SendMessage(hWnd, CB_GETITEMDATA_, nIndex, 0);
   }
   static LPARAM GetItemData(HWND hWnd,int nIndex)
   {
       int CB_GETITEMDATA = 0x0150;
       return SendMessage(hWnd, CB_GETITEMDATA, nIndex, 0);
       int CB_GETITEMDATA_ = 0x0150;
       return SendMessage(hWnd, CB_GETITEMDATA_, nIndex, 0);
   }
   static int AddItem(HWND hWnd,string str, int p)
   {
       int CB_ADDSTRING = 0x0143;
       int h = SendMessage(hWnd, CB_ADDSTRING, 0, (LPARAM)str);
       int CB_ADDSTRING_ = 0x0143;
       int h = SendMessage(hWnd, CB_ADDSTRING_, 0, (LPARAM)str);
       SetItemData(hWnd,h, p);
       return h;
   }
   static int AddItem(HWND hWnd,string str, string p)
   {
       int CB_ADDSTRING = 0x0143;
       int h = SendMessage(hWnd, CB_ADDSTRING, 0, (LPARAM)str);
       int CB_ADDSTRING_ = 0x0143;
       int h = SendMessage(hWnd, CB_ADDSTRING_, 0, (LPARAM)str);
       SetItemData(hWnd,h, (LPARAM)p);
       return h;
   }
   static int InsertString(HWND hWnd,string str, LPARAM p)
   {
       int CB_INSERTSTRING = 0x014A;
       int h = SendMessage(hWnd, CB_INSERTSTRING, 0, (LPARAM)str);
       int CB_INSERTSTRING_ = 0x014A;
       int h = SendMessage(hWnd, CB_INSERTSTRING_, 0, (LPARAM)str);
       SetItemData(hWnd,h, p);
       return h;