|
I have an application which displays its child windows one after other at random(i mean it does not have a specific time interval for that). The contro l doesnot return untill it finishes displayin all the windows... I want to capture the screen shots of the windows.. for that i have created a new thread to write the capture code... for now what im doin is for every 2 sec i get the foreground window and capturing it.
It has foll disadvantages:
1. The time i.e 2 sec which im waiting is not constant..so it may capture the same window or skip any window if it appers fast.
2. I cannot navigate from the window since by navigating the foreground window captures the window which i have opened...
As an alternative wht i intend to do is:
When ever the child window appears the focus is shifted from the main window to the child window. So i want to interpret all the messages of the message queue and whenever a WM_ACTIVATE message happens to be present i will read it and if it's hwnd matches with my app then i will capture it...
For this i need to read the messages of the queue and since im new to this field i donno howe to go about it.
|
|
|
|
|
Your approach sounds OK, message hooking will give you what you want. Spy++ can get you any window handles you need as a one off and remember you can also monitor the creation of the child windows to get handles and such. I'm afraid I don't have any more details, you'll need to break out the MS Samples and experiment to find out how to get what you want. Good luck.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
|
Hai,
I having an XML FIle , From this i am Passing port numbers to start a server on. Now the thing is 3 different port numbers i am passing..based on the 1st port the server is getting started...and waiting for clients incoming connections....
Now i want to run the 2nd server at the same console...and also ..the 3rd and so on...
How to do this...
Born to win...!
|
|
|
|
|
It sounds like you need a stub, launcher, application. Look up the docs on the CreateProcess API and have a look at the stuff on inheriting Console handles into child processes. A general launcher app is a useful thing anyway.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
hai,
Thanks for ur reply...I Solved it..
Born to win...!
|
|
|
|
|
Can anybody help me to edit,update and delete Microsoft Acess database through ODBC.
I connected the database and i can acess the contents of database by using SQL queries.
|
|
|
|
|
Deepu Antony wrote: Can anybody help me to edit,update and delete Microsoft Acess database through ODBC.
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
How can I stop the window to get merged with the main window when the maximize button is pressed?
The maximized button doesn't have the restore minimize button with window.
How can I get these buttons with the maximized window?
Regards,
Pritha
|
|
|
|
|
Hai..
one doubt..Urs is multiple document window (MDI) In mfc..or...?
Born to win...!
|
|
|
|
|
Hello,
Thanks for your reply.
Yes mine is MDI.
Prithaa
|
|
|
|
|
I guess you refer to the view that is attached with the document when you say window, and to the application frame when you say main window.
I access the different views of my document with the following
CMDIChildWnd* pMDIActive = MDIGetActive();
CDocument* pDoc = pMDIActive->GetActiveDocument();
CMyView* pMyView;
POSITION pos = pDoc->GetFirstViewPosition();
while (pos)
{ pMyView = (CMyView*) pDoc->GetNextView(pos);
if (pMyView ->IsKindOf(RUNTIME_CLASS(CMyView)))
{ CFrameWnd* pTempFrame = pMyView->GetParentFrame ();
pTempFrame->DestroyWindow ();
return;
}
}
return;
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Thanks for the reply
What I want is to write code so that when my child window is maximized the child window should have a minimizebox,a maximize box(restore box) and the destroy box ?
When I maximize my child window the window does not have the retore box so that I can now restore the window back to original position?
The child window sort of merges with the main window (frame window) leaving no scope for accessing other child windows.
Regards
Thanks.
Prithaa
|
|
|
|
|
Then take a look to BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
There is where you can change the aspect of the frames, setting styles, changing caption and so on...
when you maximize a child window and it has the right styles, the minimize and restore button, are upside, below the main frame max/min buttons
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hi,
I need to create a Local Machine User and set it my own privileges.
Any Suggetions or relevant Links would be helpful.
Thanks.
Today is a gift, that's why it is called the present.
|
|
|
|
|
If you refer to Registry... I tip not to use CRegKey, and use the "search comments" in forum, I asked about accesing the registry few days ago and the people solved my problem. To start you have a reference.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Can anybody help me in converting a 16 bit RGB (555)to 8 bit grayscale bmp.
I got 5 bits of red ,green and blue pixels.
Thanks in advance
|
|
|
|
|
Have a look at the following Christian Graus article, here at CP [^]. Porting the grayscale filter algo C# to C++ is straightforward.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thanks for helping me it is useful to me
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
In the 8 bit bmp a color table is used (of size 256 colors). So after you convert the color to gray (using the formula, Y = 0.3R + 0.59G + 0.11B) you have to keep it in a 256 element COLORREF array as a new color if it not added to the array yet. And the index of this array should be saved as the bitmap data. If the color idex is getting overflown ( > 255 ), then the index of a nearest existing color should be identified and the index should be used. For better result, when finding the nearest color, the occurance of that color should be considered. Means if 80% gray is coming 1 time and 81% is coming 20 times, then replacing the 80% to 81% is better. And dont forget to save the created color table also.
- NS -
|
|
|
|
|
Can u make it more clear please..
|
|
|
|
|
What could you do for this so far?
- NS -
|
|
|
|
|
i seperated red green and blue bits.Thus i have 5 bits of each.then i make it to 8 bit each by shifting them to the left by 3 bits.Then i used the
conversion formula .299*R+.587*G+.114*B .But lost of information is observed.
Is ther is any method to diectly converting it 8 bit grayscale
|
|
|
|
|
How do you expect to preserve data when converting RGB to
grayscale? It's not going to happen.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|