Set custom papersize in Window Xp

My program can run correctly in the Win 95/98 which can set the custom
papersize but it can not work on Window Xp.
Some how I found that I must use Win-Api to call on module as following :
Enumforms, Getform, Set form . However I don't know how to write.

Thanks
Ural