handle.c

来自「SimpleGraphicOperatingSystem 32位图形化操作系统 」· C语言 代码 · 共 44 行

C
44
字号
#include <api.h>
#include <stdio.h>
#include <windows.h>


//可以关闭各种句柄
/*
Access token,Communications device ,Console input ,Console screen buffer ,Event 
,File ,File mapping ,Job ,Mailslot ,Memory resource notification ,Mutex 
,Named pipe ,Pipe ,Process ,Semaphore ,Socket ,Thread ,Transaction ,Waitable timer */
BOOL WINAPI CloseHandle(
  HANDLE hObject
){
    printf("CloseHandle: 0x%X\n", hObject );
    return TRUE;
}

//等待对象 
DWORD WINAPI WaitForMultipleObjects(
  DWORD nCount,
  const HANDLE* lpHandles,
  BOOL bWaitAll,
  DWORD dwMilliseconds
){
    printf("WaitForMultipleObjects: %d, 0x%X, %d, %d\n", 
        nCount,lpHandles, bWaitAll,dwMilliseconds );
    return 0;
}
/*
STD_INPUT_HANDLE
(DWORD)-10 Handle to the standard input device. Initially, this is a handle to the console input buffer, CONIN$. 
STD_OUTPUT_HANDLE
(DWORD)-11 Handle to the standard output device. Initially, this is a handle to the active console screen buffer, CONOUT$. 
STD_ERROR_HANDLE
(DWORD)-12 Handle to the standard error device. Initially, this is a handle to the active console screen buffer, CONOUT$. 
*/
HANDLE WINAPI GetStdHandle(
  DWORD nStdHandle
){
    printf("GetStdHandle %d\n", nStdHandle );
    return 2;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?