configEdit.cpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #include "Win32.h"
  2. #include "ID.h"
  3. #include "Function.h"
  4. #include "SharedValue.h"
  5. HFONT Font();
  6. LRESULT CALLBACK ConfProc(HWND hWnd1, UINT msg, WPARAM wParam, LPARAM lParam)
  7. {
  8. switch (msg)
  9. {
  10. case WM_CREATE:
  11. {
  12. HFONT hFont = Font();
  13. HWND hLabel_1 = CreateWindow(
  14. L"STATIC", L"服务器名称",
  15. WS_VISIBLE | WS_CHILD,
  16. 20, 20, 100, 30,
  17. hWnd1, NULL,
  18. (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
  19. );
  20. HWND hServerName = CreateWindow(
  21. L"EDIT", L"不修改",
  22. WS_VISIBLE | WS_CHILD | WS_BORDER | ES_MULTILINE,
  23. 150, 20, 300, 40,
  24. hWnd1, (HMENU)NULL,
  25. (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
  26. );
  27. HWND hLabel_2 = CreateWindow(
  28. L"STATIC", L"游戏模式",
  29. WS_VISIBLE | WS_CHILD,
  30. 20, 85, 100, 30,
  31. hWnd1, NULL,
  32. (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
  33. );
  34. HWND hGamemode = CreateWindow(
  35. L"COMBOBOX", NULL,
  36. WS_VISIBLE | WS_CHILD | CBS_DROPDOWNLIST,
  37. 150, 85, 150, 100,
  38. hWnd1, (HMENU)NULL,
  39. (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
  40. );
  41. SendMessage(hGamemode, CB_ADDSTRING, 0, (LPARAM)L"不修改");
  42. SendMessage(hGamemode, CB_ADDSTRING, 0, (LPARAM)L"冒险");
  43. SendMessage(hGamemode, CB_ADDSTRING, 0, (LPARAM)L"生存");
  44. SendMessage(hGamemode, CB_ADDSTRING, 0, (LPARAM)L"创造");
  45. HWND hForceGM = CreateWindow(
  46. L"BUTTON", L"强制游戏模式",
  47. WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
  48. 320, 80, 150, 40,
  49. hWnd1, (HMENU)NULL,
  50. (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
  51. );
  52. HWND hLabel_3 = CreateWindow(
  53. L"STATIC", L"游戏难度",
  54. WS_VISIBLE | WS_CHILD,
  55. 20, 150, 100, 30,
  56. hWnd1, NULL,
  57. (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
  58. );
  59. HWND hDifficulty = CreateWindow(
  60. L"COMBOBOX", NULL,
  61. WS_VISIBLE | WS_CHILD | CBS_DROPDOWNLIST,
  62. 150, 150, 150, 100,
  63. hWnd1, (HMENU)NULL,
  64. (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
  65. );
  66. SendMessage(hDifficulty, CB_ADDSTRING, 0, (LPARAM)L"不修改");
  67. SendMessage(hDifficulty, CB_ADDSTRING, 0, (LPARAM)L"和平");
  68. SendMessage(hDifficulty, CB_ADDSTRING, 0, (LPARAM)L"简单");
  69. SendMessage(hDifficulty, CB_ADDSTRING, 0, (LPARAM)L"普通");
  70. SendMessage(hDifficulty, CB_ADDSTRING, 0, (LPARAM)L"困难");
  71. HWND hCheat = CreateWindow(
  72. L"BUTTON", L"作弊模式",
  73. WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
  74. 20, 210, 110, 40,
  75. hWnd1, NULL,
  76. (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
  77. );
  78. HWND hCheat_1 = CreateWindow(
  79. L"BUTTON", L"不修改此项",
  80. WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
  81. 150, 210, 150, 40,
  82. hWnd1, NULL,
  83. (HINSTANCE)GetWindowLongPtr(hWnd1, GWLP_HINSTANCE), NULL
  84. );
  85. SendMessage(hCheat_1, BM_SETCHECK, BST_CHECKED, 0);
  86. break;
  87. }
  88. case WM_CLOSE:
  89. DestroyWindow(hWnd1);
  90. break;
  91. case WM_DESTROY:
  92. hConfig = NULL;
  93. break;
  94. default:
  95. return DefWindowProc(hWnd1, msg, wParam, lParam);
  96. }
  97. }