I am using:
WindowHandle := FindWindow(nil,pChar(sTitleBar));
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.