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.

84 lines
1.9 KiB

  1. #include "common.h"
  2. #include "w3scon.h"
  3. extern CW3SpoofUI* g_pw3sui;
  4. LRESULT
  5. CALLBACK
  6. WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
  7. {
  8. return g_pw3sui->_WndProc(hwnd, msg, wParam, lParam);
  9. }
  10. LRESULT
  11. CW3SpoofUI::_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
  12. {
  13. DWORD ret = 0;
  14. RECT rect;
  15. LOGFONT logfont;
  16. switch( msg )
  17. {
  18. case WM_CREATE :
  19. {
  20. InitCommonControls();
  21. GetClientRect(hwnd, &rect);
  22. m_listbox = CreateWindowEx(
  23. WS_EX_CLIENTEDGE,
  24. L"listbox",
  25. NULL,
  26. WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL | \
  27. WS_BORDER | LBS_NOSEL | LBS_NOINTEGRALHEIGHT,
  28. rect.left, rect.top, rect.right, rect.bottom,
  29. hwnd,
  30. NULL,
  31. (HINSTANCE) GetWindowLong(hwnd, GWL_HINSTANCE),
  32. NULL
  33. );
  34. GetObject(
  35. GetStockObject(ANSI_FIXED_FONT),
  36. sizeof(LOGFONT),
  37. (LPVOID) &logfont
  38. );
  39. m_font = CreateFontIndirect(&logfont);
  40. PostMessage(m_listbox, WM_SETFONT, (WPARAM) m_font, 0);
  41. }
  42. break;
  43. case SHELLMESSAGE_W3SICON :
  44. {
  45. }
  46. break;
  47. case WM_SIZE :
  48. {
  49. GetClientRect(hwnd, &rect);
  50. MoveWindow(
  51. m_listbox,
  52. rect.left, rect.top,
  53. rect.right, rect.bottom,
  54. FALSE
  55. );
  56. InvalidateRect(hwnd, &rect, TRUE);
  57. }
  58. break;
  59. case WM_DESTROY :
  60. {
  61. DeleteObject(m_font);
  62. PostQuitMessage(0);
  63. }
  64. break;
  65. default : return DefWindowProc(hwnd, msg, wParam, lParam);
  66. }
  67. return ret;
  68. }