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 #24627 is a reply to message #24617] Mon, 25 January 2010 22:52 Go to previous messageGo to previous message
koldo is currently offline  koldo
Messages: 3437
Registered: August 2008
Senior Veteran
Sc0rch wrote on Mon, 25 January 2010 18:09

koldo wrote on Mon, 25 January 2010 21:11


Hello Sc0rch

If you use GetWindowIdFromCaption() (SysInfo package) instead of FindWindow, this code will serve you for Linux too.

Sorry for the propaganda Smile

Best regards
Koldo



Hmm, function not work, what I'm doing wrong?

if (GetWindowIdFromCaption(name, true) >= 0)
	{
		if (message)
			Exclamation("Another instance of application already exists!");
		return false;
	}



Hello Sc0rch

GetWindowIdFromCaption(name, true) tries to find a window with title == name.

GetWindowIdFromCaption(name, false) will get the window handle of the window with a title that just contains name.

If it does not work could you give me more details ?.

Best regards
Koldo


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 10:08:06 CEST 2025

Total time taken to generate the page: 0.02848 seconds