如何捕获从主应用程序调用的其他形式的控件上的鼠标事件??? [英] How to catch mouse event of control on other form called from main application???

查看:106
本文介绍了如何捕获从主应用程序调用的其他形式的控件上的鼠标事件???的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的大家,

我有一个由MFC编写的OpenFileDialog.dll,该dll用于调用打开的文件Dialg.它具有执行打开文件对话框的方法.

我创建了一个应用程序.在此应用程序中,我添加了一个按钮并处理了该按钮的事件单击.

在方法句柄事件单击"中,我使用OpenFileDialog.dll方法调用打开文件对话框.



[System.Runtime.InteropServices.DllImport("OpenFileDialog.dll")]

public extern static int fnOpenFileDialog([n,n的OPENFILENAME]);

单击按钮后,显示打开文件对话框.现在是我的问题:我想在该对话框的控件上单击鼠标右键以显示我的虚拟键盘.

(该控件是打开文件对话框的控件texbox文件名").

Dear Everyone,

I have a OpenFileDialog.dll is wrote by MFC.this dll use to call open file dialg. it have a method to execute open file dialog.

I create a aplication. in this application, i add a button and handle event click for that button.

In method handle "event click", i use method of OpenFileDialog.dll to call open file dialog.



[System.Runtime.InteropServices.DllImport("OpenFileDialog.dll")]

public extern static int fnOpenFileDialog([In, Out] OPENFILENAME ofn);

after click on button, open file dialog is showed.now is my problem: i want to make event right click on a control of that dialog to show my virtual keyboard.

(that control is control texbox "filename" of open file dialog).

could i do that?

推荐答案

这不容易,但有可能.

但是首先,为什么要在C#中使用MFC OpenFileDialog? OpenFileDialog类有什么问题?

我没有尝试过您想要的东西,所以我认为您有一些工作要做.但是,请阅读 [
It''s not easy, but it may be possible.

But first, why are you using MFC OpenFileDialog in C#? What is wrong with the OpenFileDialog class?

I''ve not tried what you seem to want, so I think you have some work to do. But, read this[^], and see if you can work it out.
Good luck.!


MFC OpenFileDialog可用.所以我必须在上面发展.
我开发的应用程序是我公司的软件".它是由许多人编码的.我为该软件编写了虚拟键盘.现在,我的老板要求在单击MFC OpenFileDialog的文件名文本框时.
我认为我必须使用Hook来解决它.但是我遇到了问题,当我专注于它来使事件调用我的键盘时,我不知道如何捕获文件名文本框控件.
MFC OpenFileDialog was available. so i must develop on it.
The application which i develop is my company'' soft. it''s coded by many people. i coded virtual keyboard for that soft. And now, my boss require that when click on file name textbox of MFC OpenFileDialog.
I think i must use Hook to solve it. But i meet problem, i don''t know how to catch filename textbox control when i focus on it to make event call my keyboard.


您的线程对我非常有用,而我成功.我使用钩子,我可以得到hWnd,文件名文本框的区域取决于ID,然后我检查了文件名texbox的区域的光标位置.
你很棒!!!非常感谢.
祝你好运.
Your thread is very useful for me,and i succesed. I use hook , and i can get hWnd,area of filename textbox depend on ID and then i checked cursor position with filename texbox''s area.
You''re great!!! Thank''s very much.
Best wishes for you.


这篇关于如何捕获从主应用程序调用的其他形式的控件上的鼠标事件???的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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