Example #1
0
        protected override void WndProc(ref Message m)
        {
            switch (m.Msg)
            {
            case WM_DRAWCLIPBOARD:
            {
                SendMessage(mNextClipBoardViewerHWnd, m.Msg, m.WParam.ToInt32(), m.LParam.ToInt32());
                ClipboardDataMan.ReadClipboard();
                break;
            }

            case WM_CHANGECBCHAIN:
            {
                //Another clipboard viewer has removed itself...
                if (m.WParam == (IntPtr)mNextClipBoardViewerHWnd)
                {
                    mNextClipBoardViewerHWnd = m.LParam;
                }
                else
                {
                    SendMessage(mNextClipBoardViewerHWnd, m.Msg, m.WParam.ToInt32(), m.LParam.ToInt32());
                }
                break;
            }
            }
            base.WndProc(ref m);
        }
Example #2
0
 private void 清空ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ClipboardDataMan.Clear();
 }
Example #3
0
 private void BTSearch_Click(object sender, EventArgs e)
 {
     ClipboardDataMan.Search(TBSearch.Text);
 }
Example #4
0
 private void DGVList_Select(int index)
 {
     if (index >= 0 && index < DGVList.RowCount)
     {
         string        id   = DGVList.Rows[index].Cells["COLId"].Value.ToString();
         ClipboardData data = ClipboardDataMan.Get(id);
         if (data != null)
         {
             TBText.Clear();
             PBImage.Image = null;
             DGVData.Rows.Clear();
             DGVData.Columns.Clear();
             //显示信息大小
             TSSLDataSize.Text = ByteConvertTool.Fmt(data.Size);
             //设置富文本
             //if (data.RichText != null)
             //{
             //    try
             //    {
             //        using (Stream s = new MemoryStream())
             //        {
             //            s.Position = 0;
             //            s.Write(data.RichText, 0, data.RichText.Length);
             //            s.Position = 0;
             //            RTBRich.LoadFile(s, RichTextBoxStreamType.RichText);
             //        }
             //    }
             //    catch (Exception e) { }
             //}
             //设置纯文本
             if (data.Text != null)
             {
                 //TCData.SelectTab("TPText");
                 TBText.AppendText(data.Text);
             }
             //设置表格
             if (data.Text != null)
             {
                 string[] rows = data.Text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
                 foreach (var _r in rows)
                 {
                     string[] _d = _r.Split('\t');
                     if (ListTool.HasElements(_d))
                     {
                         if (DGVData.Columns.Count < _d.Length)
                         {
                             for (int i = DGVData.Columns.Count; i < _d.Length; i++)
                             {
                                 DGVData.Columns.Add($"DGVData_COL{i}", $"{i + 1}");
                             }
                         }
                         DGVData.Rows.Add(_d);
                     }
                 }
             }
             //设置图片
             if (data.Image != null)
             {
                 //TCData.SelectTab("TPImage");
                 PBImage.Image = data.Image;
                 PBImage.Update();
             }
         }
     }
 }