none
Disable Close/Restore/Minimize Buttons in Word 2007/2010 RRS feed

  • Question

  • Dear all,

    I need a way to disable the word document control box (close, minimize and maximize).

    I have tried many solutions, but none was efficient:

    1) I have tried using the OpenXML custom UI as shown below.

    <Commands>

    <Command idMso="WindowClose" Enabled = "false" />

    <Command idMso="WindowRestore" Enabled = "false" />

    <Command idMso="WindowMinimize" Enabled = "false" />

    </Commands>

    2)I have tried using the SetWindowLong API, but after a long struggle, I was only able to hide the minimize button :

    SetWindowLong(hWnd, nIndex, dwNewLong)

    Where hwnd is the window handle of the word application.

    Nindex = -16

    dwNewLong  =  WS_CAPTION Or WS_THICKFRAME

    WS_CAPTION = 0x00C00000L

    WS_THICKFRAME = 0x00040000L

    Any help is appreciated.

    Regards.

    Tuesday, October 21, 2014 1:34 PM

All replies