ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder
ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 CaptureFromScreen from handle fails sometimes
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  


138 Posts

Posted - Jul 31 2020 :  14:52:47  Show Profile  Reply
I am using:

WindowHandle := FindWindow(nil,pChar(sTitleBar)); 
ImageEnView1.IO.CaptureFromScreen(iecsSpecifiedWindow,crDefault, WindowHandle);    

sTitleBar contains the title bar name for a window. This code works as expected for normal program windows. But fails if the desired window is the Win 10 Settings dialog, Windows Calculator, Windows Character Map. My code correctly identifies the title bar and obtains a Windows handle for those dialogs but CaptureFromScreen fails. Alt+PrtSc key combination does capture these windows. I haven't succeeded in researching what the difference is for these types of windows.



5390 Posts

Posted - Aug 03 2020 :  22:36:42  Show Profile  Reply

Yes, for those types of windows, you need to use iecsSpecifiedWindow2.

Xequte Software
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To: