private void OnFunctionCalledPrinterStart(INktHook hhook, INktProcess proc, INktHookCallInfo callInfo) { if (IsWorkedPrintStart) { IsWorkedPrintStart = false; return; } int exitcode = 0; TypressService.eventLog1.WriteEntry("Printer Request Event!"); PageCnt = 0; if (TypressService.packet.IsLogin == false) { TypressService.eventLog1.WriteEntry("LoginForm 띄움"); //System.Diagnostics.Debugger.Launch(); } string applicationName = "C:\\Users\\jklh0\\source\\github\\Typress\\InterruptLogin\\InterruptLoginView\\InterruptLoginView\\bin\\x64\\Debug\\InterruptLoginView.exe"; ApplicationLoader.PROCESS_INFORMATION procInfo; ApplicationLoader.StartProcessAndBypassUAC(applicationName, out procInfo); WaitForSingleObject(procInfo.hProcess, 100000); GetExitCodeProcess(procInfo.hProcess, ref exitcode); //Process P = Process.Start("C:\\Users\\jklh0\\source\\github\\Typress\\InterruptLogin\\InterruptLoginView\\InterruptLoginView\\bin\\x64\\Debug\\InterruptLoginView.exe"); //P.WaitForExit(); // IsLogin 변수 바꼈는지? IsWorkedPrintStart = true; return; }
private void OnFunctionCalledPrinterEnd(INktHook hhook, INktProcess proc, INktHookCallInfo callInfo) { if (IsWorkedPrintEnd) { IsWorkedPrintEnd = false; return; } TypressService.eventLog1.WriteEntry("최종출력물 갯수 : "); TypressService.eventLog1.WriteEntry(PageCnt.ToString()); TypressService.eventLog1.WriteEntry("인쇄작업 종료!"); IsWorkedPrintEnd = true; }
private void OnFunctionCalledPrinter(INktHook hhook, INktProcess proc, INktHookCallInfo callInfo) { MyNewService.eventLog1.WriteEntry("Event."); if (num == "100") { MyNewService.eventLog1.WriteEntry("출력됩니당."); num = "0"; return; } MessageBox.Show("로그인"); if (num == "100") { MyNewService.eventLog1.WriteEntry("에엥?"); //hhook.Unhook(true); } }
private void OnNtWriteFile(INktHook hook, INktProcess proc, INktHookCallInfo callInfo) { var fileHandle = callInfo.Params().GetAt(0).SizeTVal; var fileName = ReadFileInfo(proc.Handle(WinEnum.PROCESS_WM_READ), fileHandle); if (fileName == null) { return; } lock (fileNames) { if (!fileNames.Contains(fileName)) { fileNames.Add(fileName); } } }
private void OnFunctionCalledPrintPage(INktHook hhook, INktProcess proc, INktHookCallInfo callInfo) { PageCnt++; TypressService.eventLog1.WriteEntry("Printer Count Increase Event Page."); TypressService.eventLog1.WriteEntry(PageCnt.ToString()); }