[fpc-pascal]Obtaining Windows API handle of a new console.

Thomas Schatzl tom_at_work at yline.com
Sat Apr 21 12:00:57 CEST 2001

Subject: [fpc-pascal]Obtaining Windows API handle of a new console.


> Hi,
> I've looked all through the Windows API help system but I've failed to
> a method for obtaining the handle of the current console process.
> Eg. I start prog.exe. I want prog.exe to find out the handle that points
> itself, that Windows has created for it.
> Cheers for any help
> Andy

Depends of the type of handle you want to know:

window handle: I think the method proposed by Marco is correct. Although I'm
not sure if it doesn't fail under certain circumstances
process handle: GetCurrentProcess()
thread handle: GetCurrentThread()

etc. etc.


More information about the fpc-pascal mailing list