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.

70 lines
1.8 KiB

  1. #include "stdinc.h"
  2. #include "FusionTrace.h"
  3. #include "hostframe.h"
  4. void CSxApwHostFrame::AddMenu()
  5. {
  6. HMENU hMenu = CreateMenu();
  7. HMENU hPopupMenu = CreateMenu();
  8. AppendMenu( hPopupMenu, MF_STRING, IDM_APP_EXIT, L"E&xit" );
  9. AppendMenu( hMenu, MF_POPUP, (UINT_PTR)hPopupMenu, L"&File");
  10. hPopupMenu = CreateMenu();
  11. AppendMenu( hPopupMenu, MF_STRING, IDM_CASCADE, L"&Cascade" );
  12. AppendMenu( hPopupMenu, MF_STRING, IDM_HORTILE, L"Tile &Horizontal" );
  13. AppendMenu( hPopupMenu, MF_STRING, IDM_VERTILE, L"Tile &Vertical" );
  14. AppendMenu( hMenu, MF_POPUP, (UINT_PTR)hPopupMenu, L"&Windows");
  15. BOOL bResult = SetMenu(hMenu);
  16. DrawMenuBar();
  17. }
  18. LRESULT CSxApwHostFrame::OnSize( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled )
  19. {
  20. RECT rc;
  21. GetClientRect ( &rc );
  22. // ::SetWindowPos(m_hClient, rc.left, rc.top, (
  23. // ::RedrawWindow(m_hClient, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN);
  24. CWindow fooWin;
  25. fooWin.Attach( m_hClient );
  26. fooWin.ResizeClient( (rc.right - rc.left), (rc.bottom - rc.top), TRUE);
  27. fooWin.Detach();
  28. return 0;
  29. }
  30. LRESULT CSxApwHostFrame::OnTileCascade( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled )
  31. {
  32. ::SendMessageW( m_hClient, WM_MDICASCADE, MDITILE_ZORDER, 0 );
  33. return 0;
  34. }
  35. LRESULT CSxApwHostFrame::OnTileHorizontal( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled )
  36. {
  37. ::SendMessageW( m_hClient, WM_MDITILE, MDITILE_HORIZONTAL, 0 );
  38. return 0;
  39. }
  40. LRESULT CSxApwHostFrame::OnTileVertical( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled )
  41. {
  42. ::SendMessageW( m_hClient, WM_MDITILE, MDITILE_VERTICAL, 0 );
  43. return 0;
  44. }
  45. LRESULT CSxApwHostFrame::OnAppExit( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled )
  46. {
  47. PostMessageW ( WM_QUIT, 0, 0 );
  48. return 0;
  49. }