PA_GetWindowFocused


version 2003


PA_GetWindowFocused → PA_WindowRef

Parameter Type Description
This command does not require any parameters
Function result PA_WindowRef Reference of the current window with focus

Description

The routine PA_GetWindowFocused returns a reference to the window that has the focus when the call is made.

Only focusable windows can receive the keyboard focus. A focusable window is a window that can receive keyboard events ("get the focus"), even if it is a floating window. When a focusable window receives a keyboard event, it becomes focused. For example, the tool palette of the Form Editor is not focusable. When the user clicks on it, it does not get the focus, which remains in the Editor. On the other hand, the properties palette is focusable. When the user clicks in an editable field (to set a variable name, an object name) of this palette, it takes the focus and the keyboard events.

Example

Force the focus to change.

   void ForceFocus(PA_WindowRef aWindow)
   {
      if(PA_FetWindowFocused() != aWindow)
      {
         PA_SetWindowFocusable(aWindow);
         PA_SetWindowFocused(aWindow);
      }
   }

See Also

PA_IsWindowFocusable , PA_IsWindowFocused , PA_SetWindowFocusable , PA_SetWindowFocusable .

Error Handling

PA_GetLastError

always returns eER_NoErr