|
1 |
| - |
2 |
| -import { CloseHandle, OpenProcess, QueryFullProcessImageName, GetClassName, GetForegroundWindow, GetWindowText, GetWindowThreadProcessId, MessageBox } from "libwin32" |
3 |
| -import { PSAR_ } from "../win32/consts/PSAR.js" |
| 1 | +import { |
| 2 | + GetForegroundWindow, GetWindowThreadProcessId, GetWindowText, |
| 3 | + OpenProcess, GetClassName, QueryFullProcessImageName, CloseHandle, |
| 4 | + MessageBox |
| 5 | +} from 'libwin32' |
| 6 | +import { PSAR_ } from 'libwin32/consts' |
4 | 7 |
|
5 | 8 | const windowHref = GetForegroundWindow()
|
6 |
| -const processId = GetWindowThreadProcessId(windowHref) |
| 9 | +const processId = GetWindowThreadProcessId(windowHref)[0] |
7 | 10 | const windowText = GetWindowText(windowHref)
|
8 | 11 |
|
9 | 12 | const openProcess = OpenProcess(PSAR_.PROCESS_QUERY_INFORMATION | PSAR_.PROCESS_VM_READ, false, processId)
|
10 | 13 | const className = GetClassName(windowHref)
|
11 | 14 |
|
12 | 15 | let executable
|
13 | 16 |
|
14 |
| -MessageBox(null, 'Testing2', "libwin32", 0) |
15 |
| -if(openProcess){ |
16 |
| - MessageBox(null, 'Testing', "libwin32", 0) |
| 17 | +MessageBox(null, 'Testing2', 'libwin32', 0) |
| 18 | +if (openProcess) { |
| 19 | + MessageBox(null, 'Testing', 'libwin32', 0) |
17 | 20 | executable = QueryFullProcessImageName(openProcess, 0)
|
18 | 21 | CloseHandle(openProcess)
|
19 | 22 | }
|
20 | 23 |
|
21 |
| - |
22 |
| - |
23 | 24 | MessageBox(
|
24 | 25 | null,
|
25 | 26 | `processId: ${processId}\n
|
26 | 27 | windowText: ${windowText}\n
|
27 | 28 | executable: ${executable}\n
|
28 | 29 | className: ${className}\n`,
|
29 |
| - "libwin32",0 |
| 30 | + 'libwin32', 0 |
30 | 31 | )
|
31 |
| - |
32 |
| - |
0 commit comments