Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.9 KiB

  1. /*************************************************************************/
  2. /* Copyright (C) 1999 Microsoft Corporation */
  3. /* File: ThunkProc.cpp */
  4. /* Description: Implementation of timer procedure that checks if the */
  5. /* window has been resized. */
  6. /* Author: David Janecek */
  7. /*************************************************************************/
  8. #include "stdafx.h"
  9. #include "msdvd.h"
  10. /*************************************************************************/
  11. /* Function: TimerProc */
  12. /* Description: gets called every each time to figure out if we the */
  13. /* parent window has been moved
  14. /*************************************************************************/
  15. HRESULT CMSWebDVD::TimerProc(){
  16. HRESULT hr = S_OK;
  17. hr = ProcessEvents();
  18. if(FAILED(hr)){
  19. return(hr);
  20. }/* end of if statement */
  21. HWND hwndParent = NULL;
  22. hr = GetMostOuterWindow(&hwndParent);
  23. if(FAILED(hr)){
  24. return(hr);
  25. }/* end of if statement */
  26. RECT rcTmp;
  27. ::GetWindowRect(hwndParent, &rcTmp);
  28. if(rcTmp.left != m_rcOldPos.left || rcTmp.top != m_rcOldPos.top || rcTmp.right != m_rcOldPos.right ||
  29. rcTmp.bottom != m_rcOldPos.bottom){
  30. hr = OnResize(); // do the initial resize
  31. m_rcOldPos = rcTmp; // set the value so we can remeber it
  32. return(hr);
  33. }/* end of if statement */
  34. hr = S_FALSE;
  35. return(hr);
  36. }/* end of function TimerProc */
  37. /*************************************************************************/
  38. /* Function: GetMostOuterWindow */
  39. /* Description: Gets the window that really contains the MSWEBDVD and is */
  40. /* the most outer parent window. */
  41. /*************************************************************************/
  42. HRESULT CMSWebDVD::GetMostOuterWindow(HWND* phwndParent){
  43. HRESULT hr = S_OK;
  44. if(NULL != m_hWndOuter){
  45. *phwndParent = m_hWndOuter;
  46. return(S_OK);
  47. }/* end of if statement */
  48. HWND hwnd;
  49. hr = GetParentHWND(&hwnd);
  50. if(FAILED(hr)){
  51. return(hr);
  52. }/* end of if statement */
  53. HWND hwndParent = hwnd;
  54. // Get really the out most parent so we can see if the window got moved
  55. for ( ;; ) {
  56. HWND hwndT = ::GetParent(hwndParent);
  57. if (hwndT == (HWND)NULL) break;
  58. hwndParent = hwndT;
  59. }/* end of for loop */
  60. *phwndParent = m_hWndOuter = hwndParent;
  61. return(S_OK);
  62. }/* end of function GetMostOuterWindow */
  63. /*************************************************************************/
  64. /* End of file: ThunkProc.cpp */
  65. /*************************************************************************/