===破了一个屏幕取 词(GetWord),谁告诉我怎么在C#引用它的.dll===

liuweijack 2018-03-07 08:54:47


链接: https://pan.baidu.com/s/1HU5erMsuse3jSt4DGUeDBA 密码: 9gy4
...全文
1032 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
threenewbee 2018-03-09
  • 打赏
  • 举报
回复
引用 4 楼 liuweijack 的回复:
[quote=引用 3 楼 caozhy 的回复:] 不是有官网么?问开发者啊
破解的能给你提供支持?[/quote] 谁破解的你找他去啊。破解的问题这里不允许讨论。
shoppo0505 2018-03-08
  • 打赏
  • 举报
回复
rar文件解不开么
泡泡龙 2018-03-08
  • 打赏
  • 举报
回复
开放一下源代码呗,省的反编译太乱了
吉普赛的歌 2018-03-08
  • 打赏
  • 举报
回复
有木马, 小心了!
liuweijack 2018-03-08
  • 打赏
  • 举报
回复 1


链接: https://pan.baidu.com/s/1UMMkD7XSfBk8_n5CUqwTtw
密码: agcp
liuweijack 2018-03-08
  • 打赏
  • 举报
回复


搞定!结贴。。。
橘子皮... 2018-03-08
  • 打赏
  • 举报
回复
复杂一点的可以识别么???
liuweijack 2018-03-08
  • 打赏
  • 举报
回复
引用 3 楼 caozhy 的回复:
不是有官网么?问开发者啊
破解的能给你提供支持?
threenewbee 2018-03-07
  • 打赏
  • 举报
回复
不是有官网么?问开发者啊
秋的红果实 2018-03-07
  • 打赏
  • 举报
回复
你也不了解人家的dll是用什么写的,不好弄 即使能正确引用dll也不一定能调用原来的功能,功能不一定都在dll内,还有人家的exe呢
liuweijack 2018-03-07
  • 打赏
  • 举报
回复
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace CSharp
{
    public partial class Form1 : Form
    {
        const string LICENSEID = "{00000000-0000-0000-0000-000000000000}";
        const string MOUSEHOOK_CAPTURE_OK_MSG = "MOUSEHOOK_CAPTUREOK_MSG-" + LICENSEID;
        const string HIGHLIGHT_CAPTURE_OK_MSG = "HIGHLIGHT_CAPTUREOK_MSG_XUFU_V1-" + LICENSEID;
        const int MOD_ALT = 0x0001;
        const int MOD_CONTROL = 0x0002;
        const int MOD_SHIFT = 0x0004;
        const int MOD_WIN = 0x0008;
        const int VK_LBUTTON = 0x01;
        const int VK_RBUTTON = 0x02;
        const int VK_MBUTTON = 0x04;

        const int SW_HIDE = 0;
        const int SW_SHOW = 5;
        UInt32 MOUSEHOOK_CAPTURE_OK = 0;
        UInt32 HIGHLIGHT_CAPTURE_OK = 0;
        const int HOTKEY_CAPTURE = 1000;
        const int MAX_OUTPUT_LEN = 4096;

        const int WM_HOTKEY = 0x0312;

        bool bGetWordUnloaded = false;

        [DllImport("user32.dll")]
        static extern uint RegisterWindowMessage(string lpString);

        [DllImport("user32.dll", SetLastError = true)]
        public static extern bool RegisterHotKey(IntPtr hWnd, int id, UInt32 fsModifiers, Keys vk);

        [DllImport("user32.dll", SetLastError = true)]
        public static extern bool UnregisterHotKey(IntPtr hWnd, int id);

        [DllImport("user32.dll", EntryPoint = "GetCursorPos")]
        public extern static bool GetCursorPos(out System.Drawing.Point lpPoint);

        [DllImport("user32.dll", EntryPoint = "ShowWindow", CharSet = CharSet.Auto)]
        public static extern int ShowWindow(IntPtr hwnd, int nCmdShow);

        [DllImport("kernel32.dll", EntryPoint = "Sleep")]
        public static extern void Sleep(int uMilliSec);

        [DllImport("kernel32.dll", EntryPoint = "FreeLibrary")]
        public static extern int FreeLibrary(int hLibModule);

        [DllImport("kernel32.dll", EntryPoint = "GetModuleHandle")]
        public static extern int GetModuleHandle(string lpModuleName);

        [DllImport("Oleaut32.dll", EntryPoint = "SysFreeString")]
        public static extern Int32 SysFreeString(string str);

        [DllImport("ICall.dll")]
        public static extern Int32 GetRealWindow(Int32 x, Int32 y);

        [DllImport("ICall.dll")]
        public static extern bool GetWord(Int32 hWndCap, Int32 x, Int32 y, [MarshalAs(UnmanagedType.LPWStr)] string pwstrout, Int32 nBufLen, ref Int32 nCursorPos);
        
        [DllImport("ICall.dll")]
        public static extern bool GetRectWord(Int32 hWndCap, Int32 left, Int32 top, Int32 right, Int32 bottom, [MarshalAs(UnmanagedType.LPWStr)] string pwstrout, Int32 nBufLen);

         [DllImport("ICall.dll")]
        public static extern bool GetWordEnableCap(bool bEnable);

        [DllImport("ICall.dll")]
        public static extern bool SetMouseHook(Int32 hWndNotify);

        [DllImport("ICall.dll")]
        public static extern bool RemoveMouseHook();

        [DllImport("ICall.dll")]
        public static extern void MouseSetDelay(Int32 uMilliSec);

        [DllImport("ICall.dll")]
        public static extern bool MouseEnableCap(bool Enable);

        [DllImport("ICall.dll")]
        public static extern bool GetHighlightText(Int32 hWndCap, [MarshalAs(UnmanagedType.BStr)] out string pwstrout);

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // register the message so that we can get the notification from mouse moving
        	MOUSEHOOK_CAPTURE_OK = RegisterWindowMessage(MOUSEHOOK_CAPTURE_OK_MSG);
            HIGHLIGHT_CAPTURE_OK = RegisterWindowMessage(HIGHLIGHT_CAPTURE_OK_MSG);

	        // set the global mouse hook
	        SetMouseHook(Handle.ToInt32());
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            bGetWordUnloaded = true;

            // unregister hotkey
            UnregisterHotKey(Handle, HOTKEY_CAPTURE);

            // remove the global mouse hook
            RemoveMouseHook();

            int dllhwnd = GetModuleHandle("ICall.dll");
            FreeLibrary(dllhwnd);
        }

		private void CaptureText()
		{
            // enable GetWord engine
            MouseEnableCap(true);
	        GetWordEnableCap(true);

			System.Drawing.Point ptCursor;
	        GetCursorPos(out ptCursor);

	        int nCursorPos = -1;
	        bool bOK = false;
            Int32 hWndCap = GetRealWindow(ptCursor.X, ptCursor.Y);
        	Char[] wstrOut = new Char[MAX_OUTPUT_LEN];
            string strtmp = new string(wstrOut);

            bOK = GetWord(hWndCap, ptCursor.X, ptCursor.Y,
                          strtmp, MAX_OUTPUT_LEN, ref nCursorPos);

	        if (bOK)	
	        {
                string strTotal = strtmp;
                textBoxAll.Text = strTotal;
                textBoxCursorPos.Text = nCursorPos.ToString();
		        
		        if (nCursorPos>=0)
		        {
                    string strCursor = strTotal.Substring(nCursorPos);
                    strCursor.TrimStart(null);
                    textBoxCursor.Text = strCursor;
		        }
		        else
		        {
			        textBoxCursor.Text = "";	
		        }
	        }
	        else					// failed 
	        {
	        }

            // disable GetWord engine
	        GetWordEnableCap(false);

	        // disable text-capturing with mouse cursor
	        MouseEnableCap(false);
		}

        private void CaptureHighlightText(IntPtr wParam, IntPtr lParam)
        {
            // enable GetWord engine
            MouseEnableCap(true);
            GetWordEnableCap(true);

            System.Drawing.Point ptCursor;
            GetCursorPos(out ptCursor);

            Int32 hWndCap = GetRealWindow(ptCursor.X, ptCursor.Y);

            bool bOK = false;
            string pbstr = "";
            bOK = GetHighlightText(hWndCap, out pbstr);

            if (bOK)
            {
                textHighlight.Text = pbstr;

                SysFreeString(pbstr);

            }
            else					// failed 
            {
                textHighlight.Text = "";
            }

            // disable GetWord engine
            GetWordEnableCap(false);

            // disable text-capturing with mouse cursor
            MouseEnableCap(false);
        }

        #region Window Procedure

        protected override void WndProc(ref Message msg)
        {
            if (!bGetWordUnloaded)
            {
                if (msg.Msg == WM_HOTKEY || msg.Msg == MOUSEHOOK_CAPTURE_OK)
                    CaptureText();
                else if (msg.Msg == HIGHLIGHT_CAPTURE_OK)
                    CaptureHighlightText(msg.WParam, msg.LParam);
            }

            base.WndProc(ref msg);
        }

        #endregion Window Procedure

        private void checkCursor_CheckedChanged(object sender, EventArgs e)
        {
            if (checkCursor.Checked)
            {
                timer.Start();
            }
            else
            {
                timer.Stop();
                MouseEnableCap(false);
            }

            checkHighlight.Checked = checkCursor.Checked;
        }

        private void checkHighlight_CheckedChanged(object sender, EventArgs e)
        {
            if (checkHighlight.Checked)
            {
                timer.Start();
            }
            else
            {
                timer.Stop();
                MouseEnableCap(false);
            }

            checkCursor.Checked = checkHighlight.Checked;
        }    

        private void checkHotkey_CheckedChanged(object sender, EventArgs e)
        {
            if (checkHotkey.Checked)
            {
		        // register hotkey
                RegisterHotKey(Handle, HOTKEY_CAPTURE, MOD_CONTROL|MOD_ALT, Keys.P);
	        }
	        else
	        {
		        // unregister hotkey
                UnregisterHotKey(Handle, HOTKEY_CAPTURE);
	        }
        }

        private void buttonCapture_Click(object sender, EventArgs e)
        {
            if (bGetWordUnloaded)
                return;

            int left, top, right, bottom;
            left = int.Parse(textBoxLeft.Text);
	        top = int.Parse(textBoxTop.Text);
	        right = int.Parse(textBoxRight.Text);
	        bottom = int.Parse(textBoxBottom.Text);

	        ShowWindow(this.Handle, SW_HIDE);
	        Sleep(100);

            GetWordEnableCap(true);

            //if want to capture a specified window, pass in the window handle
            //and the client rectangle of this window
            //if want to capture all the windows in a rectangle, pass in a 0 for
            //the window handle, and the screen rectangle
	        bool bOK = false;
            Char[] wstrOut = new Char[MAX_OUTPUT_LEN];
            string strtmp = new string(wstrOut);
            bOK = GetRectWord(0, left, top, right, bottom, strtmp, MAX_OUTPUT_LEN);
            if (bOK)	
            {
                textBoxRect.Text = strtmp;                
            }
            else					// failed 
            {
                textBoxRect.Text = "";
            }

            GetWordEnableCap(false);

            ShowWindow(this.Handle, SW_SHOW);
        }

        private void timer_Tick(object sender, EventArgs e)
        {
            MouseEnableCap(true);
        }

    }
}
3.3版的原码,官方发布的。 现在都5.0版了,3.3在win10编译不了 官方现在没发布5.0示例源码 只有它网站有一个API引用指南 http://www.textcapture.com/gb/api.htm

110,533

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧