Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7991551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:19:23+00:00 2026-06-04T13:19:23+00:00

var fpath=C:\\TVT_+cur_date+_+cur_time+.avi; Components.utils.import(resource://gre/modules/FileUtils.jsm); var env = Components.classes[@mozilla.org/process/environment;1] .getService(Components.interfaces.nsIEnvironment); var shell = new FileUtils.File(env.get(COMSPEC)); var

  • 0
 var fpath="C:\\TVT_"+cur_date+"_"+cur_time+".avi";

 Components.utils.import("resource://gre/modules/FileUtils.jsm");

 var env = Components.classes["@mozilla.org/process/environment;1"]
                .getService(Components.interfaces.nsIEnvironment);
 var shell = new FileUtils.File(env.get("COMSPEC"));

 var args = ["/c", "cd.. & cd.. & C: & cd C:/ffmpeg/bin & record.bat "+fpath];

 var process = Components.classes["@mozilla.org/process/util;1"]
                 .createInstance(Components.interfaces.nsIProcess);
 process.init(shell);
 process.runAsync(args, args.length);
  1. I don’t want to use taskkill.exe, /MIN, /C, /B, rather I want to quit this ffmpeg process
  2. I read about CMDOW but did not find cmdow.exe inside system32 directory.
  3. So how can I send quit command within the same window which is running ffmpeg process?

Using Windows XP service pack 2 with Firefox 12

Thanks..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:19:24+00:00Added an answer on June 4, 2026 at 1:19 pm

    That’s not quite trivial – Firefox doesn’t have any built-in functionality for that meaning that you would need to use js-ctypes for that and call Win32 API functions directly. Win32 – Get Main Wnd Handle of application describes how you would get hold of the top-level window for an application, after that you can send WM_QUIT message to it. This approach actually works:

    Components.utils.import("resource://gre/modules/ctypes.jsm");
    
    var userlib = ctypes.open("user32");
    
    var HWND = ctypes.voidptr_t;
    var UINT = ctypes.uint32_t;
    var WPARAM = ctypes.uint16_t;
    var LPARAM = ctypes.uint32_t;
    var LRESULT = ctypes.uint32_t;
    var DWORD = ctypes.uint32_t;
    var WNDENUMPROC = ctypes.FunctionType(ctypes.stdcall_abi,
                                          ctypes.bool,
                                          [HWND, LPARAM]).ptr;
    var WM_CLOSE = 0x0010;
    
    var EnumWindows = userlib.declare(
      "EnumWindows", ctypes.winapi_abi,
      ctypes.bool,
      WNDENUMPROC, LPARAM
    );
    
    var GetWindowThreadProcessId = userlib.declare(
      "GetWindowThreadProcessId", ctypes.winapi_abi,
      DWORD,
      HWND, DWORD.ptr
    );
    
    var IsWindowVisible = userlib.declare(
      "IsWindowVisible", ctypes.winapi_abi,
      ctypes.bool,
      HWND
    );
    
    var SendMessage = userlib.declare(
      "SendMessageW", ctypes.winapi_abi,
      LRESULT,
      HWND, UINT, WPARAM, LPARAM
    );
    
    var callback = WNDENUMPROC(function(hWnd, lParam)
    {
      var procId = DWORD();
      GetWindowThreadProcessId(hWnd, procId.address());
      if (procId.value == pid && IsWindowVisible(hWnd))
        SendMessage(hWnd, WM_CLOSE, 0, 0);
      return true;
    });
    EnumWindows(callback, 0);
    
    userlib.close();
    

    I tested this and could successfully close a Notepad window with it (the usual warning will appear if the text hasn’t been saved so it is a clean shutdown). In your case the problem might be however that you aren’t running your ffmpeg directly but rather via the command line shell – so you will close the command line window which might not terminate ffmpeg. I guess you will just have to try, if it doesn’t work you will probably have to look at the title of the window instead of its process ID (which is obviously a less reliable approach).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

var h=0; var w=0; $(.extend).hover(function() { //alert(h); $(this).css({'z-index' : '999' }); $(this).addClass(hover).filter(:not(:animated)).stop() .animate({ marginTop:
var stringToHighlight = [userinput] // may be any string like foo, bar or .
var pre = '<a href=someDirectoryPath'; var mid = '.aspx>'; var post = '</a>'; var
var $thingy = $('.thingy'), $window = $(window); $window.on('resize', function(){ thingy.width($window.width()/12); }); Is it possible
var conversations = new Array(); jQuery('.CChatWindow').each(function(){ if (jQuery(this).is(:visible) && jQuery(this).attr(data-conversationid) != 0) { alert(jQuery(this).attr(data-conversationid));
var chart; var d = new Array(); function click() { d = document.getElementById('graph:hi').value; alert(d);
var ddd = Math.random() * 16; console.log((ddd & 3 | 8).toString(16)); Help me please.
var positions = [ 00, 01, 02, 03, 04, 05 ]; jQuery.each( positions, function(players)
var parser = new DOMParser(), d = parser.parseFromString('<?xml version=1.0?><div class=a>Hello</div>', 'application/xhtml+xml'); console.log(d.querySelector('*')); console.log(d.querySelector('div')); console.log(d.querySelector('div.a'));
var = raw_input() if 0 in var or 1 in var or 2 in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.