|
|
Comments and Discussions
|
|
 |
|

|
Hi,
Its a nice tool but i could not enjoy this since it can not capture complete windwos screenshot where a window has scrollbar. Actually i need to take a screenshot of panel which has scollbars. It selects the rectangle but screenshot appears only for visible area rest appears as black. I think target window paint will be required before taking screenshot. Kindly modify this tool to improve productivity.
Best Regards
|
|
|
|

|
Sorry, but it seems fine to me. Can you describe how to reproduce the problem you describe using an app such as Notepad that I have. My test captures copy the visible window selected, including scroll bars, buttons etc..
Or are you saying you want it to capture from the non-visible area? In which case I think you are misunderstanding what this tool is all about (i.e. simple, quick and dirty, demo of window handles and screen capture).
|
|
|
|

|
Thanks for quick response,
well,ya i mean to say..suppose there is a windows form having scroolbars and few controls on the form are hidden due to form length. In this case if i take screenshot of the form then hidden controls which will appear after scrolling, not appearing in the screenshot though captured image size is same as the form dimentions i.e if it were scrolled to full length. Kindly suggest.
Also please let me know that is it possible to get control back from hwnd and how to get size of the window inclding hidden area of the window In dot net there are properties like DisplayRectangle.Width and this.DisplayRectangle.Height for scrollable controls.
|
|
|
|

|
You haven't provided me with a way of reproducing your findings. To the best of my knowledge this utility simply captures the visible part of the target window.
I think if you are looking for a full-blown screen capture program maybe you need to look elsewhere. This was always just a quick and dirty, low-powered compact utility - a by-product, if you like, of the CodeProject article.
The source code is there for anyone to use and enhance and if it's that important to you please feel free to enhance it and post the changes here.
However, as the original author of this article I have no plans for any further work on this utility - it works for me, but I also use SnagIt, depending on task in hand.
|
|
|
|

|
Hi
It is a nice tool. How can I capture whole screen?
Best,
|
|
|
|

|
Can we convert or have this utility in C# please. I have application in C# for which I need to use this utility. would you please help to get converted this code. Thanks
|
|
|
|

|
Hi,
Is there a way to avoid capturing password and login boxes?
thanks
Kendals
|
|
|
|

|
Is there a way to write this in VB.Net? And yes, I am a newbie =)
|
|
|
|
|

|
I saw that article before seeing yours however it appears to only capture a graphic image I am intrigued with the ability to actually capture the text. I'm wondering if I need to make an API call or something to allow me that functionality in VB.Net. Thanks for the reference!
Marc
|
|
|
|

|
Once you have the window's handle you can just use the Windows API GetWindowtext(). I have next to zero VB.Net knowledge, but I'd bet my house it can call the Windows api!
I would guess it also lets you enumerate windows in order to find the handle you want.
HTH.
Pete
|
|
|
|

|
I want to get only visible region of inactive window in screen.
Otherwise I want to get covered region by other windows.
How can i do?
Thank for your help.
kim
kim
|
|
|
|

|
Is that possible to capture text MS Office? When I drag the bullseye to the typing area of MS Word, no text is captured.
When I drag it to IE browser, the text is captured not in every box. For example, in www.google.com, I drag the bullseye to the web address, I see the capture; however, I am unable to capture the search key area.
Thank you.
|
|
|
|

|
thanks for creating this program.
i use it with the hardware that captures computer generated holograms from a given region in the screen.
i only suggest that scroll bars could be used to much easily edit the position values...and if still possible, that the window position update automatically upon change of their values. i would have modified it myself if i had the a*.h header files (i use devc++).
anyway, it's useful.
-prober8
|
|
|
|

|
Try setting Windows to run at a DPI other than the default of 96 (Control Panel > Display > Settings > Advanced > General > Display > DPI setting).
You'll notice that as the DPI increases, more and more of the utility's window gets clipped and it becomes harder and harder to use.
|
|
|
|

|
Yup. True, I'm afraid. Good spot!
However, to be completely honest, although I can see it's a showstopper where you are working at other than 96dpi, I don't understand why you can't use Large Fonts in Control Panel -> Display Settings -> Appearance instead if you want bigger text. I guess possibly that won't change how apps draw their documents or whatever.
Either way, if you or anyone who feels strongly can spare the time then by all means please post a fix! However I'm afraid I just can't justify revisiting a project which is now over 2 years old.
Sorry - I don't want to give anyone offense here. Hope there's none taken.
Pete
|
|
|
|

|
The advantage of changing the DPI is that all text is enlarged, including text in dialog boxes. Additionally, dialog boxes (and similar windows like this app) should automatically adjust their size to account for the larger text. The Large Fonts option doesn't provide that functionality.
|
|
|
|

|
Fair enough. Thanks for clarifying.
Pete
|
|
|
|

|
Hello, Do you know if there are any application similar that, for msdos operating system?
I want to capture a data for a msdos windows. I have installed windows xp, and the vmware. I want to capture some data in it, have you any idea how can I do that?
Excuseme but my english is very bad.
|
|
|
|

|
Is there a way to capture all the visible text in a dialog?
I would also like to know the position of the text (top, left), if possible. I guess you have to iterate through each control in the dialog, but how?
I know you can iterate through each control of a process, if that helps.
Thanks in advance,
Mike
|
|
|
|

|
Surely, given the handle of the dialog window you can use EnumChildWindows to iterate through its child windows?
To quote MSDN, "The EnumChildWindows function enumerates the child windows that belong to the specified parent window by passing the handle to each child window, in turn, to an application-defined callback function. EnumChildWindows continues until the last child window is enumerated or the callback function returns FALSE."
Getting the top left of each control is illustrated in the code for the utility on this page.
Hope this points you in the right direction!
|
|
|
|

|
Wow, thanks for the quick reply. I'll give it a try.
|
|
|
|

|
This is a very nice tool. It's a good example how to combine relatively straightforward tools into 1 tool.
Thanks a lot!
|
|
|
|

|
The screen capture utility as an entity does a very good job at printing 'a visible' window; however if a Userform window (Excel Userform) is greater than the screen height the outcome is:-
The Userform window is captured for sure except that for the captured Userform, the part of the Userform that is 'below the screen and not visible' comes out as black.
Is there a way to print the Userform (say a A4 Portrait Userform) in its entirety and with its contents even though a part of the userform is not visible?
An extension to this screen capture utility would be to make the captured background transparent ie if you capture a file hierarchy in Windows Explorer, the background is white. Make the captured background transparent and the text would float on its own in the captured window.
lasercraft
|
|
|
|

|
Seems like when the app is run, it is looking for some registry values to determine the dialog's last position. When the first time the app is run, the values are empty, and defaults 0 were used, hence the main dialog will be hidden.
In WindowFinder.cpp,
Change from
// Position
int x = AfxGetApp()->GetProfileInt("Window", "Left", 0),
y = AfxGetApp()->GetProfileInt("Window", "Top", 0),
cx = AfxGetApp()->GetProfileInt("Window", "Width", 0),
cy = AfxGetApp()->GetProfileInt("Window", "Height", 0);
to
// Position
int x = AfxGetApp()->GetProfileInt("Window", "Left", 0),
y = AfxGetApp()->GetProfileInt("Window", "Top", 0),
cx = AfxGetApp()->GetProfileInt("Window", "Width", 389),
cy = AfxGetApp()->GetProfileInt("Window", "Height", 496);
|
|
|
|

|
Yes, you are right.
Thanks for spotting my mistake. It worked fine at my end as a result of the incremental testing I did as I developed it. I should have tested it on a virgin machine.
I've emailed updated source and exe to the CodeProject editor, so hopefully the downloads will be corrected soon.
A cold bath for me!
Pete
|
|
|
|

|
The article's zip downloads now contain the corrected exe and source code.
|
|
|
|

|
:|How can I capture hidden window ? I know that windows HWND ,i have tried it using bitmap but that captures only that windows region that is covered by another window.
If You cant Understood then i brifly explain,
I have hooked system messages whenewer WM_CREATE is generated for particular window i have gat that window`s HWND and after that i hide that window by using fun. ShowWindow(SW_HIDE) after that i tried to capture that hidden window by using that
windows handle .Now i get only Regoin covered by another window.but Not that window so how can i capture that window??
|
|
|
|

|
Greetings.
The code runs fine and smooth, but there's one problem. How do you capture data from an Access Form? When rolling over different elements, it does not seem to react to anytihng, just as if the whole form is a huge image, and Access interprets it by itself.
Is there a possibility to do that?
Regards,
Andrew Black
|
|
|
|

|
Hi Andrew,
You are right about Access forms. I think that is because they are not made up of standard windows controls - the whole form is a 'custom' control. The 'window' is the whole control so it is not possible for a generic 'window finder' tool to get deeper than the overall form control.
I've tried a couple of 'professional' screen capture utilities - MWSnap (freeware) and HyperSnap DX 4.52 and they have the same 'problem'.
If anyone reading this knows different or can suggest a good way for 'getting at' the controls in an Access form it would be very helpful to the rest of us if you could make a post.
All the best,
Pete
|
|
|
|

|
try HyperSnaps TextCaptureTM it can capture even from custom controls, how is it done?
|
|
|
|

|
The meat of this article was published first in 1998 under the name screencap an was distributed with source under the same name.
It is wonderful that new programmers keep "inventing" what we did years ago.
"Naked we come and bruised we go."
- James Douglas Morrison
Best Wishes,
ez_way
|
|
|
|

|
I wrote the article on this page, with due and full acknowledgement to Lim Bio Liong's original article and code.
If you are asserting that I ripped someone else's article or code, you'd better damn well have the proof! You make the assertion, but where's the URL / article reference to support your assertion?
I would like to state unequivocally that, other than the source I've already acknowledged, the article is 100% original Peter Boulton in every way.
Sure, this is not the first or only article on screen capture, but as at now, 20938 views have been made of the article and 16 users have given it an overall rating of 4.03 out of 5, so I reckon the article must have interested a few people.
If you want more originality, perhaps you should lead by example. If you are able, that is.
Enough said.
|
|
|
|

|
OK We wrote the same application for BMag project in 1998. Nowwhere did I say you ripped us off, I said we are repeating the same lessons. A fact, if you like I will post the article and you may judge for yourself. Same ICON same mouse capture, etc. Yes, there is plenty of room to grow for all, but I said we are all flying in a circle as M$ keeps bringing out crappy compilers that know good programmer would use if their life depended upon it, my thoughts VC7 is in that catagory. WinFX will continue to remove the programmer from the DOS. 64 opps will NOT support our existing dll's because of thunking, unless you load the dll's under 2gb and set a pointer to the same, if you think I am wrong please explain why?
"Naked we come and bruised we go."
- James Douglas Morrison
Best Wishes,
ez_way
|
|
|
|

|
So, stripping out the crap, you have acknowledged that my article did not plagiarise what you claim to have written in 1998 and was 100% original, other than the clear acknowledgement of source right at the top of my article.
I don't think the icon is totally unique to any of us. Can't see the point of your complaint in that area.
If you don't like VC7 or Microsoft, that's hardly my fault and I guess there are countless sites which allow / encourage anti-MS rants. But not CodeProject.
Summary: Sadly I cannot claim to have invented screen capture. However, the article was posted in the hope that it would be of interest / help to fellow Code Project participants. I am sorry it has provoked your wrath. But, actually, not that sorry, come to think of it!;P
|
|
|
|

|
OK so I will dig out the article and post it and let the members decide if we are flying in circles with newbie copying our work. Quit while you are ahead, I know what you did and I was just being nice. Only dif is that we called it windows tool not Petie's window tool, sweet!
As for not liking vc7 yes I don't care for it, and they are removing a great compiler from your hand and you are paying them to do it. Have you every learned from Dr. Newcomer, or PJ Naughter, and if you did you notice the compiler version they used it their articles? I got an email from Dennis Ritchie last year, in part it say's "the o.s. is being taken out of the hands of the pgmer" and into the hands of babes". Dr. Doob's, Chris, and others have wondered aloud why, and now we see with longhorn all will be lost. In the early eighties we spent thousands of hour making Quick and Dirty work for the masses, and now we are old and keep seeing the same stuff over and over again, not just here on all the boards.
But you said I was ranting about not liking M$, I was one of their best friends for many years, and taught assembler in two cases for them. One of my best friends and a great programmer has moved to c#, what a waste. Please sir, remember I started in 1964, and need to remind you that the nearest thing we had to modern day tech was and IBM 360 and 1401. So I have seen if not all most of it. I was not upset until you made it personal, now your prediosus use cut and paste button will be known to all. How do you think I found the article, others wrote me as my code auther is dead and told me our apps where being copied.
When I prove that you are a fraud, I expect an apology and the removal of this article, as we did use a Copyright Notice on the original code. Search and replace does not hide the underlying code, Petie, so let's put windows scraper in the crapper.
Just because another passed our work on as his or her own does not excuse you. See:
http://canada.justice.gc.ca/en/cons/droitauteur.html
England signed this agreement as well as the U.S. for punishment of up to five years in jail, and or and 500,000. pound fine in your case. I have contacted the Justice Deptartment and they will be in touch.
Attn Member: Our 1998 Code:
void OnMouseMove
(
HWND hwnd,
UINT message,
WPARAM wParam,
LPARAM lParam
)
{
POINT screenpoint;
HWND hwndFW = NULL;
char szText[256];
GetCursorPos (&screenpoint);
wsprintf (szText, "%d", screenpoint.x);
m_gPtr->(hwnd, IDC_STATIC_X_POS, szText);
wsprintf (szText, "%d", screenpoint.y);
m_gPtr->(hwnd, IDC_STATIC_Y_POS, szText);
.....
"Your Code:"
long DoMouseMove
(
HWND hwndDialog,
UINT message,
WPARAM wParam,
LPARAM lParam
)
{
POINT screenpoint;
HWND hwndFoundWindow = NULL;
char szText[256];
long lRet = 0;
// Must use GetCursorPos() instead of calculating
// from "lParam".
GetCursorPos (&screenpoint);
// Display global positioning in the dialog box.
wsprintf (szText, "%d", screenpoint.x);
SetDlgItemText (hwndDialog, IDC_STATIC_X_POS, szText);
wsprintf (szText, "%d", screenpoint.y);
SetDlgItemText (hwndDialog, IDC_STATIC_Y_POS, szText);
Sweet Petie, All you did was copy and make it less powerful! Newbie copy at it's worst.
"Naked we come and bruised we go."
- James Douglas Morrison
Best Wishes,
ez_way
|
|
|
|

|
I think the code you are alleging as copied came from the original code in Lim Bio Liong's article. I re-used this, with due acknowledgement to Lim Bio Liong. If I was going to intentionally plagiarise I would hardly credit a previous source right at the start of my article!
If you want to continue your campaign then get your target right.
Oh, and I'm not a newbie, by the way.
Also, you seem to have forgotten to tell us where you allegedly published your 1998 code.
In terms of making it personal, I guess I take accusations of plagiarism fairly personally, yes.
Get on with your life and forget this stupidity. It's wasting your time, my time and every Code Project member who wastes their time reading it.
|
|
|
|

|
Sir,
Law requires that you place a copyright notice in all your code that recognizes and compensates then author of the code, (not money just recognition).
Federal Law and International Trade Agreements state "It is incumbent of the publisher to make certain they are not using others work." I have sent my code to Chris, and he has "yours", he will decide whether or not you are a fraud, we both know you are. I am sorry I offend you by calling you a newbie, but most newbie's know enough not to use copyrighted code, it's just takes knowing what is wrong and what is right. I help newbie's everday so, I guess you are a new level of bottom dweller, I have this morning turned the matter over to our the British Embassy,3100 Massachusetts Avenue,Washington DC, 20008 (202) 588 7800
I am sure we can reach a agreement. Here a thought, I just wrote an great new word processor, It works just like MS Word 10! All the features of M$ Word 10 are included and it's free!
Here is the heart of the code:
SHELLEXECUTEINFO sei;
ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
sei.cbSize = sizeof (SHELLEXECUTEINFO);
sei.lpVerb = NULL;
sei.lpFile = _T("winword.exe");
sei.nShow = SW_SHOW;
sei.hInstApp = NULL;
sei.lpDirectory = NULL;
sei.fMask = SEE_MASK_DOENVSUBST|SEE_MASK_NOCLOSEPROCESS;
sei.lpParameters = NULL;
if (ShellExecuteEx (&sei) )
return TRUE;
That is what you have done, no more, how proud you must be petie!
Baldwin
"Naked we come and bruised we go."
- James Douglas Morrison
Best Wishes,
ez_way
|
|
|
|

|
This is my last attempt to address your concerns as this thread is getting more than a little tedious (and very off topic).
I have already explained that the code you assert is yours came directly from the code/article by Lim Bio Liong at http://www.codeproject.com/dialog/windowfinder.asp. Please feel free to check it.
It is perfectly clear from my article that it is based on Lim Bio Liong's article - it is stated clearly in the heading paragraph and body of my article. I have not passed that code off as my own and would not dream of so doing. I was merely re-using, with full credit to the author, the code from his article.
I struggle to understand why I should fully attribute to Lim Bio Liong and not yourself, given that to this day I know neither of you.
I also struggle to understand what you think I could possibly gain from publishing stolen code to Code Project. The only motivation I had in writing the article was that I have got a lot of value from Code Project in the past and I therefore wanted to put a little back. I also fancied a little tool which could scrape the text off message boxes as text, couldn't find a freeware one so wrote it myself.
I really think you have got the wrong person here. If you want to continue your spat I guess you should take your concerns up with Lim Bio Liong. His article was published in 2001 by the way. I'm sure he will be able to address your concerns.
I am not going to respond to any more of your unsubstantiated allegations, insults or rants, as Code Project really is not the place for them and our spat has got more than past a joke.
That's all.
|
|
|
|

|
As I said remove your code, say you are sorry, and all is well. I have alreay contacted the Department of State, and sent stolen code info to Chris. Everyone understands what you did, except you.
"Naked we come and bruised we go."
- James Douglas Morrison
Best Wishes,
ez_way
|
|
|
|

|
I suspect the only people reading this are you and I.
I've already fully answered all your concerns - you are the only person who doesn't get it. Please re-read my postings and you will see that the code you quote was sourced from Lim's article, which I fully acknowledged at least twice in my article. You, and anyone else with enough time to have got to this position in this thread, are free to check this - why don't you?
Have a nice day!
|
|
|
|

|
Good grief. What an astonishing read. Lighten up, man!
I very much doubt you've really contacted the DoS. Even if you did, they're probably not going to lift a finger because a) this is trivial, they've got better things to do and b) you'd have to prove a monetary loss (see article 4.4 of the CDoJ article you refer to -- good luck with that).
Don't you think you're overreacting ever so slightly? I just compared the code in this article with Lim Bio Liong's article and there are many similarities. He does give credit in the article and the only thing I can fault him for is removing LBL's copyright notice (which was #define ABOUT_WINDOW_FINDER "Window Finder\r\n(C) 2001 Lim Bio Liong." in main.h). That is in violation of the CP submission guidelines, but given his acknowledgements in the very first paragraph of his article, I think this was an honest mistake.
In the end, I don't see why you'd have a right to ask Peter to remove this code. If you contend you wrote it first, take issue with LBL.
As for the article from the Canadian DoJ you refer to, perhaps you should read it yourself. In particular, article 4.1:
4.1 Knowledge. It is imperative to be able to demonstrate that the accused acted with knowledge that the works that were being manufactured for sale, sold, distributed, exhibited or imported were infringing works.
Peter Boulton obviously did not know his extension of LBL's code allegedly infringes on your copyright.
And, as mentioned before:
4.4 Financial Impact. A successful prosecution requires credible evidence of the financial impact of the infringement upon the complainant. This evidence is necessary first, for its bearing on the investigator's decision to take on the case; second, for its bearing on whether the Crown should proceed by indictment or summary conviction; and third, for its bearing on the scale of the penalty to be imposed.
Case closed.
You wanted to let the members decide? If you mean CP members, then this member decides you're way too tightly wound and need to relax.
|
|
|
|

|
Dear Pete
I am sorry to say that i agree completely with everything that Baldwin has to say. I feel so strongly about the fact that a serious crime has been commited that I have contacted Scotland Yard , the FBI, HM Customs & Excise, the Office of Fair Trading, the IRS and my cousin Rupert who is an expert programmer and hates newbies.
Not had any replies yet but Rupert says remove this article or he will personally come around to your house and thrash you with a 16 bit pointer.
Great article.... just what i needed.
Baldwin / Martin (whichever)... get a life.
|
|
|
|

|
I agree, this article is just unecessary and stupid, almost like that russian guy Bill Sergio's internet charger (http://www.codeproject.com/useritems/supercharger.asp). An article with ONLY ONE PURPOSE - FREE ADVERTISING.
What does the link to www.p0werprogrammer.co.uk has to do with this article?
I cant stand this, especially since the whole article is just a rip-off.
-----------------------------
I am out of scope
|
|
|
|

|
cool.
just one detail: that Bill Sergio freak ain't russian, some yankish-spanish half-breed
|
|
|
|

|
I can't believe how stupid this is. Why are you getting so steamed up? 21 people rated the article at 4.11 out of 5 - so a few people must like it a bit. No one has shown any evidence (because there is none) that any code was ripped, other than the fully attributed code to Lim Bio Liong's article. No one says the screen capture idea is original, or even that the execution in my app is different to any other capture utility. The purpose of the article was to make available a little utility which I actually find I use quite a lot and which does a couple of things I haven't found in any other free tools.
If little things like this annoy you, how do you cope with real life?
Move on - it really isn't worth it!
Pete
|
|
|
|
|

|
Thanks for that - much appreciated. You're right, and I must stop being so sensitive!
|
|
|
|

|
Well the link to your site (powerprogrammer) makes it look like you want to profit from this article. I really dont mind that you based your program on someone else's code and named it "Pete's blabla", but the fact that you write in the article that you DONT want credit for it, and still want people to click your link, thats hypocrisy. Even though this article might be good for some people, you should know the reason to why codeproject exists. It's NOT for advertising your own websites where you SELL your own programs.
However, if I'm wrong in any case I apologize and hope that you remove your link OR perhaps add a link to Lim Bio Liong's website. Or perhaps add his name in the title since he made half the program! Christ, Pete's Window Tool....oh well
Take care!
-----------------------------
I am out of scope
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
|
This utility uses Lim Bio Liong's excellent Spy++ style Window Finder code to build a screen capture utility (featuring text capture as well as bitmaps) and window resizer/mover. It also demonstrates stay on top and expanding/contracting (i.e. more detail / less detail) dialog boxes.
| Type | Article |
| Licence | |
| First Posted | 18 Dec 2003 |
| Views | 177,333 |
| Bookmarked | 112 times |
|
|