Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to disable the "X" in a Word application

API Functions

How to disable the "X" in a Word application

by  Mike Gagnon  Posted    (Edited  )
Code:
LOCAL oWord
oword = CREATEOBJECT("word.application")
oword.visible = .t.
Declare Integer FindWindow In user32;
 STRING lpClassName, String lpWindowName
Declare Integer GetSystemMenu In user32 Integer HWnd, Integer bRevert
Declare Integer RemoveMenu In user32 Integer hMenu ,Integer nPosition,Integer wFlags
#Define  MF_BYPOSITION 1024
HWnd = FindWindow("OPUSApp", 0)
hMnu = GetSystemMenu(HWnd, 0)
For I = 6 To 0 Step -1
 Y = RemoveMenu(hMnu, I, MF_BYPOSITION)
Next I
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top