Leaked source code of windows server 2003
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.

55 lines
1.6 KiB

  1. //---------------------------------------------------------------------------
  2. // Sample.cpp - dialog for sampling the active theme
  3. //---------------------------------------------------------------------------
  4. #include "stdafx.h"
  5. #include "Sample.h"
  6. //---------------------------------------------------------------------------
  7. CSample::CSample()
  8. {
  9. }
  10. //---------------------------------------------------------------------------
  11. LRESULT CSample::OnMsgBox(UINT, UINT, HWND, BOOL&)
  12. {
  13. MessageBox(L"This is what a Themed MessageBox() window looks like",
  14. L"A message!", MB_OK);
  15. return 1;
  16. }
  17. //---------------------------------------------------------------------------
  18. LRESULT CSample::OnEditTheme(UINT, UINT, HWND, BOOL&)
  19. {
  20. WCHAR szName[_MAX_PATH+1];
  21. WCHAR szParams[_MAX_PATH+1];
  22. *szName = 0;
  23. HRESULT hr = GetCurrentThemeName(szName, ARRAYSIZE(szName));
  24. if ((FAILED(hr)) || (! *szName))
  25. {
  26. GetDlgItemText(IDC_DIRNAME, szName, ARRAYSIZE(szName));
  27. if (! *szName)
  28. {
  29. MessageBox(L"No theme selected", L"Error", MB_OK);
  30. return 0;
  31. }
  32. StringCchPrintfW(szParams, ARRAYSIZE(szParams), L"%s\\%s", szName, CONTAINER_NAME);
  33. }
  34. else
  35. StringCchPrintfW(szParams, ARRAYSIZE(szParams), L"%s", szName);
  36. InternalRun(L"notepad.exe", szParams);
  37. return 1;
  38. }
  39. //---------------------------------------------------------------------------
  40. LRESULT CSample::OnClose(UINT, WPARAM wid, LPARAM, BOOL&)
  41. {
  42. EndDialog(IDOK);
  43. return 0;
  44. }
  45. //---------------------------------------------------------------------------