Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I want to hide Minimize/Maximize/Close("X") buttons of an Excel sheet(2007) which appears on title bar. To hide the buttons programmatically, i write following code: Please assume that my excel sheet is opened on desktop whose caption is: "EXCELSHEET_TEST" ------------------------------------------------------------------------------------------------------------ HWND hwndExcelHandler = FindWindow(NULL, "EXCELSHEET_TEST"); DWORD dwStyle = GetWindowLong(hwndExcelHandler, GWL_STYLE); ::SetWindowLong(hwndExcelHandler, GWL_STYLE, (dwStyle & ~WS_MAXIMIZEBOX)); dwStyle = GetWindowLong(hwndExcelHandler, GWL_STYLE); ::SetWindowLong(hwndExcelHandler, GWL_STYLE, (dwStyle & ~WS_MINIMIZEBOX)); HMENU hMenuOfXLS = ::GetSystemMenu(hwndExcelHandler, false); ::DeleteMenu(hMenuOfXLS, SC_CLOSE, MF_BYCOMMAND); //ok actually remove the close button ------------------------------------------------------------------------------------------------------------ This code successfully hides MINIMIZE and MAXIMIZE buttons, but it doesn't hide CLOSE("X") button appears on title bar. I tried testing it with Excel 2003 and it gives me expected results. It hides all of three buttons MINIMIZE/MAXIMIZE/CLOSE of Excel 2003 titlebar. Can anyone please suggest me why this code doesn't works for Excel 2007? Any suggestion on the same would be appreciated. Thank You, Jaydeep |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Close All in excel 2007 | Excel Discussion (Misc queries) | |||
Excel close button unabled | Excel Discussion (Misc queries) | |||
How can you close a window with the back button in excel | Excel Discussion (Misc queries) | |||
Excel shoud not close all active books when clicking close button | Excel Discussion (Misc queries) | |||
excel - Windows close button (x) should only close active workboo. | Setting up and Configuration of Excel |