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.

55 lines
1.5 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 name[_MAX_PATH+1];
  21. WCHAR params[_MAX_PATH+1];
  22. *name = 0;
  23. HRESULT hr = GetCurrentThemeName(name, ARRAYSIZE(name));
  24. if ((FAILED(hr)) || (! *name))
  25. {
  26. GetDlgItemText(IDC_DIRNAME, name, ARRAYSIZE(name));
  27. if (! *name)
  28. {
  29. MessageBox(L"No theme selected", L"Error", MB_OK);
  30. return 0;
  31. }
  32. wsprintf(params, L"%s\\%s", name, CONTAINER_NAME);
  33. }
  34. else
  35. wsprintf(params, L"%s", name);
  36. InternalRun(L"notepad.exe", params);
  37. return 1;
  38. }
  39. //---------------------------------------------------------------------------
  40. LRESULT CSample::OnClose(UINT, WPARAM wid, LPARAM, BOOL&)
  41. {
  42. EndDialog(IDOK);
  43. return 0;
  44. }
  45. //---------------------------------------------------------------------------