如何获得具有相同类名的不同控件的句柄?(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
最满意答案
代替
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 needvector
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));
-
无法转换为指针类型(Cannot convert to a pointer type)[2023-04-02]
要从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 ...
-
在赋值中转换指针类型(convert pointer type in assignment)[2022-07-19]
您可以考虑将整个班级设为模板,如下所示: templateclass 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 ...