I'm working on developing Chrome Extension for several weeks. I have almost completed a demo version of chrome extension now. but I have one problem I don't know so that I wanna get some help from you guys.I've written the host in c# lang My host program is running even though the chrome browser was closed. and then my host program is launching again when chrome browser was re-open. which means my host programs are stacking whenever chrome browser was all closing then re-opening. how can I solve this problem? Plz, help me and advice me. Thanks in advance :D
[DllImport("Kernel32")] private static extern bool SetConsoleCtrlHandler(EventHandler handler, bool add); private delegate bool EventHandler(CtrlType sig); static EventHandler _handler; enum CtrlType { CTRL_C_EVENT = 0, CTRL_BREAK_EVENT = 1, CTRL_CLOSE_EVENT = 2, CTRL_LOGOFF_EVENT = 5, CTRL_SHUTDOWN_EVENT = 6 } private static bool Handler(CtrlType sig) { switch (sig) { case CtrlType.CTRL_C_EVENT: case CtrlType.CTRL_LOGOFF_EVENT: case CtrlType.CTRL_SHUTDOWN_EVENT: case CtrlType.CTRL_CLOSE_EVENT: default: return false; } } static void Main(string[] args) { // Some biolerplate to react to close window event _handler += new EventHandler(Handler); SetConsoleCtrlHandler(_handler, true); ... }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)