Deprecated: Function create_function() is deprecated in /homepages/21/d38531796/htdocs/jose/smfforum/Sources/Load.php on line 178

Deprecated: Function create_function() is deprecated in /homepages/21/d38531796/htdocs/jose/smfforum/Sources/Load.php on line 183

Deprecated: Function create_function() is deprecated in /homepages/21/d38531796/htdocs/jose/smfforum/Sources/Load.php on line 184

Deprecated: Function create_function() is deprecated in /homepages/21/d38531796/htdocs/jose/smfforum/Sources/Load.php on line 220

Deprecated: Function create_function() is deprecated in /homepages/21/d38531796/htdocs/jose/smfforum/Sources/Load.php on line 223

Deprecated: Function create_function() is deprecated in /homepages/21/d38531796/htdocs/jose/smfforum/Sources/Load.php on line 235

Deprecated: Function create_function() is deprecated in /homepages/21/d38531796/htdocs/jose/smfforum/Sources/Load.php on line 250

Deprecated: Function create_function() is deprecated in /homepages/21/d38531796/htdocs/jose/smfforum/Sources/Load.php on line 268
CWindow and PROPERTY SET ClassName (BYVAL strClassName AS STRING)

Author Topic: CWindow and PROPERTY SET ClassName (BYVAL strClassName AS STRING)  (Read 301 times)

0 Members and 1 Guest are viewing this topic.

Offline Mikael Tobiasson

  • Newbie
  • *
  • Posts: 2
When I set my own classname, ":0" is added to the end of the  classname.

e.g. pWindow.ClassName = "myWinclass"
The classname becomes "myWinclass:0"

I'm curious why.
/Mikael


Offline Josť Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2514
    • Josť Roca Software
Re: CWindow and PROPERTY SET ClassName (BYVAL strClassName AS STRING)
« Reply #1 on: February 13, 2019, 05:28:07 PM »
Because there is other code, such the one that deals with tab pages, that create new instances of CWindow on the fly and will fail to register the class if the name of the class if already registered.

Offline Mikael Tobiasson

  • Newbie
  • *
  • Posts: 2
Re: CWindow and PROPERTY SET ClassName (BYVAL strClassName AS STRING)
« Reply #2 on: February 13, 2019, 08:07:06 PM »
Hi Jose, I became curious when I noticed the below code in your include file.

IF LEN(strClassName) THEN szClassName = strClassName ELSE szClassName = "PBWindowClass"
    szClassName = szClassName & ":" & FORMAT$(nCount)

I sometimes use FindWindow with classnames, I just have to remember to add the ":0" when using CWindow.

Thank you /Mikael