Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: vuther.de on July 05, 2007, 02:35 PM

Title: API for Restoring a Window..
Post by: vuther.de on July 05, 2007, 02:35 PM
I need to know if there is an API that restores a hidden program with using PID.

If so, what is it?

Thanks.
Title: Re: API for Restoring a Window..
Post by: l2k-Shadow on July 05, 2007, 05:17 PM
solved over aim.
Title: Re: API for Restoring a Window..
Post by: l)ragon on July 05, 2007, 06:22 PM
Quote from: l2k-Shadow on July 05, 2007, 05:17 PM
solved over aim.
That dosen't tell anyone the solution to the problem.
Title: Re: API for Restoring a Window..
Post by: l)ragon on July 05, 2007, 06:29 PM
Quote from: l)ragon on July 05, 2007, 06:22 PM
Quote from: l2k-Shadow on July 05, 2007, 05:17 PM
solved over aim.
That dosen't tell anyone the solution to the problem.


Edit: Look up the following.[WINDOWPLACEMENT].ShowCommand = SW_SHOWNORMAL

SetWindowPlacement([Application].HWND, [WINDOWPLACEMENT])



edit re: heh hit reply instead of modify
Title: Re: API for Restoring a Window..
Post by: l2k-Shadow on July 05, 2007, 07:25 PM
yes but he didn't have the window handle, he had the process id only. he also said he was unable to use FindWindow but we later found out he could.

so:
hwnd = FindWindow()
to kill process:
GetWindowThreadId(hwnd, pid)
hproc = OpenProcess(PROCESS_ALL_ACCESS, 0, pid)
TerminateProcess(hproc, 0)
CloseHandle(hproc)
to show window:
ShowWindow(hwnd, SW_SHOWNORMAL)