Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: AppActivate Powerhome Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
eHomeCreations
Groupie
Groupie


Joined: February 02 2007
Location: Ukraine
Online Status: Offline
Posts: 64
Posted: April 06 2007 at 15:19 | IP Logged Quote eHomeCreations

All.

From eHome I am trying to activate the instance of Powerhome that is currently running and bring it to the foreground. Normally I would call the API and search for the caption of the program and get the hwnd and then send a API message to activate it.

I am not able to find powerhome.    I know the same thing happens to FoxPro apps too. Is this a PowerBuilder thing?

Anyway... ideas?


__________________
--Steve       http://www. ehomecreations.com
Back to Top View eHomeCreations's Profile Search for other posts by eHomeCreations Visit eHomeCreations's Homepage
 
dhoward
Admin Group
Admin Group
Avatar

Joined: June 29 2001
Location: United States
Online Status: Offline
Posts: 4447
Posted: April 06 2007 at 15:51 | IP Logged Quote dhoward

Steve,

PowerHome has several built-in functions that may help.

ph_handle() returns the handle of the main PowerHome frame window.

ph_setforegroundwindow will set a particular handle to be the foreground window. You could bring PowerHome to the foreground with: ph_setforegroundwindow(ph_handle())

You may also want to look at the ph_windowstate function as well.

All of these functions are callable using the socket server or through a plugin.

Concerning your specific problem though...the title of the PowerHome window is " PowerHome " with a single space in front and two spaces after.

Hope this helps,

Dave.
Back to Top View dhoward's Profile Search for other posts by dhoward Visit dhoward's Homepage
 
eHomeCreations
Groupie
Groupie


Joined: February 02 2007
Location: Ukraine
Online Status: Offline
Posts: 64
Posted: April 06 2007 at 16:08 | IP Logged Quote eHomeCreations

Thanks for the info!

That was it. " PowerHome " with the spaces worked great.

My VBA function is:

'--- shells or finds a application
dim sadStartsWith: sadStartsWith = 0
dim sadContains: sadContains = 1
dim sadMatches: sadMatches = 2

Dim sPrgCation,sPathAndFile, nFindWinBy      

nFindWinBy = sadStartsWith
sPathAndFile = "C:\Program Files\powerhome\pwrhome.exe"
sPrgCation = " powerhome "

g_oGbl.EH_AppActivate sPrgCation,sPathAndFile, nFindWinBy      


Now all works GREAT!



__________________
--Steve       http://www. ehomecreations.com
Back to Top View eHomeCreations's Profile Search for other posts by eHomeCreations Visit eHomeCreations's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum