GetMainFormName(), GetMainFormHandle()

Moderator: Rathinagiri

Post Reply
KDJ
Posts: 243
Joined: Mon Sep 05, 2016 3:04 am
Location: Poland

GetMainFormName(), GetMainFormHandle()

Post 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
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: GetMainFormName(), GetMainFormHandle()

Post by bpd2000 »

Excellent
BPD
Convert Dream into Reality through HMG
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: GetMainFormName(), GetMainFormHandle()

Post 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 !
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
Post Reply