Jump to content
Macro Express Forums

Giving Focus To Program W/o Using Window Title?


hcour
 Share

Recommended Posts

I'm trying out a program called "Directory Opus", a file manager program. The title bar reflects whatever directory you're in w/in the program, for instance it will read C:\Documents and Settings or C:\Programs, etc. There are no preference settings to change this to a static title bar that just has the name of the program. I like to use hotkeys in ME to activate my most-used programs but since it does it by window title I cannot do that with Directory Opus. Is there any other way to give the window focus using an ME macro? I asked about it on their site and this was their response:

 

"In my opinion, a better solution for this particular problem is to ask the Macro Express team to add the ability to recognise windows by window class, which can be found using a tool like Spy++ (e.g. "dopus.lister"), and/or by the name of the executable that created them (e.g. "dopus.exe"). I know that several other macro tools can use window class instead of (or as well as) window title and if Macro Express supported this then the problem would be solved for many other programs, not just Opus. Of course, this is assuming that the ME folks will add a feature in similar time to the Opus guys. Getting a window's class is a very easy operation so it shouldn't be complicated for them to do."

 

Thanks,

Harold

Link to comment
Share on other sites

Hi guys,

 

Ok, this is what I've written using "Get Control", but it's not working exactly right. It will give focus to the window if the program is already running, but it won't launch the program:

 

_____

 

If Not Program Name "dopus.exe" running

Program Launch: "dopus.exe"

End If

If Program Name "dopus.exe" is running

Get Control %C1% (\: dopus folder tree)

Set Focus to %C1%

End If

_____

 

When I disable all commands but - Program Launch: "dopus.exe" - it does launch the program.

 

Thanks,

Harold

Link to comment
Share on other sites

You need to give the program some time to load. Try something like this:

If Not Program Name "dopus.exe" running
 Program Launch: "dopus.exe"
 Delay 5
End If
If Program Name "dopus.exe" is running
 Get Control %C1% (\: dopus folder tree)
 Set Focus to %C1%
End If

or this

If Not Program Name "dopus.exe" running
 Program Launch: "dopus.exe"
 Wait Window Title \:
 Delay 1
End If
If Program Name "dopus.exe" is running
 Get Control %C1% (\: dopus folder tree)
 Set Focus to %C1%
End If

Link to comment
Share on other sites

Thanks, but I found a simpler way to do it. Just using the "\" symbol in the "window title" activation works fine, since it's the only program I run (that I know of right now) that uses that backslash in the title bar. So it was that simple all along. But I didn't even now about "controls" so that was useful to learn that. Thanks much for all your help, ya'll are great!

 

Harold

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...