![]() |
![]() |
|
![]() |
Manipulating Paradox® Desktop Windows © 2001 Vladimir Menkin Introduction Sometimes it may be necessary to determine what windows are opened on the Paradox desktop and to perform some manipulations with them. The following descriptions may help to do this. Below I will use the word "window" instead of "Paradox desktop window" to make the text more short. Finding out what windows are on the Paradox desktop Execute enumDesktopWindowNames(":PRIV:dwin.db"). Now we have a table with a list of all opened windows. [Note: forms opened as dialogs, are not desktop windows and can be enumerated using enumWindowNames.] The resulting table - dwin.db - is sorted according to windows Z-order, the topmost window corresponds to the last record of dwin.db. Dwin.db has several fields which have the following meaning:
Manipulating windows Now we know window titles and handles, and their Z-order. We can use a form type variable to attach to form, report and library windows (using their titles) and then manipulate them using standard form type methods. [Note: if there are several windows with the same title formVar.attach(WindowTitle) attaches formVar to the topmost window according to Z-order.] But we can perform some manipulations with any window using WinSendMessage() and WinPostMessage() methods. The following examples show such approach: WinSendMessage(WindowHandle, winGetMessageId("WM_CHILDACTIVATE"), 0, 0)...makes the corresponding window active. WinSendMessage(AppHandle, winGetMessageId("WM_COMMAND"), SomeParadoxMenuConstant, 0)...performs the corresponding menu action on the currently active window, see above for how to make a window active. AppHandle - the application handle - can be obtained using the following code: Var AppHandle longint AppVar application Endvar AppHandle=AppVar.windowhandle() And finally: WinSendMessage(WindowHandle, winGetMessageId("WM_CLOSE"),0,0)...closes the corresponding window. Of course, there are many more window messages available, this topic covers only general principles. Hope it helps to work with desktop windows. Summary The basics covered above will help you to use these principles for controlling both windows open on the Paradox desktop and, by extension, other application windows open in Windows®. Check out TechTricks.com for a similar article "Controlling Paradox with Messages" - in the Paradox section, under the "ObjectPAL: Applications and Windows Integration" category. Discussion of this article |
![]() Feedback | Paradox Day | Who Uses Paradox | I Use Paradox | Downloads ![]() |
|
![]() The information provided on this Web site is not in any way sponsored or endorsed by Corel Corporation. Paradox is a registered trademark of Corel Corporation. ![]() |
|
![]() Modified: 15 May 2003 Terms of Use / Legal Disclaimer ![]() |
![]() Copyright © 2001- 2003 Paradox Community. All rights reserved. Company and product names are trademarks or registered trademarks of their respective companies. Authors hold the copyrights to their own works. Please contact the author of any article for details. ![]() |
![]() |
|