"GetClientRect" Of "User32"

In this category you can exchange your programming questions and solutions.
Post Reply
Darren
Posts: 63
Joined: Wed May 11, 2011 11:55 am

"GetClientRect" Of "User32"

Post: # 1156Post Darren
Mon Nov 18, 2013 8:30 am

I am trying to convert a VB6 file into FnxBasic, eventually allowing me to view PDF files in a forms "window".

I am having trouble with "GetClientRect" Of "User32"

Here is my code so far:

Declare FormRectangle As "GetClientRect" Of "User32" 
    hWnd As Long

    rc As Rectangle
End Declare

With FormRectangle
    hWnd = MainForm.hWnd

   ` rc
    
   ` Execute
End with

Does anybody know if I can actually use "GetClientRect" Of "User32" in FnxBasic, and if I can does anybody know the correct code to create a window on a form using it

Many thanks in advance!!!!

Regards

Darren

Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

"GetClientRect" Of "User32"

Post: # 1157Post Marco
Mon Nov 18, 2013 4:35 pm

Can you do something with this?

``getrect example

record RECT
  Left As Long
  Top As Long
  Right As Long
  Bottom As Long
End record

Declare FormRectangle As "GetClientRect" Of "User32"
  hWnd As Long
  rc As Rect
End Declare

object exampleform as form
  object b as button
    left=200
    caption="get values"
    onclick=getrect
  end object
  object output as richedit
    scrollbars=ssboth
  end object
  showmodal
end object

sub getrect
  dim x as string,y as string
  dim x1 as string,y1 as string
  formrectangle.hwnd=exampleform.hwnd
  formrectangle.execute
  x=str$(formrectangle.rc.left)
  y=str$(formrectangle.rc.top)
  x1=str$(formrectangle.rc.right)
  y1=str$(formrectangle.rc.bottom)

  output.addtext("==new values==")
  output.addtext("left :"+x)
  output.addtext("top :"+y)
  output.addtext("right :"+x1)
  output.addtext("bottom :"+y1)
end sub

Post Reply