GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Seventeen — Application Integration Functions (continued)
Overview
The GetActiveEditWindow function returns the window handle to the active edit widow (view).
Syntax/Parameters
Syntax
handle = GetActiveEditWindow ( );
Parameters
(none)
Return Value
Returns a handle to the window or NULL_HANDLE on failure. Use the GetLastError function to retrieve error information.
Remarks
The return value is a Windows handle, which is managed by the Edit Manager and the operating system. It is not a handle to a managed Legato object. Window handles are assigned by the operating system and uniquely identify a window. These handles can be used to access information and perform various functions within Legato. Messages can also be directly sent to windows but programmers are cautioned that this is an advanced operation that requires understanding of Windows messaging dynamics. It is also possible to adversely affect the application by performing certain windows commands without working through published script functions. Window handle values are persistent as long as the window is open. If the window is closed and reopened, the handle value will change. Since a window handle is managed by Windows, it does not need to be closed, and if the CloseHandle function is called, it will essentially do nothing.
Note that the active edit window may be a child of the view window. Therefore, a script may have to get the parent if the handle is not correct.
Example
The following code could be part of a hook being called where the hook determines the current window type:
hView = GetActiveEditWindow(); if (IsError(hView)) { MessageBox('x', "No active view for operation"); return ERROR_CONDITION; } w_type = GetEditWindowType(hView); if (IsError()) { hView = GetParentWindow(hView); w_type = GetEditWindowType(hView); } w_type &= EDX_TYPE_ID_MASK; if (w_type != EDX_TYPE_PSG_FORMS_VIEW) { MessageBox('x', "View is not correct type"); return ERROR_CONDITION; }
If a view is not active (no MDI windows open), no handle is returned.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.