|
Sorry, it may be a old question, but i couldn't found it !
My mean is very simple, i want my program can hook Right click event and get the text under mouse pointer .
Any one can help me ?
|
|
|
|
|
Are you talking about a window in your own program, or any window of any program?
The second is almost impossible, because the user could be right clicking over anything, not just text, and even if he did, you would have no way of knowing it.
If you want to hook into system wide mouse events, I've heard of that being done, how you would find out what window owns that mouse event or has text, I'm not sure.
|
|
|
|
|
Sorry !
My mean is anywhere, any program ( IE, Office,....),
i've see some program can do that , ah , i'm a vietnamese, we have a good English- Vn e-dictionary is
" Just Click'n'See" that can get a English word from screen and display it's Vetnamese mean ! It's so cool !
So i'm want to know the beside tech of it !
|
|
|
|
|
Even though MartinOrtriz replied to your post, you can read the answer in the FAQ page here [^].
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
____________
4.14: How do I retrieve the text that the mouse cursor is pointing at? (top)
There is no built-in way to do this. Once the text is on the screen, it is no longer readable as a character string, only as a bitmap. You'll need OCR (optical character recognition) software to transform the bitmap back into a string of characters.
______________
Ofcource, there is no built-in way, but it's not a mission possible, try download this program and feel it
Just Click'n'See
thank !
|
|
|
|
|
I know what you mean because I have a dictionary that works by clicking on the words. The thing is that in those dictionaries the programmers know where the words are located. To tell you the truth I don't know what kind of algorithms they use, but trying to get any words that appear on any window doesn't seem to be simple. You are looking at pixels not an edit box. And of course it is not mission impossible, and you can go ahead and try it but it might turn into mission un-feasible.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
No, no, no !
Don't simple like that, why u don't try
Just Click'n'See
one time !
that all my mean !
The core of it's solution is :
- Hooking mouse or Keyboard
- Get position
- Invalid this screen and windows will re-paint it
- Hooking output stream and get what u want
But what i need is a sample source code
But, thank for your comments
|
|
|
|
|
Sorry but I cannot understand the program because it is in Vietnamese. My reply was intended to tell you that what you are after is not easy. I really cannot help you with your brainstorming because I have never attempted to read text from the screen and I don't think I will in the near future (I usually don't try things unless I have to). With that said and done let me remind you that Einstein (I think) said (not his exact words): "There is something that every man on this planet knows that it cannot be done. Here comes a person that doesn't know that and he solves the problem." Let's hope you will be that person.
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Hi,
I'd also like to know a solution to this problem. I'm not proficient in windows programming, but I suggest this:
- get the handle of the active window
- send the window doubleclick message (this should select the word the mouse is pointing at)
- send a message that copies the selection into clipboard
- read the word from clipboard
maybe that once the word is selected it's also possible to retrive it by sending the window some getselection message or something like that.
what do you think?
Koxin
p.s. if you find a solution to this problem please let me know
|
|
|
|
|
here a example screen shot
Hi, Koxin, i've got a same idea in FAQ and have a example in MSDN but not easy ! And i'm sure have a solution didn't use Clipboard . Any one can suggest another idea ?
Coding for lv,lv & di
|
|
|
|
|
I am having trouble finding a direct way of setting a bitmap as the background of a CFormView. I've done this before using a CDialog class, but as I'm finding, the CFormView isn't quite the same. The bitmap is already defined in the resource file, not loaded at runtime. Thank you for any help anybody can give!! ;)
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
This should be done in the OnEraseBkgnd() handler.
In your view class .h file add:
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
In your view class .cpp file add:
ON_WM_ERASEBKGND()
Then you can add this function:
BOOL CYourFormView::OnEraseBkgnd(CDC* pDC)
{
return TRUE;
}
HPS HwndSpy - GUI developer's aid to visually
locate and inspect windows. For the month of August
only, use coupon code CP-81239 for 30% off.
|
|
|
|
|
Hi Douglas,
Check your email.
I hope that posted sources will solve your problem.
Vitali
|
|
|
|
|
I would like to use JTC.h in VC++ 7.0.
Can I use that? if yes, please tell me how.
I mean how I can link that to my project.
thanks!
|
|
|
|
|
can anyone tell me the proper way to disable and enable them within a dialog i know ive posted this thread 2 times already but neither asnwer worked
thanks for any help
|
|
|
|
|
send TB_SETBUTTONINFO with sendmessage...
TBBUTTONINFO.fsState = TBSTATE_INDETERMINATE;
Don't try it, just do it!
|
|
|
|
|
and how do i send that to send message and how do i tell it wich buttons to disbale/enable?
|
|
|
|
|
thats how its done if you tool bar control is a member of your dlg class
m_Tool.SetButtonStyle(1, TBBS_DISABLED);
m_Tool.SetButtonStyle(1, TBSTATE_ENABLED);
|
|
|
|
|
1) If you have a mapped variable for the dialog item:
1A) If it is a static item created with the visual editor:
itemmappedvariable.EnableWindow(BOOL);
1B) If it is a dynamic item created on the fly:
itemmappedvariable->EnableWindow(BOOL);
where BOOL is TRUE or FALSE. Setting to FALSE makes the item greyed out and not selectable by the user, which is what most people mean by disabled.
2) If you want the dialog item to completely disapear, you use:
2A) itemmappedvariable.ShowWindow(var);
2B) itemmappedvariable->ShowWindow(var);
where var=SW_SHOW to make it visible
var=SW_HIDE to make it disapear.
If you don't know what a mapped variable is, either:
1) Ggo to the item in the dialog editor. Click on the dialog item, Right click, select create variable. Fill in the name, hit OK. This makes all the coding changes so that you can use the A syntax above. If you search your dialog .h and .cpp you can see the simple changes and do others by hand. Pay attention to the lack of trailing semicolons if you do.
2) You can also use GetDlgItem(IDC_WHATEVER)->EnableWindow(BOOL) or GetDlgItem(IDC_whatever)->ShowWindow(var). Less efficient this way if you do it a lot.
Good luck!
tim
Founder, TMurgent Technologies
www.tmurgent.com
tmangan@tmurgent.com
|
|
|
|
|
Hiya I need to send a simple string through the com port from one pc to the other. I connected both of them together.
I have seen CreateFile to open the com port but can't get it to work for me properly.
Can someone give me simple code to show me how to make one computer listen and the other send the data..
Thanks,
|
|
|
|
|
|
Can anyone suggest a way to update an Edit box at run time while in a loop. I've tried using a declared CString variable and updatedata as well as directly updating the control with SetDlgItemText, but neither one update in real time, until the loop finishes execution.
Thanks
TDM
|
|
|
|
|
Painting is a deferred operation in Windows; WM_PAINT messages are only generated for your windows when the message queue is otherwise idle.
To force a repaint of a window immediately, call UpdateWindow .
|
|
|
|
|
Have you tried creating a thread, and passing the address of your variable control to it? If the contents of your edit box need to be changed as a result of something in your loop, you might be able to use CSemaphores to lock the thread until it needs to update the control, and unlock it from your loop. Just a thought, good luck.
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
After a few hours of frustrated searching, I have YET to discover whether or not or where Windows stores it's most recent boot time!! I am assuming it must be stored SOMEWHERE in the registry, but I haven't been able to find it thus far. Anyone know where I could find this information, assuming it exists?
|
|
|
|