📄 com.cpp
字号:
// Com.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <FltUser.h>
#define COMM_PORT_NAME L"\\CommPort";
typedef enum _READ_DIR_COMMAND {
FStart
} READ_DIR_COMMAND;
struct READ_DIR_MESSAGE {
READ_DIR_COMMAND Command;
};
int main(int argc, char* argv[])
{
HRESULT hResult = S_OK;
HANDLE port = INVALID_HANDLE_VALUE;
DWORD bytesReturned = 0;
READ_DIR_MESSAGE command;
command.Command = FStart;
//hResult = FilterConnectCommunicationPort(COMM_PORT_NAME, 0, NULL, 0, NULL, &port);
hResult = FilterConnectCommunicationPort(L"\\CommPort", 0,NULL,0,NULL,&port );
if (IS_ERROR( hResult )) {
printf( "Could not connect to filter: 0x%08x\n", hResult );
return 0;
}
else
{
printf("connect ok \n");
}
hResult = FilterSendMessage( port, &command, sizeof(READ_DIR_COMMAND), 0, 0, &bytesReturned );
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -