Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PushSourceDesktop.cpp #42

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source_code/PushSourceDesktop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ CPushPinDesktop::CPushPinDesktop(HRESULT *phr, CPushSourceDesktop *pFilter)
m_iHwndToTrack = (HWND) read_config_setting(TEXT("hwnd_to_track"), NULL, false);
if(m_iHwndToTrack) {
LocalOutput("using specified hwnd: %d", m_iHwndToTrack);
hScrDc = GetDC(m_iHwndToTrack);
hScrDc = GetWindowDC(m_iHwndToTrack);
} else {
int useForeGroundWindow = read_config_setting(TEXT("capture_foreground_window_if_1"), 0, true);
if(useForeGroundWindow) {
Expand Down Expand Up @@ -405,7 +405,7 @@ void CPushPinDesktop::doJustBitBltOrScaling(HDC hMemDC, int nWidth, int nHeight,
// make sure we only capture 'not too much' i.e. not past the border of this HWND, for the case of Aero being turned off, it shows other windows that we don't want
// a bit confusing...
RECT p;
GetClientRect(m_iHwndToTrack, &p); // 0.005 ms
GetWindowRect(m_iHwndToTrack, &p); // 0.005 ms
//GetRectOfWindowIncludingAero(m_iHwndToTrack, &p); // 0.05 ms
nWidth = min(p.right-p.left, nWidth);
nHeight = min(p.bottom-p.top, nHeight);
Expand Down Expand Up @@ -591,4 +591,4 @@ HRESULT CPushPinDesktop::OnThreadCreate() {
previousFrameEndTime = 0; // reset <sigh> dunno if this helps FME which sometimes had inconsistencies, or not
m_iFrameNumber = 0;
return S_OK;
}
}