Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » Just one instance of application running (SingleApp)
Re: Just one instance of application running (SingleApp) [message #24645 is a reply to message #24644] Tue, 26 January 2010 11:17 Go to previous message
koldo is currently offline  koldo
Messages: 3437
Registered: August 2008
Senior Veteran
Sc0rch wrote on Tue, 26 January 2010 11:11

Eurika, Koldo! Function GetWindowIdFromCaption works only for visible windows! So your variant is better, thanks!

Code is clear, but I think this:
	bool IsSingleApp() {
		return GetWindowIdFromCaption(GetTitle().ToString()) <= 0;
	}

looks a little bit better than:

	bool IsSingleApp() {
		if(GetWindowIdFromCaption(GetTitle().ToString()) > 0) 
			return false;
		return true;
	}

or not? Rolling Eyes

Best regards,
Anton


Of course your is better Very Happy


Best regards
IƱaki
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Port giFT (a great but abandoned P2P project) to U++?
Next Topic: array vs. array's items.id sorting/searching
Goto Forum:
  


Current Time: Fri Jul 18 05:43:57 CEST 2025

Total time taken to generate the page: 0.08846 seconds