PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Handling the current window
  • Using MyWindow in a procedure
  • WLanguage functions and current window
  • Summary
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
MyWindow is used to handle the current window. During the execution of the window, MyWindow is replaced by the window (and not by the name of the window). Therefore, MyWindow can be used like a window.
Benefit: MyWindow is used to make local code (control, button, ...) or global code (global procedure, class, ...) independent of the current window.
Versions 16 and later
Universal Windows 10 App This feature is available for the Windows Phone applications.
New in version 16
Universal Windows 10 App This feature is available for the Windows Phone applications.
Universal Windows 10 App This feature is available for the Windows Phone applications.
Versions 18 and later
Universal Windows 10 App This feature is available in Windows Store apps mode.
New in version 18
Universal Windows 10 App This feature is available in Windows Store apps mode.
Universal Windows 10 App This feature is available in Windows Store apps mode.
Example
// Retrieve the title of the current window
WindowTitle = MyWindow..Title
Syntax
MyWindow
Remarks

Handling the current window

  • MyWindow is always replaced by the current window. For example, using ..Title:
    MyWindow..Title = "Type your data"
    MyCurrentTitle = MyWindow..Title

    // Pass in parameter:
    CallProcedure(MyWindow)
  • If MyWindow must be converted into string, it is the result of ..Value that is returned. For a window, ..Value returns the title of the window.
    Trace(MyWindow) // Returns the title of the window

    Example not to do:
    ExecuteProcess(MyWindow, trtChange)

    To do:
    ExecuteProcess(MyWindow..Name, trtChange)
  • MyWindow can only be used in the processes that handle the current window (in the processes associated with a control, a window, ...). MyWindow cannot be used in a report. To specify the current report in a report, use the MyReport keyword
  • The MyWindow keyword does not allow you to use the global variables declared in the window.
  • To handle a window control by using the MyWindow keyword, you have the ability to use the following syntax:
    Info({MyWindow..Name + ".Button2"}..Caption)

Using MyWindow in a procedure

The MyWindow keyword can be used in a local procedure or in a global procedure only if the procedure handles the current window. In this case, MyWindow refers to the current window.
For a local procedure, MyWindow corresponds to the window to which the procedure belongs.

WLanguage functions and current window

To specify the current window in the WLanguage functions that accept a window name in parameter, use:
  • an empty string,
  • the MyWindow keyword directly.

Summary

Code where MyWindow is usedMyWindow corresponds to
windowwindow
window controlwindow
window procedure, with a direct call from a window codewindow
window procedure, with a call via <Window>.<Procedure>window
window supercontrolwindow
control of window supercontrolwindow
procedure of window supercontrol with a direct call from a code of the supercontrolwindow
procedure of window supercontrol with a call via <Supercontrol>.<Procedure>window
internal windowwindow
control of internal windowwindow
procedure of internal window with a direct call from a code of the internal windowwindow
procedure of internal window with a call via <InternalWindow>.<Procedure>window
supercontrol of internal windowwindow
control of supercontrol of internal windowwindow
procedure of supercontrol of internal window with a direct call from a code of the supercontrolwindow
procedure of supercontrol of internal window with a call via <Supercontrol>.<Procedure>window
MyWindow can only be used from a process or a procedure of the window.
Limitation: MyWindow cannot be used in a secondary thread. See Managing the opening of a window in a secondary thread for more details.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment