File: w_main.srw
Size: 5068
Date: Mon, 11 Feb 2019 14:59:18 +0100
$PBExportHeader$w_main.srw
forward
global type w_main from window
end type
type st_3 from statictext within w_main
end type
type st_2 from statictext within w_main
end type
type st_1 from statictext within w_main
end type
type lb_1 from listbox within w_main
end type
type cb_1 from commandbutton within w_main
end type
type cb_cancel from commandbutton within w_main
end type
type openfilename from structure within w_main
end type
type dummy from structure within w_main
end type
end forward

type openfilename from structure
   ulong    lStructSize
   long     hwndOwner
   long     hInstance
   long     lpstrFilter
   long     lpstrCustomFilter
   ulong    nMaxCustFilter
   ulong    nFilterIndex
   long     lpstrFile
   ulong    nMaxFile
   long     lpstrFileTitle
   ulong    nMaxFileTitle
   long     lpstrInitialDir
   long     lpstrTitle
   ulong    Flags
   integer     nFileOffset
   integer     nFileExtension
   long     lpstrDefExt
   long     lCustData
   long     lpfnHook
   long     lpTemplateName
   long     pvReserved
   ulong    dwReserved
   ulong    FlagsEx
end type

type dummy from structure
   long     a
   long     b
   longlong    c
   string      d[]
end type

global type w_main from window
integer width = 2720
integer height = 1140
boolean titlebar = true
string title = "SizeOf"
boolean controlmenu = true
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
st_3 st_3
st_2 st_2
st_1 st_1
lb_1 lb_1
cb_1 cb_1
cb_cancel cb_cancel
end type
global w_main w_main

type variables

end variables

on w_main.create
this.st_3=create st_3
this.st_2=create st_2
this.st_1=create st_1
this.lb_1=create lb_1
this.cb_1=create cb_1
this.cb_cancel=create cb_cancel
this.Control[]={this.st_3,&
this.st_2,&
this.st_1,&
this.lb_1,&
this.cb_1,&
this.cb_cancel}
end on

on w_main.destroy
destroy(this.st_3)
destroy(this.st_2)
destroy(this.st_1)
destroy(this.lb_1)
destroy(this.cb_1)
destroy(this.cb_cancel)
end on

type st_3 from statictext within w_main
integer x = 1426
integer y = 704
integer width = 1211
integer height = 164
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "An array that does not have a fixed number of occurrences is counted as zero."
boolean focusrectangle = false
end type

type st_2 from statictext within w_main
integer x = 1426
integer y = 384
integer width = 1211
integer height = 292
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "I found the code on the web posted around the PB9 timeframe. The poster said that it was written by Rui Cruz. I improved it adding new datatypes."
boolean focusrectangle = false
end type

type st_1 from statictext within w_main
integer x = 1426
integer y = 64
integer width = 1211
integer height = 292
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
long backcolor = 67108864
string text = "Many Windows API functions have a structure argument. Many of those have structure size for the first member. The non-visual object calculates the structure size."
boolean focusrectangle = false
end type

type lb_1 from listbox within w_main
integer x = 73
integer y = 256
integer width = 1285
integer height = 740
integer taborder = 20
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long textcolor = 33554432
boolean vscrollbar = true
boolean sorted = false
borderstyle borderstyle = stylelowered!
end type

type cb_1 from commandbutton within w_main
integer x = 73
integer y = 64
integer width = 590
integer height = 132
integer taborder = 10
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
string text = "SizeOf"
end type

event clicked;nvo_sizeof ln_size
DUMMY lstr_dummy
OPENFILENAME lstr_ofn
Integer li_size

SetPointer(HourGlass!)

lb_1.Reset()

li_size = ln_size.SizeOf(lstr_dummy)
lb_1.AddItem("DUMMY: " + String(li_size))

li_size = ln_size.SizeOf(lstr_ofn)
lb_1.AddItem("OPENFILENAME: " + String(li_size))

end event

type cb_cancel from commandbutton within w_main
integer x = 2304
integer y = 896
integer width = 334
integer height = 100
integer taborder = 10
integer textsize = -8
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
string text = "Cancel"
boolean cancel = true
end type

event clicked;Close(Parent)

end event