小编Ale*_*x G的帖子

Win32,如何访问工具栏上的按钮

假设我有一个编译的二进制程序,它运行并在屏幕上显示一些 GUI。我需要从 Win32 中的另一个程序访问其工具栏,找到一个按钮并单击它。

我知道如何找到工具栏的 Hwnd,但我真的不知道如何枚举它上面的按钮。任何想法如何在 Win32 调用中做到这一点?

有没有像 Spy++ 这样的工具可以在工具栏下显示按钮句柄?Spy++ 不这样做。

谢谢

winapi

2
推荐指数
1
解决办法
4616
查看次数

使用 Reflection.Emit 以编程方式为现有类属性添加新属性

我正在尝试以编程方式在类成员之上添加新属性......

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;

namespace Test11
{

public class SomeAttribute : Attribute
{
    public SomeAttribute(string value)
    {
        this.Value = value;
    }

    public string Value { get; set; }
}


// for attribute to be injected the property should be "virtual"
public class ClassA
{
    public virtual int Value { get; set; }
}

public class Test
{
    public static void Func()
    {

        var type = typeof(ClassA);

        var aName = …
Run Code Online (Sandbox Code Playgroud)

c# reflection.emit

2
推荐指数
1
解决办法
1047
查看次数

标签 统计

c# ×1

reflection.emit ×1

winapi ×1