Any way to bring Unity3d to the foreground? -


i have sent user out browser application.openurl. , want programatically bring unity foreground.

is there way without plugin?

thanks.

if using unity3d in windows, try below code after calling application.openurl(...) :

[dllimport("user32.dll")] private static extern bool setforegroundwindow(intptr hwnd);  var prc = process.getprocessesbyname("..."); //get unity's process, or  var prc = process.getcurrentprocess(); if (prc.length > 0)      setforegroundwindow(prc[0].mainwindowhandle); 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -