如何在不使用C ++的线程或循环的情况下进行操作(执行功能/代码) [英] How to make to do (make a function/code) without using a thread or loop in C++

查看:97
本文介绍了如何在不使用C ++的线程或循环的情况下进行操作(执行功能/代码)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个钩子应用程序,该应用程序将接收其编辑框(XP系统计算器)上显示的所有数据.挂钩进行得很顺利,除了我使用线程获取其编辑框数据.我知道有一种无需使用循环/线程即可获取它的方法,但我只是无法弄清楚如何做到这一点. 回叫???(我不确定)我尝试使用诸如WindowProcPreTranslateMessage之类的窗口消息.但是我无法设置或GetWindowText-我观察到,也许是因为我的组件是手动创建的(硬编码的),因为当我使用拖放的项目时,我可以设置/获取WindowText(但是我被限制使用硬编码).无论如何,我只需要从 YOU 中知道的是如何使不使用公共循环(for,while等)或线程的函数/代码.请帮助.....非常感谢.
请提供示例代码,以便我掌握这些概念.谢谢.

I have hooking application that takes whatever data it shows on its edit box (XP system calculator). Hooking has gone well, except that I used thread to get the its edit box data. I am aware that there''s a way to get it without using loops/thread but I just can''t figure it out how. CALLBACKs???(I''m not sure) I tried using Window Messages like: WindowProc or PreTranslateMessage. But I can''t Set or GetWindowText - I observed, maybe because, my components were manually created (hard coded), since when I use a dragged&dropped item, I can set/getWindowText (But I am contrained to use Hard Code). Anyway, all I just need to know from YOU is how to make that function/code that don''t use common loops (for, while, etc) or threads. Please help.....thanks a lot.
Please provide sample code so that I''ll grasp the concepts. Thanks.

推荐答案

我不知道你在问什么.如果需要外观,为什么不使用循环呢?您是说要在文本框更改时从文本框中获取数据吗?您可以订阅文本框的文本更改事件吗?这是知道何时更改文本的唯一方法,否则,您需要一个循环或计时器或一些东西来保持随机轮询.
I have no idea what you''re asking. Why not use a loop, if a look is what you need ? Do you mean you want to get the data from the textbox when it changes ? Can you subscribe to the text changed event for the textbox ? That''s the only way to know when the text changed, otherwise, you need a loop or a timer or something to keep polling at random.


这篇关于如何在不使用C ++的线程或循环的情况下进行操作(执行功能/代码)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆