Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Windows Event functions
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Returns the system "Handle" (HWND) of a WINDEV control or window. This allows you to call some API functions with this parameters (with API or CallDLL32, SendMessage or PostMessage).
This "Handle" is rarely used with WLanguage functions.
// Copy the content of an edit control to the clipboard
SendMessage(Handle(EDT_EDIT1), WM_COPY, 0, 0)
WINDEVUser code (UMC)
// Immediately refresh the drawing of CONTROL1
hwnd is int = Handle(CONTROL1)
CallDLL32("USER32", "UpdateWindow", hwnd)

Retrieving the handle of a control or window Hide the details

<Result> = Handle([<Object name>])
<Result>: Pointer
Requested handle.
<Object name>: Optional character string
Control or window name. If this parameter is not specified, Handle uses the current window. If this parameter corresponds to a table column, the handle of its edit control will be returned (NULL if the column is not in edit).

Retrieving the handle of a specific element in a control Hide the details

<Result> = Handle([<Object name>, ] <Object type>)
<Result>: Integer
Requested handle.
<Object name>: Optional character string
Control name.
<Object type>: Integer constant
Element of the Combo Box whose handle is requested.
HandleAutocompleteListReturns the handle of the drop-down list associated with a control that has the autocomplete feature.
HandleComboBoxEditReturns the handle of the edit control associated with a Combo Box (the control must be a Combo Box control).
HandleComboBoxListReturns the handle of the drop-down list associated with a Combo Box (the control must be a Combo Box control).
HandleHScrollbarReturns the handle of the horizontal scrollbar of the control.
HandleVScrollbarReturns the handle of the vertical scrollbar of the control.
Related Examples:
The alarms Unit examples (WINDEV): The alarms
[ + ] Implementing an alarm to display an alert message in the title bar of the active window (regardless of the application).
The following topics are presented:
1/ The system functions (retrieving the handle of a window)
2/ Triggering a process according to a given frequency (timers)
Business / UI classification: UI Code
Component: wd290obj.dll
Minimum version required
  • Version 9
This page is also available for…
PROCEDURE Api_OnTop(mywin, on_off)

FunctionReturn is boolean = False
hWnd is system int = Handle({mywin}) //ID UNICO DO FORM
hWndInsertAfter is system int = {mywin}
X is int = {mywin}..X
Y is int = {mywin}..Y
cx is int = {mywin}..Width
cy is int = {mywin}..Height
uFlags is int = 0

IF hWnd > 0 THEN

IF on_off = True THEN
hWndInsertAfter = -1
uFlags = 2
hWndInsertAfter = -2
uFlags = 0


IF error() > 0


Info("Handle nao informado, por favor passe o nome da janela no paramentro inicial!")


RESULT FunctionReturn
21 Apr. 2023
Example uso;api-top-windows-janela-primeiro-plano-sempre
21 Apr. 2023

Last update: 06/23/2023

Send a report | Local help