@@ -39,6 +39,9 @@ public JTrainer(String windowClass, String windowText) throws WindowNotFoundExce
39
39
this .pid = getProcessIdFromWindow (windowClass , windowText );
40
40
}
41
41
42
+ /*
43
+ * Internal Functions
44
+ */
42
45
private HWND findWindow (String lpClassName , String lpWindowName ) throws WindowNotFoundException
43
46
{
44
47
HWND hWnd = JUser32 .findWindow (lpClassName , lpWindowName );
@@ -51,33 +54,17 @@ private HWND findWindow(String lpClassName, String lpWindowName) throws WindowNo
51
54
return hWnd ;
52
55
}
53
56
54
- public String getLastError ()
55
- {
56
- return JKernel32 .getLastError ();
57
- }
58
-
59
57
private int getProcessIdFromWindow (String lpClassName , String lpWindowName ) throws WindowNotFoundException
60
58
{
61
59
return getWindowTheadProcessId (findWindow (windowClass , windowText ));
62
60
}
63
61
64
- public int getWindowTheadProcessId (HWND hWnd )
62
+ private int getWindowTheadProcessId (HWND hWnd )
65
63
{
66
64
return JUser32 .getWindowThreadProcessId (hWnd );
67
65
}
68
-
69
- public boolean isProcessAvailable ()
70
- {
71
- int hProcess = JKernel32 .openProcess (pid );
72
- return (hProcess > 0 );
73
- }
74
-
75
- public void retryProcess () throws WindowNotFoundException
76
- {
77
- this .pid = getProcessIdFromWindow (windowClass , windowText );
78
- }
79
66
80
- public int openProcess (int dwProcessId ) throws MemoryException
67
+ private int openProcess (int dwProcessId ) throws MemoryException
81
68
{
82
69
int hProcess = JKernel32 .openProcess (pid );
83
70
@@ -88,7 +75,26 @@ public int openProcess(int dwProcessId) throws MemoryException
88
75
89
76
return hProcess ;
90
77
}
78
+
79
+ /*
80
+ * External Functions
81
+ */
82
+ public String getLastError ()
83
+ {
84
+ return JKernel32 .getLastError ();
85
+ }
91
86
87
+ public boolean isProcessAvailable ()
88
+ {
89
+ int hProcess = JKernel32 .openProcess (pid );
90
+ return (hProcess > 0 );
91
+ }
92
+
93
+ public void retryProcess () throws WindowNotFoundException
94
+ {
95
+ this .pid = getProcessIdFromWindow (windowClass , windowText );
96
+ }
97
+
92
98
public byte [] readProcessMemory (int lpBaseAddress , int nSize ) throws MemoryException
93
99
{
94
100
int hProcess = openProcess (pid );
0 commit comments