Get content in stdout



I am doing a simple electron app in which I do FFI call to a native DLL (The app is only meant to work in Windows). The calls works fine but the DLL print some useful messages to sdtout. My goal is to retrieve those messages to display them to the user. I have tried several things but got no luck so far. So is it possible to achieve what I am trying to do ? And if yes, can you provide some advice ?