02 2014 档案

win32 signal
摘要:RemarksThesignalfunction enables a process to choose one of several ways to handle an interrupt signal from the operating system. Thesigargument is the interrupt to whichsignalresponds; it must be one of the following manifest constants, which are defined in SIGNAL.H.sigvalueDescriptionSIGABRTAbnorm 阅读全文

posted @ 2014-02-26 19:50 偏爱省略号 阅读(690) 评论(0) 推荐(0)

How to send CTRL+BREAK signal to detached command-line process
摘要:1.GenerateConsoleCtrlEvent functionSends a specified signal to a console process group that shares the console associated with the calling process.for detail:http://msdn.microsoft.com/en-us/library/windows/desktop/ms683155(v=vs.85).aspx2.Send signalBrowsing though MSDN showed thatGenerateConsoleCtrl 阅读全文

posted @ 2014-02-26 19:36 偏爱省略号 阅读(1075) 评论(0) 推荐(0)

RegisterWindowMessage
摘要:RegisterWindowMessage functionDefines a new window message that is guaranteed to be unique throughout the system. The message value can be used when sending or posting messages.SyntaxC++UINT WINAPI RegisterWindowMessage( _In_LPCTSTR lpString);ParameterslpString[in]Type:LPCTSTRThe message to be regi. 阅读全文

posted @ 2014-02-21 18:55 偏爱省略号 阅读(820) 评论(0) 推荐(0)

windows下进程间通信(转)
摘要:摘要随着人们对应用程序的要求越来越高,单进程应用在许多场合已不能满足人们的要求。编写多进程/多线程程序成为现代程序设计的一个重要特点,在多进程程序设计中,进程间的通信是不可避免的。Microsoft Win32 API提供了多种进程间通信的方法,全面地阐述了这些方法的特点,并加以比较和分析,希望能给读者选择通信方法提供参考。关键词进程进程通信IPC Win32 API1进程与进程通信 进程是装入内存并准备执行的程序,每个进程都有私有的虚拟地址空间,由代码、数据以及它可利用的系统资源(如文件、管道等)组成。多进程/多线程是Windows操作系统的一个基本特征。Microsoft Win32应用. 阅读全文

posted @ 2014-02-20 19:17 偏爱省略号 阅读(448) 评论(0) 推荐(0)

SetConsoleCtrlHandler
摘要:Excerpt:Registering a Control Handler FunctionThis is an example of theSetConsoleCtrlHandlerfunction that is used to install a control handler.When a CTRL+C signal is received, the control handler returnsTRUE, indicating that it has handled the signal. Doing this prevents other control handlers from 阅读全文

posted @ 2014-02-20 18:51 偏爱省略号 阅读(999) 评论(0) 推荐(0)

TerminateProcess
摘要:RemarksTheTerminateProcessfunction is used to unconditionally cause a process to exit. The state of global data maintained by dynamic-link libraries (DLLs) may be compromised ifTerminateProcessis used rather thanExitProcess.This function stops execution of all threads within the process and requests 阅读全文

posted @ 2014-02-19 19:32 偏爱省略号 阅读(1043) 评论(0) 推荐(0)

va_list
摘要:void Log( const TCHAR *pszFormat, ... ){ TCHAR buf[1024] ; va_list arglist ; try { _tcscpy_s ( buf, 1023, _T("\... 阅读全文

posted @ 2014-02-11 16:43 偏爱省略号 阅读(407) 评论(0) 推荐(0)

Event log c++ sample.
摘要:1. Init regedit.bool InitLog( TCHAR *logName, TCHAR *sourceName, TCHAR *MessageDllName ) { // This number of categories for the event source. DWORD dwCategoryNum = 1; HKEY hk; DWORD dwData, dwDisp; TCHAR szBuf[MAX_PATH]; size_t cchSize = MAX_PATH; ... 阅读全文

posted @ 2014-02-11 15:55 偏爱省略号 阅读(729) 评论(0) 推荐(0)

EVENT LOGGING
摘要:1.EVENT LOGGING概述当错误发生时,系统管理员或技术支持需要知道错误原因是什么,如何恢复丢失数据和阻止错误复现。WINDOWS的Event-logging服务为此提供了解决方案。应用程序,操作系统或其它系统服务可以向该服务记录重要的事件消息,如:磁盘空间不足、没有访问权限等。系统管理员可以通过这些消息来确定错误发生的原因以及发生的上下文环境。通过定期的查看这些日志还可以帮助管理员在系统造成大的破坏前发现问题。Event-logging服务是随着WINDOWS系统的启动而被默认启动的,但可以通过服务控制面板停止该服务。Windows for Workgroups、Windows NT 阅读全文

posted @ 2014-02-11 14:47 偏爱省略号 阅读(1725) 评论(0) 推荐(0)

导航