private const dm_pelswidth = &h80000
private const dm_pelsheight = &h100000
private const cds_fullscreen = &h4
private const cds_global = &h8
private const cds_noreset = &h10000000
private const cds_reset = &h40000000
private const cds_test = &h2
private const cds_updateregistry = &h1
private type devmode
dmdevicename as string * 32
dmspecversion as integer
dmdriverversion as integer
dmsize as integer
dmdriverextra as integer
dmfields as long
dmorientation as integer
dmpapersize as integer
dmpaperlength as integer
dmpaperwidth as integer
dmscale as integer
dmcopies as integer
dmdefaultsource as integer
dmprintquality as integer
dmcolor as integer
dmduplex as integer
dmyresolution as integer
dmttoption as integer
dmcollate as integer
dmformname as string * 32
dmunusedpadding as integer
dmbitsperpel as integer
dmpelswidth as long
dmpelsheight as long
dmdisplayflags as long
dmdisplayfrequency as long
dmpanningwidth as long 'win2000
dmpanningheight as long 'win2000
end type
private declare function changedisplaysetting*** lib "user32" alias "changedisplaysetting***a" (lpszdevicename as any, lpdevode as any, byval hwnd as long, byval dwflags as long, lparam as any) as long
dim oldx as long, oldy as long
private sub form_load()
dim dev as devmode
oldx = screen.width / screen.twipsperpixelx
oldy = screen.height / screen.twipsperpixely
dev.dmsize = len(dev)
dev.dmfields = dm_pelswidth or dm_pelsheight
dev.dmpelswidth = 800
dev.dmpelsheight = 600
changedisplaysetting*** byval 0&, dev, byval 0&, cds_updateregistr, byval 0&
end sub
private sub form_unload(cancel as integer)
dim dev as devmode
dev.dmsize = len(dev)
dev.dmpelswidth = oldx
dev.dmpelsheight = oldy
changedisplaysetting*** byval 0&, dev, byval 0&, cds_updateregistr, byval 0&
end sub