Obtaining the Windows handle of a component

Author: mrpetzl@hotmail.com (M Wilson)

Does anyone have a reliable way of obtaining the Windows handle of a Uniface component via code from within a Uniface application? It would be nice if this was available as a parameter via the component properties, or similar, but it isn't - I understand it would only be available via a 3GL call. Any ideas appreciated.

3 Comments

  1. Perhaps a pretty simple 3GL code is all you need. But if you google there are plenty of examples how to get a windows handle with c/c++. One of the problems may be how to give the handle back to uniface. Another Option is to inspect the User32.dll (examples how to create a signature exist for "GetUserName") I found: GetActiveWindow function: Retrieves the window handle to the active window attached to the calling thread's message queue. GetForegroundWindow function Retrieves a handle to the foreground window (the window with which the user is currently working). The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads. Or to go the long and hard way: add an entry to the wishlist and sit and wait


    Author: ulrich-merkel (ulrichmerkel@web.de)
  2. mark.wilson said Does anyone have a reliable way of obtaining the Windows handle of a Uniface component via code from within a Uniface application? It would be nice if this was available as a parameter via the component properties, or similar, but it isn't - I understand it would only be available via a 3GL call. Any ideas appreciated.

    Mark, what are you trying to achieve with the windows handle??


    Author: Adrian Gosbell (adrian.gosbell@synapse-i.jp)
  3. Just saw a couple of ways to get the window handle with the march-hare DLL: http://www.march-hare.com/library/default.asp And open 3GL Routines in Proc Code


    Author: ulrich-merkel (ulrichmerkel@web.de)