window.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #pragma once
  2. #ifdef _WIN32
  3. #include <vector>
  4. #include "base/define.h"
  5. namespace ylib{
  6. namespace window
  7. {
  8. //取父句柄
  9. size_t parent(size_t handle);
  10. //取窗口类名
  11. std::string class_name(size_t handle);
  12. //取窗口标题
  13. std::string title_name(size_t handle);
  14. //置窗口标题
  15. bool title_name(size_t handle, const std::string& name);
  16. // 查找
  17. size_t find(const std::string& class_name, const std::string& title_name = "");
  18. std::vector<size_t> find(size_t parent = 0, const std::string& class_name = "", const std::string& title_name = "", const std::string& filepath = "");
  19. // 取矩形
  20. ylib::Rect rect(size_t handle);
  21. // 设置父句柄
  22. void set_parent(size_t handle, size_t parent);
  23. // 取进程路径
  24. std::string path(size_t handle);
  25. // 关闭
  26. void close(size_t handle);
  27. // 内容
  28. void content(size_t handle, const std::string& value);
  29. std::string content(size_t handle);
  30. namespace menu
  31. {
  32. bool click(size_t handle, size_t menu_child_handle, uint32 menu_item_idx);
  33. size_t get(size_t handle);
  34. size_t child(size_t menu_handle, uint32 menu_childs_idx);
  35. }
  36. namespace checkbox
  37. {
  38. bool checked(size_t handle);
  39. bool checked(size_t handle, bool checked);
  40. }
  41. namespace tab
  42. {
  43. void current(size_t handle, uint32 idx);
  44. }
  45. namespace button
  46. {
  47. bool click(size_t handle);
  48. bool click(size_t parent, const std::string& class_name, const std::string& title_name = "");
  49. }
  50. namespace list
  51. {
  52. void insert(size_t handle, uint32 index, const std::string& value);
  53. }
  54. void rect_sort(std::vector<size_t>& list, uint32 type, bool ps = true);
  55. bool enable(size_t win_handle, bool enable);
  56. }
  57. }
  58. #endif