You are viewing limited content. For full access, please sign in.

Question

Question

Setting Focus/Selecting a document via Client Automation

SDK
asked on October 30, 2014

We have an integration situation where we need to set focus on the top document in a folder already open in a Main window.

 

This is a production process that run as follows:

-- The user has launched Laserfiche, and opens a folder with multiple documents.

-- The user starts by selecting a document.

-- From a separate terminal emulator, we index the document that the user has selected via a script run from the emulator (Blue Zone).

-- At that point, workflow whisks the indexed document away, and then there is no document selected.

--In addition, focus has returned to the terminal emulator, from where we ran the script that does the indexing

So far so good.  At this point we would like to force the selection of the "next" document in the main window.

The problem is that we have not found a toolkit method, or even a windows method to to this.  Lots of methods are available for the selected document, where the user has made the selection. But, our issue is different - we want to make the selection programmatically.

The only solution we have at the moment is to select all of the children of the parent folder, and iterate through them one by one.  Is there a simpler approach available?

Thanks!

0 0

Answer

SELECTED ANSWER
replied on October 31, 2014

Also, CAT has both SetSelectedEntries and SetFocus methods which should do exactly what you need.

0 0

Replies

replied on October 31, 2014 Show version history

The LF Main window content pane is a standard SysListView32 object.  You should be able to use un-managed Win32API functions to set the focus on the LF Main window as well as select the next item by index.

 

EDIT:  One thing to keep in mind.  When using the Win32API on Vista or newer, you must "Run as Administrator" to interact with an external application.

1 0
replied on October 31, 2014

I think you can do this with window messages (http://msdn.microsoft.com/en-us/library/windows/desktop/bb761196(v=vs.85).aspx) once you have the window handle for the list control.

0 0
replied on October 31, 2014

Thanks, Bert, Robert

 

Bryce also mentioned this method, describefd as:

 

public void SetSelectedEntries(
	IEnumerable<int> listEntryIDs
)

Parameters

listEntryIDs
Type: OnlineSystem.Collections.Generic. IEnumerable< OnlineInt32>
The list of entry IDs specifying which entries to select.
 
Seems worth an experiment. 
0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.