import os
import subprocess
import time
import win32api

os.chdir(r'C:\JXVCTK\JxVoCongTruyenKy')
print("Launching Game.exe...")
# Use ShellExecute with 'runas'
res = win32api.ShellExecute(0, "open", r"C:\JXVCTK\JxVoCongTruyenKy\Game.exe", "", r"C:\JXVCTK\JxVoCongTruyenKy", 1)
print("ShellExecute result:", res)

time.sleep(5)

# Check processes
pids = []
import win32process
for pid in win32process.EnumProcesses():
    try:
        h = win32api.OpenProcess(0x0410, False, pid)
        name = win32process.GetModuleFileNameEx(h, 0)
        if any(k in name.lower() for k in ['game', 'vggame']):
            pids.append((pid, name))
        win32api.CloseHandle(h)
    except:
        pass
print("Found processes:", pids)
