https://github.com/aziascreations/pb-win32-getconsoleprocesslist
PureBasic include for the Win32 GetConsoleProcessList function
https://github.com/aziascreations/pb-win32-getconsoleprocesslist
getconsoleprocesslist win32-api win32api
Last synced: 5 months ago
JSON representation
PureBasic include for the Win32 GetConsoleProcessList function
- Host: GitHub
- URL: https://github.com/aziascreations/pb-win32-getconsoleprocesslist
- Owner: aziascreations
- License: cc0-1.0
- Created: 2025-08-03T19:24:33.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-08-03T20:17:38.000Z (11 months ago)
- Last Synced: 2025-08-12T16:52:37.154Z (11 months ago)
- Topics: getconsoleprocesslist, win32-api, win32api
- Language: PureBasic
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# PB-Win32-GetConsoleProcessList
Include that provides a wrapper for the [GetConsoleProcessList](https://learn.microsoft.com/en-us/windows/console/getconsoleprocesslist)
Win32 function that isn't available by default in PureBasic.
## Usage
TODO: Indicate how to clone and add as a sub-module.
## Examples
Some examples can be found in the [Examples/](Examples/) sub-folder.
Alternatively, here is a shortened version of [Examples/IsProgramRunDirectly.pb](Examples/IsProgramRunDirectly.pb):
```purebasic
XIncludeFile "../Includes/Win32_GetConsoleProcessList.pbi"
Procedure.b IsProgramRunDirectly()
; Acts as a DWORD[2]
Define ProcessListBuffer.q
ProcedureReturn Bool(GetConsoleProcessList_(@ProcessListBuffer, 2) <= 1)
EndProcedure
If Not OpenConsole("Demo - IsProgramRunDirectly")
End 1
EndIf
If IsProgramRunDirectly()
Debug "Program was ran directly."
PrintN("Press enter to exit...")
Input()
Else
Debug "Program was ran through another process or CLI."
EndIf
End 0
```
## Technical Remarks
I was unable to use `.lib` files on x86 for this include for some weird reason.\
The linker kept saying it couldn't find the symbol even when dumpbin showed it, and when I made my own `.lib` out of a `.def`.
If you can fix this issue, feel free to contribute, or make your own repository.
## License
All the code in this repo is released in the [Public Domain](LICENSE).