Skip to content
This repository was archived by the owner on Jun 6, 2022. It is now read-only.

Commit cb1dbad

Browse files
author
adaei
committed
removed isProcessAvailable added .gitignore file
1 parent 39e6dc1 commit cb1dbad

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

java-win-memory-trainer/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target

java-win-memory-trainer/src/main/java/com/sprogcoder/memory/JTrainer.java

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,32 +36,15 @@ public byte[] readProcessMemory(int lpBaseAddress, int nSize) throws MemoryExcep
3636
JKernel32.closeHandle(hProcess);
3737
return result;
3838
}
39-
39+
4040
public String getLastError()
4141
{
4242
return JKernel32.getLastError();
4343
}
44-
45-
public void retryProcess() throws WindowNotFoundException
46-
{
47-
if (!isProcessAvailable())
48-
{
49-
this.pid = JUser32.getWindowThreadProcessId(JUser32.findWindow(windowClass, windowText));
50-
}
51-
}
5244

53-
public boolean isProcessAvailable()
45+
public void retryProcess() throws WindowNotFoundException
5446
{
55-
try
56-
{
57-
JKernel32.openProcess(this.pid);
58-
return true;
59-
}
60-
catch (MemoryException e)
61-
{
62-
//
63-
}
64-
return false;
47+
this.pid = JUser32.getWindowThreadProcessId(JUser32.findWindow(windowClass, windowText));
6548
}
6649

6750
}

0 commit comments

Comments
 (0)