getGetWindowText 获取不到值

问题描述 投票:0回答:0

有没有人可以帮助我?

我检查了几次,我的手感没问题。并且经过测试可以SengMessage

但是在进行下一步的时候,发现getGetWindowText获取不到值。为什么getGetWindowText取不到值?

代码:

[DllImport("user32.dll", EntryPoint = "GetWindowText")]
public static extern int GetWindowText(IntPtr hwnd, string lpString, int cch);

private void timer1_Tick(object sender, EventArgs e)
{
    string s = "";
    int i = GetWindowText(curr_hWnd, s, 10);
    if (s != "")
    {
        this.timer1.Stop();
        MessageBox.Show(s);
    }
}

有没有人可以帮助我?

c# visual-studio handle
© www.soinside.com 2019 - 2024. All rights reserved.