I've a simple MFC application that only consists of a main window. What my application does is that, it launches MS-Word and makes MS-Word window as a child window of my main window.
When the focus is in MS-Word Window, 'operating system' makes its parent window (i.e my main window) as inactive and turns is titlebar as grey. It is so because, though MS-Word window is a child window of my main window, it runs in a separate process.
My main window only becomes active when i click on it. Now the problem is that i want to programatically activate my main window when user is typing in MS-Word window and presses Ctrl+P. My application uses Key board hooking to detect Ctrl+P.
The question is that how do i activate my main window????
I first tried SetActiveWindow API, but it didn't work MSDN doc says abt this API that :
The SetActiveWindow function activates a window, but not if the application is in the background
Obviously my application is in background when focus is in MS word window, so may be thats why this API is not working.
I also tried SetWindowPos and SetForegroundWindow but no result.
Can you suggest me that how do i activate my main window and bring it in the foreground with input focus.
Hi to all,
In my program, I am only running a thread, that will open media file in read mode, read data from that file every sec & perform the operation on that every sec.
But when I run multiple instances (let 100 instances) of that thread to read same media file (i.e every sec I read same data in each instance of thread), it creates a problem. ( I think due to limitation of reading speed for Harddisk)
So, How I can read media file only once & get data available to thread instances for performing the operation on that data?
i have a spellchecker and i want the following operation
when i choose some text my mouse (active selection od mouse )
what text have to check up with spellchecker text for that i feel
the selected text is copy and paste to text box of spellchecker and compare it
The general solution to this is non-trivial (do a google on "screen readers" for more info). The reason is that the 3 major browsers all have different object models, so getting text from a browser window, or form, is quite difficult. Getting text from a "standard" windows app is not that difficult, but then you also have to consider .Net apps, whose on-screen elements are not based on standard HWNDs.
So for standard apps:
1. find the window, using something like WindowFromPoint()
2. determine type of window, using GetClassName()
3. use (2) and GetWindowText() to try to get the selected text
In an SDI APP i am using a modeless dlg. I am creating the dlg in view class.
In view class im using a LinkList .
Now the Problem is i need to access the LinkList from the dlg . while Accessing the LinkList fn(append, del,...) I got an run time access violation
and then the application terminates.
How to resolve this problem.
any body knows...
Try passing a pointer of your application to the dialog.
In the dialog you can create a pointer of your parent class and access the variables/member functions of the parent class with the help of that pointer.
You can do this:
in the dialog declare a pointer of view in the header file
Now when you are creating the dialog
CMydialog* pMyDlg=new CMyDialog();
pMyDlg->DoModal(); // Or in whatever manner you are creating the dialog.
In the dialog you can then access the member variables of the view like
pView->myLinkedList.///////Somecode or function here
Somethings seem HARD to do, until we know how to do them. _AnShUmAn_
The concept is called tokenization[^]. Take a look at the strtok function. It is easy to write one, at least to cope with the simple case described here.
The idea is search the source string for the first occurance of the separator. Your first part is the substring from the start until the character before the first separator. The "new start position" is now the character after the separator. Repeat the search from the new start position for the next separator.
My signature is not black, just a very, very dark blue
But I hve some questions to be answered about this project. Those are
1) What are the steps involved in Registry Cleaning ?
2) What all can be cleaned ?
3) What all should not be done ?
4) How do we clean a particular Key ?
5) What are the different operations involved ?
6) Do we have the technology to implement all the operations ?
7) Can we automate all the operation if you have a database of
things to be cleaned?
8) Where do we get the list of database of things to be cleaned ?
Please Help me.
Thanks in Advance
George K Jolly <email@example.com>
I have a small problem in VC++.i want to get the index value for the tree item of a tree control.i have used the class CTreeCtrl class but i couldn't find any method which returns the index value.
so quickly help me with a solution
Last Visit: 16-Dec-19 3:47 Last Update: 16-Dec-19 3:47