If a window is not defined, GetProperty("WindowName", "HANDLE") causes run-time error.
Maybe in this case the function should return 0?
Now in event handler I am using:
IF IsWindowDefined("WindowName") .and. (nHWnd == GetProperty("WindowName", "HANDLE"))
...
ENDIF
It could be shortened:
IF nHWnd == GetProperty("WindowName", "HANDLE")
...
ENDIF
GetProperty("Window", "HANDLE")
Moderator: Rathinagiri
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: GetProperty("Window", "HANDLE")
It is the responsibility of the programmer to check if the window/control is defined. All properties produces runtime error if a control or window is not defined.
The default return values when a programming error occurs at runtime generate black boxes in the code that are difficult to debug. A well written code can never produce an execution error, this last one more that a complication is a help and insurance for the programmer.
The default return values when a programming error occurs at runtime generate black boxes in the code that are difficult to debug. A well written code can never produce an execution error, this last one more that a complication is a help and insurance for the programmer.
Re: GetProperty("Window", "HANDLE")
Claudio, thank you very much for your explanation.