ShellExecuteEx : get parent PID and close it - pid

I run a child app using ShellExecuteEx command under windows. Now I want the child app to send a wm_close command to the parent app (the caller of this app) . Is that possible ?

Related

How to create subprocess using exec in Typescript Class?

I would like to automate making MR in gitlab. Once a button is pressed in my React/Typescript UI, I'd like to run command-line code in my typescript class to clone a repo. However, when I try to use exec I always get this error: TypeError: exec is not a function.
My Typescript Class:
const { exec } = require("child_process");
export class GitlabRepo {
constructor(){
}
clone(){
console.log("CLONE");
exec("ls -la", (error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`);
return;
}
if (stderr) {
console.log(`stderr: ${stderr}`);
return;
}
console.log(`stdout: ${stdout}`);
});
}
commit(message: string){
console.log("COMMIT", message);
}
push(){
console.log("PUSH");
}
}
For now I am just trying to get some mock functionality of ls -la running. Ideally I'd replace those commands with "git clone repo-here"
JavaScript running in the browser does not have permission to execute processes. child_process is provided by Node, but not web browsers.
You have a few options to launch Git from React:
If you want to build a web app, then the web app must make HTTP calls to a server, and the server will call exec to launch Git.
If you want to use React but don't care if it's a web app, you could use Ink to build a terminal app. A terminal app is executed by Node, so you have access to execute processes.

Launching Dash app with Batch file fails with Double click

I'm learning Dash and I'm trying to set up a small batch file to launch the app.
I'm using as an example the first app on this plotly page. The app is very simple, and I included the code in a file called smallapp.py.
I use Anaconda as Python distribution, so I wrote a batch file called launch_smallapp.bat like this:
call C:\Users\Roberto\Anaconda3\Scripts\activate.bat
python C:\rob\Python\battest\smallapp.py
If I open a Command Prompt and type launch_smallapp.bat, the app starts correctly and I can visualise it at the url http://127.0.0.1:8050/
However, if I double-click the file launch_smallapp.bat the app doesn't work.
The Command Prompt shows the normal messages of the app being started, but if I visit the url the browser just says that the site can't be reached.
The other thing is, the Command Prompt appears with a green frame.
Does anybody have any idea?
Thanks.

Issue with lazy loaded angularjs child module with routes (states)

I'm working with an angularjs + ui-router application which is a shell application of my other angularjs application (basically header + footer + sidenav).
Each application I'm developing is complied and stored as an npm library which eventually being used as a dependency in package.json of my shell application.
when shell application is loaded it's decide which of my other application should be rendered inside as a ui-view content by the state that defined in the shell application.
This is the shell application state definitions:
$stateProvider
.state('content', {
url: '/:appName', ...
There are some other states defined in the child application which uses the "content" state as a parent state, for example:
$stateProvider.state('child', {
url: '/child1',
parent: 'content',
component: 'childComponent'});
Routing works as expected only after everything is already loaded.
The problem is that on every browser refresh, the shell application loads first, at that certain point the following route for example:
http://localhost:8000/#/childapp1/chid1 is not a valid route since the child routes (states) is not loaded yet.
The only solution I came with is stored the url in a global variable the then use it as a "return url" pattern, which works.
I was wondering if there is a better solution for the my problem.
Appreciate your help,
N

Detaching React js project on Ubuntu

I have created two React projects using React Js. The both of them are for different purposes. One is successfully running on 1.2.3.4:3000 here the port is default (3000) But I have another react project with port 4000. Now how can I run or deploy the second React js(client) on port 4000?
Folder structure
/
|-- adminReact (port 3000)
|
|--clientReact (port 4000)
Thankyou all
I managed this problem with the hekp of linux screen.
I created two screens with meaningful name. Then O run the react projects on different port.
screen -R adminReact
Then go inside the adminRea t directory then start the adminReact project. After successful running, I pressed ctrl + a + d to detach from the screen.
Then type exit will close the screen.
Then takea new putty session. After that create a new screen screen -R clientReact for the clien react projects.Then go inside the folder then start the project, after successful running press ctrl + a + d to detach the screen.
That's it

MEF: How to send message from module to host application

I've got next problem. I have a 3 modules and a host application. How to send an event with params (or command with params) from modules and hadle it in host application or in another module?

Resources