Change window icon, make only one process possible

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Change window icon, make only one process possible

Postby kleon » Wed Mar 14, 2018 6:40 am

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.
kleon
Newbie
 
Posts: 8
Joined: Wed Mar 14, 2018 6:15 am

Re: Change window icon, make only one process possible

Postby kleon » Wed Mar 14, 2018 11:41 am

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?
kleon
Newbie
 
Posts: 8
Joined: Wed Mar 14, 2018 6:15 am

Re: Change window icon, make only one process possible

Postby HarmlessDave » Wed Mar 14, 2018 12:12 pm

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?
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm

Re: Change window icon, make only one process possible

Postby kleon » Wed Mar 14, 2018 12:57 pm

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.
kleon
Newbie
 
Posts: 8
Joined: Wed Mar 14, 2018 6:15 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 26 guests