Page 1 of 1

Change window icon, make only one process possible

PostPosted: Wed Mar 14, 2018 6:40 am
by kleon
Hello,

I'm new in C++ and I've just built cefsimple project via Visual Studio 2017. Now I need to change application icons. I put my icons to the res folder instead of default cefsimple icons and rebuild the project. All icons were changed except the window icon (on the top-left corner), it remains the same. How can I change it?

Also, what is the way to force my application to close itself when new instance is opening? (make only one application process running at the same time possible)?

I'd appreciate any advise to these questions.

P.S. Sorry for bad English, I’m not native speaker.

Re: Change window icon, make only one process possible

PostPosted: Wed Mar 14, 2018 11:41 am
by kleon
Also, I tried to pass chromium argument via CMD "--app-shell-host-window-size" to set window size, but it doesn't work. How can I set window size to Cefsimple project?

Re: Change window icon, make only one process possible

PostPosted: Wed Mar 14, 2018 12:12 pm
by HarmlessDave
Single instance: For Windows, use a MUTEX. A Google search of something like "Windows single instance mutex" should turn up many examples, here is one from StackOverflow (the second answer) - https://stackoverflow.com/questions/651 ... nce-or-not

You should add the mutex check after the code that runs child processes for renderer, etc. so just above these lines:

Code: Select all
 // Specify CEF global settings here.
  CefSettings settings;


Icon: did you replace the file for IDI_SMALL = small.ico?

Re: Change window icon, make only one process possible

PostPosted: Wed Mar 14, 2018 12:57 pm
by kleon
You should add the mutex check after the code that runs child processes for renderer, etc. so just above these lines:

Thanx!

Icon: did you replace the file for IDI_SMALL = small.ico?

Yes, I did.