// When cab download is finished, launch it. This will cause // wceload.exe to initiate installation process private void AllDone(object sender, System.EventArgs e) { Cursor.Current = Cursors.Default; string docname = cardocr_mobile6.camera_const.GetCurrentDirectory() + @"\download.cab"; int nSize = docname.Length * 2 + 2; IntPtr pData = LocalAlloc(0x40, nSize); Marshal.Copy(Encoding.Unicode.GetBytes(docname), 0, pData, nSize - 2); SHELLEXECUTEEX see = new SHELLEXECUTEEX(); see.cbSize = 60; see.dwHotKey = 0; see.fMask = 0; see.hIcon = IntPtr.Zero; see.hInstApp = IntPtr.Zero; see.hProcess = IntPtr.Zero;; see.lpClass = IntPtr.Zero; see.lpDirectory = IntPtr.Zero; see.lpIDList = IntPtr.Zero; see.lpParameters = IntPtr.Zero; see.lpVerb = IntPtr.Zero; see.nShow = 1; see.lpFile = pData; ShellExecuteEx(see); LocalFree(pData); Close(); }
static extern int ShellExecuteEx( SHELLEXECUTEEX ex );