Page 1 of 1

GetMainFormName(), GetMainFormHandle()

Posted: Sun Sep 11, 2016 9:03 pm
by KDJ
Functions GetMainFormName() and GetMainFormHandle() cause run-time error, if main window is not defined.
They could be a little modified, eg.:

Code: Select all

*-----------------------------------------------------------------------------*
Function GetMainFormName ()
*-----------------------------------------------------------------------------*
  IF _HMG_MainFormIndex > 0
    Return GetFormNameByIndex (_HMG_MainFormIndex)
  ENDIF
Return ''

*-----------------------------------------------------------------------------*
Function GetMainFormHandle ()
*-----------------------------------------------------------------------------*
  IF _HMG_MainFormIndex > 0
    Return GetFormHandleByIndex (_HMG_MainFormIndex)
  ENDIF
Return 0

Re: GetMainFormName(), GetMainFormHandle()

Posted: Mon Sep 12, 2016 3:56 am
by bpd2000
Excellent

Re: GetMainFormName(), GetMainFormHandle()

Posted: Mon Sep 12, 2016 4:43 am
by srvet_claudio
KDJ wrote:Functions GetMainFormName() and GetMainFormHandle() cause run-time error, if main window is not defined.
They could be a little modified, eg.:

Code: Select all

*-----------------------------------------------------------------------------*
Function GetMainFormName ()
*-----------------------------------------------------------------------------*
  IF _HMG_MainFormIndex > 0
    Return GetFormNameByIndex (_HMG_MainFormIndex)
  ENDIF
Return ''

*-----------------------------------------------------------------------------*
Function GetMainFormHandle ()
*-----------------------------------------------------------------------------*
  IF _HMG_MainFormIndex > 0
    Return GetFormHandleByIndex (_HMG_MainFormIndex)
  ENDIF
Return 0
Thanks !