1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//! Process management module (refactored)
//!
//! Provides a three-layer architecture for process management:
//! - **Config Layer**: Immutable configurations defining how to find processes
//! - **Instance Layer**: Runtime state holding actual system resources
//! - **Manager Layer**: Centralized lifecycle management for multiple processes
//!
//! # Architecture Overview
//! ```text
//! ProcessManager (manages multiple processes)
//! └─> Process (single process instance)
//! ├─ Config (immutable settings)
//! └─ State (runtime resources: PID, handles, DC)
//! ```
//!
//! # Quick Start
//!
//! ## Simple Usage (Quick Initialization)
//! ```no_run
//! use win_auto_utils::process::Process;
//!
//! // Quick way: just specify the process name
//! let mut process = Process::by_name("notepad.exe");
//! if let Ok(_) = process.init() {
//! println!("PID: {:?}", process.pid());
//! }
//! ```
//!
//! ## Advanced Usage (With Builder)
//! ```no_run
//! use win_auto_utils::process::{Process, ProcessConfig};
//!
//! // Use builder for fluent configuration
//! let config = ProcessConfig::builder("game.exe")
//! .set_window_client_mode()
//! .exclude_invisible()
//! .build();
//! let mut process = Process::new(config);
//! if let Ok(_) = process.init() {
//! println!("Connected!");
//! }
//! ```
//!
//! ## Custom Initialization Flags
//! ```no_run
//! use win_auto_utils::process::{Process, ProcessConfig, InitFlags};
//!
//! // Control which resources are initialized based on your needs
//! let config = ProcessConfig::builder("app.exe")
//! .init_flags(InitFlags::memory_only()) // Only PID + HANDLE for memory operations
//! .build();
//! let mut process = Process::new(config);
//! if let Ok(_) = process.init() {
//! println!("Ready for memory operations");
//! }
//! ```
//!
//! ## Manager Usage (Multiple Processes)
//! ```no_run
//! use win_auto_utils::process::ProcessManager;
//!
//! let mut manager = ProcessManager::new();
//! manager.register_alias("game", "lf2.exe").ok();
//! manager.init("game").ok();
//! ```
// Re-export main types for convenience
pub use ;
pub use ProcessManager;
pub use ;