首页 \ 问答 \ 如何获得具有相同类名的不同控件的句柄?(How to get handles of different controls with the same class name ?)

如何获得具有相同类名的不同控件的句柄?(How to get handles of different controls with the same class name ?)

我试图使用delphi编程访问第三方应用程序的“文本框”,因此我需要使用FindWindowEx(...)函数找到每个“文本框”的句柄。

问题是,由于所有文本框都具有与“无窗口名称”相同的类名,因此此函数可以给我第一个TextBOx句柄!

如何在没有名字的情况下获取文本框句柄的其余部分?

提前致谢。


I'm trying to access a third party application's "Text Boxes" using delphi programming so I need to find the handle of each "Text Box" using FindWindowEx(...) function .

The problem is , as all text boxes have the same class name with "NO window name" this function can just give me the first TextBOx handle !

How can I get the rest of text boxes handles while they have no names ?

Thanks in advance.


原文:https://stackoverflow.com/questions/10655133
更新时间:2021-12-26 16:12

最满意答案

代替

int vector[1000];

你可以将你的'vector`声明为

int* vector;

现在为vector分配一些内存,做

vector = (int*) malloc( 1000 * sizeof(int) ) ;

别忘了做, free( vector ) ; 当你不再需要vector


Instead of

int vector[1000];,

you can declare your 'vector` as

int* vector;.

Now to allocate some memory to vector, do

vector = (int*) malloc( 1000 * sizeof(int) ) ;.

Do not forget to do, free( vector ) ; when you don't need vector anymore.

相关问答

更多
  • 在ISO标准C ++中,没有从任何函数指针类型到任何对象指针类型的隐式转换。 所以这条线是不正确的。 void* test1 = callback; 对于编译器在没有诊断的情况下接受这个是错误1 (你确实启用了警告,对吗?) 标准C ++中禁止在任何对象指针类型和函数指针类型(任一方向)之间使用static_cast 。 控制规则见5.2.9: 否则, static_cast将执行下面列出的转换之一。 不能使用static_cast明确执行其他转换。 由于上面或下面的规则都没有讨论函数指针强制转换,因此禁 ...
  • 我不知道h2py,但你可能想看'ctypes'和'ctypeslib'。 ctypes包含在python 2.5+中,目标是创建与c-structs的二进制兼容性。 如果你添加了ctypeslib,你会得到一个名为codegen的子工具,它有一个'h2xml.py'脚本和一个'xml2py.py',它们的组合将自动生成你正在从C ++中寻找的Python代码头。 ctypeslib: http ://pypi.python.org/pypi/ctypeslib/0.5.4a h2xml.py将需要另一个名为 ...
  • 代替 int vector[1000]; , 你可以将你的'vector`声明为 int* vector; 。 现在为vector分配一些内存,做 vector = (int*) malloc( 1000 * sizeof(int) ) ; 。 别忘了做, free( vector ) ; 当你不再需要vector 。 Instead of int vector[1000];, you can declare your 'vector` as int* vector;. Now to allocate so ...
  • 您必须将指向结构的指针转换为void *而不是结构本身。 试试这种方式 client->trytoprint(age, (void *) &name)); You have to convert a pointer to structure to void* not a structure itself. Try this way client->trytoprint(age, (void *) &name));
  • 要从NSMutableArray中获取元素,必须使用-objectAtIndex: . a[i]语法不适用于NSArrays。 EmailServiceSvc_Email* eml = [arrEmails objectAtIndex:indexPath.row]; To get an element out of an NSMutableArray you must use -objectAtIndex:. The a[i] syntax does not work with NSArrays. Ema ...
  • 可以使用reinterpret_cast (*)将T^转换为其对应的指针类型T* 。 最简单,最正确的代码是将T^转换为Object^然后转换为IInspectable* : IInspectable* AsInspectable(Platform::Object^ o) { return reinterpret_cast(o); } IInspectable*可以转换为void* ,虽然你需要注意COM生命周期规则(我不知道你打算用这个void*做什么,所以我不能在 ...
  • 首先,当您使用POST方法时,我认为您是全局的csrf中间件,所以无论何时请求POST方法,您都必须将csrf令牌与您的请求一起传递。 为此,您可以将csrf标记添加到元 在你的jQuery代码中 $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('conten ...
  • Q1:是的,但它是实现定义的(=平台依赖)这是否有效。 一个更安全的版本将使用uintptr_t而不是long 。 Q2:风格绝对不好。 通过分配long并传递地址,正确地执行此操作不会有太多性能损失。 Q1: yes, but it is implementation defined (= platform depending) whether this will work. A version that would be a bit safer would use uintptr_t instead o ...
  • 您可以考虑将整个班级设为模板,如下所示: template class Foo { private: T *data; public: Foo(size_t size_): data{new T[size]} { } ~Foo() { delete[] data; } }; 这里的实施只是部分的。 请参阅有关规则3,5,0的内容。 或者使用托管指针: template ...
  • float和double与整数类型不兼容,你不能将它们转换为指针,你想要的是在堆栈上使用float,或者指向浮点数的指针: float *f = malloc(sizeof *f); *f = n; push(stk, f); 要使用堆栈上的元素,请将其转换回: float *f = pop(stk); // I assume your pop function returns a void * float n = *f; // n is the number your pushed float a ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)