Converting a C# code into Clarion Code

Hi Guys,

Out of curiousity, I have found this video
->https://www.youtube.com/watch?v=N5oZnV3cA64

On the 5:43
part of the video, I tried searching how to convert the c# code of dragging the form with the use of region and found this thread here
->Move borderless form using mouse
That worked flawlessly with less line of codes.

Now, on the 6:42
part of the video, which is removing the title bar and keep snap window(which when you drag on every side of the window it will resize and stick like normal window),
I tried to add the following codes:

!before global data
SavedProc1     LONG
MyPreviewewrThread  LONG
WM_NCCALCSIZE  EQUATE(0083h)

!Inside the global map
SubClassProc(UNSIGNED, UNSIGNED, UNSIGNED,LONG),LONG,PASCAL
MODULE('Windows API')
  SendMessage(HWND,UNSIGNED,UNSIGNED,UNSIGNED),LONG,PASCAL,NAME('SendMessageA')
  ReleaseCapture(),BOOL,PASCAL
  CallWindowProc(LONG,UNSIGNED,SIGNED,UNSIGNED,LONG),LONG,PASCAL,NAME('CallWindowProcA')
END

!program procedures
SubClassProc PROCEDURE(UNSIGNED hwnd,UNSIGNED MSG1, UNSIGNED WPARAM,LONG LPARAM)
   CODE
   IF MSG1 = WM_NCCALCSIZE AND WPARAM = 1
      RETURN 0
   END
   RETURN CallWindowProc(SAVEDPROC1, HWND, MSG1, WPARAM, LPARAM)

And initiate the procedure on the open window procedure of my created window

SELF.Open(QuickWindow)
     SavedProc1 = 0{PROP:WNDProc}
     MyPreviewewrThread = THREAD()
     0{PROP:WNDProc} = ADDRESS(SubClassProc)

This works perfectly fine.

Now on the hardest part and my really question is on this
17:05
Which is resizing the window after applying removal of border using the code above. I am wondering if this c# code is still possible to work if converted properly to a clarion code. This bugs me for weeks though and Iā€™m hesitant to ask this here on the clarion community.
Here is the code of it


inside the Overriden Codes section.
I will also provide my sample app here for reference.
Sample App No Frame.zip (1.1 MB)

I have no idea when it comes to deep c# codes since clarion is my first programming language to learn.

Hoping for your kind response.

Thank you!