mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-02 22:36:00 +02:00
Initial console support
This commit is contained in:
parent
45a5978611
commit
186c2125fa
21 changed files with 1244 additions and 29 deletions
|
@ -35,6 +35,16 @@ namespace System.Diagnostics
|
|||
}
|
||||
}
|
||||
|
||||
public int ProcessId
|
||||
{
|
||||
get
|
||||
{
|
||||
if (mSpawn == null)
|
||||
return -1;
|
||||
return Platform.BfpSpawn_GetProcessId(mSpawn);
|
||||
}
|
||||
}
|
||||
|
||||
public this()
|
||||
{
|
||||
mSpawn = null;
|
||||
|
|
|
@ -243,6 +243,8 @@ namespace System
|
|||
public static void BfpProcess_GetProcessName(BfpProcess* process, char8* outName, int32* inOutNameSize, BfpProcessResult* outResult) => Runtime.NotImplemented();
|
||||
|
||||
public static int32 BfpProcess_GetProcessId(BfpProcess* process) => Runtime.NotImplemented();
|
||||
|
||||
public static int BfpSpawn_GetProcessId(BfpSpawn* spawn) => Runtime.NotImplemented();;
|
||||
#endif
|
||||
|
||||
public enum BfpSpawnFlags : int32
|
||||
|
@ -286,6 +288,8 @@ namespace System
|
|||
public static extern bool BfpSpawn_WaitFor(BfpSpawn* spawn, int waitMS, int* outExitCode, BfpSpawnResult* outResult);
|
||||
[CallingConvention(.Stdcall), CLink]
|
||||
public static extern void BfpSpawn_GetStdHandles(BfpSpawn* spawn, BfpFile** outStdIn, BfpFile** outStdOut, BfpFile** outStdErr);
|
||||
[CallingConvention(.Stdcall), CLink]
|
||||
public static extern int BfpSpawn_GetProcessId(BfpSpawn* spawn);
|
||||
|
||||
[CallingConvention(.Stdcall), CLink]
|
||||
public static extern int BfpProcess_GetCurrentId();
|
||||
|
|
|
@ -101,6 +101,12 @@ namespace System
|
|||
public function int WndProc(HWnd hWnd, int32 msg, int wParam, int lParam);
|
||||
public delegate IntBool EnumThreadWindowsCallback(HWnd hWnd, void* extraParameter);
|
||||
|
||||
public struct Rect : this(int32 left, int32 top, int32 right, int32 bottom)
|
||||
{
|
||||
public int32 Width => right - left;
|
||||
public int32 Height => bottom - top;
|
||||
}
|
||||
|
||||
[CRepr]
|
||||
public struct OpenFileName
|
||||
{
|
||||
|
@ -1737,6 +1743,9 @@ namespace System
|
|||
public static extern int SetWindowLongPtrW(int hWnd, int32 nIndex, int value);
|
||||
#endif
|
||||
|
||||
[Import("user32.lib"), CLink, CallingConvention(.Stdcall)]
|
||||
public static extern IntBool SetWindowPos(HWnd hWnd, HWnd hWndAfter, int x, int y, int cx, int cy, int flags);
|
||||
|
||||
[Import("user32.lib"), CLink, CallingConvention(.Stdcall)]
|
||||
public static extern IntBool PostMessageW(HWnd hWnd, int32 msg, int wParam, int lParam);
|
||||
|
||||
|
@ -1773,6 +1782,9 @@ namespace System
|
|||
[Import("user32.lib"), CLink, CallingConvention(.Stdcall)]
|
||||
public static extern int32 GetWindowTextA(HWnd hWnd, char8* ptr, int32 length);
|
||||
|
||||
[Import("user32.lib"), CLink, CallingConvention(.Stdcall)]
|
||||
public static extern IntBool AdjustWindowRectEx(ref Rect rect, uint32 style, IntBool menu, uint32 exStyle);
|
||||
|
||||
[CLink, CallingConvention(.Stdcall)]
|
||||
public static extern int32 GetWindowThreadProcessId(HWnd handle, out int32 processId);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue