Femtet Macro Help/Manual
 

Home / CFemtet Class / CFemtet / Property / hWnd

hWnd Property

Syntax

hWnd As Long
Gets the value   Yes
Sets the value   No

Parameters

No parameters

Notes

Returns a window handle of Femtet associated with the macro.
The macro is associated automatically with the Femtet when a macro command (including this property) is executed, and the association is kept until the macro's process is terminated.
The macro is associated with only one Femtet in the same process. The return value of this property is the same value in all CFemtet instances in the same process.

When the macro's process is terminated, the association with the Femtet is removed and the Femtet can be associated with other macro.

If the Femtet restarts during the macro's process is running, the macro is automatically reassociated with the Femtet, and the value of this property is updated.

Returns 0 if Femtet is not activated which can be associated with the macro.

Example

Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

 

Private Const WM_SYSCOMMAND = &H112

Private Const SC_MAXIMIZE = &HF030&

Private Const SC_MINIMIZE = &HF020&

 

Private Sub Sample()

Dim fmtt As New CFemtet

 

fmtt.LoadProject "C:\Users\test\test.femprj", True

 

'Maximize Femtet. To minimize, specify SC_MINIMIZE.

PostMessage fmtt.hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0

End Sub