childProcSet.cpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #include "Win32.h"
  2. #include "Function.h"
  3. HWND CreateChildWindow(HWND hFather, LPCWCHAR childTitle ,int x, int y, WNDPROC procFunc, LPCWCHAR className, HINSTANCE hInstanceF)
  4. {
  5. HWND hChild = NULL;
  6. static WNDCLASSEX wcexF;
  7. wcexF.cbSize = sizeof(WNDCLASSEX);
  8. wcexF.style = CS_HREDRAW | CS_VREDRAW;
  9. wcexF.lpfnWndProc = procFunc;
  10. wcexF.cbClsExtra = 0;
  11. wcexF.cbWndExtra = 0;
  12. wcexF.hInstance = hInstanceF;
  13. wcexF.hIcon = LoadIcon(wcexF.hInstance, IDI_APPLICATION);
  14. wcexF.hCursor = LoadCursor(NULL, IDC_ARROW);
  15. wcexF.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
  16. wcexF.lpszMenuName = NULL;
  17. wcexF.lpszClassName = className;
  18. wcexF.hIconSm = LoadIcon(wcexF.hInstance, IDI_APPLICATION);
  19. RegisterClassEx(&wcexF);
  20. hChild = CreateWindowEx(
  21. NULL,
  22. className, childTitle,
  23. WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU ,
  24. 700, 300,
  25. x, y, hFather, NULL,
  26. hInstanceF, NULL
  27. );
  28. Err(hChild,
  29. _T("Create ChildWindow failed!"));
  30. return hChild;
  31. }
  32. HWND CreateLogWindow(LPCWCHAR childTitle, int x, int y, WNDPROC procFunc, LPCWCHAR className, HINSTANCE hInstanceF)
  33. {
  34. HWND hChild = NULL;
  35. static WNDCLASSEX wcexF;
  36. wcexF.cbSize = sizeof(WNDCLASSEX);
  37. wcexF.style = CS_HREDRAW | CS_VREDRAW | CS_NOCLOSE;
  38. wcexF.lpfnWndProc = procFunc;
  39. wcexF.cbClsExtra = 0;
  40. wcexF.cbWndExtra = 0;
  41. wcexF.hInstance = hInstanceF;
  42. wcexF.hIcon = LoadIcon(wcexF.hInstance, IDI_APPLICATION);
  43. wcexF.hCursor = LoadCursor(NULL, IDC_ARROW);
  44. wcexF.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
  45. wcexF.lpszMenuName = NULL;
  46. wcexF.lpszClassName = className;
  47. wcexF.hIconSm = LoadIcon(wcexF.hInstance, IDI_APPLICATION);
  48. RegisterClassEx(&wcexF);
  49. hChild = CreateWindowEx(
  50. NULL,
  51. className, childTitle,
  52. WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX,
  53. 1000, 400,
  54. x, y, NULL , NULL,
  55. hInstanceF, NULL
  56. );
  57. Err(hChild,
  58. _T("Create ChildWindow failed!"));
  59. return hChild;
  60. }