Want to unable menu of toolbar (file...)

Hi, I’d like to unable the toolbar. Then the user can’t open a new menu, command, edit… Thanks for help Thierry

Hi We wanted to do the same thing, but found workarounds instead… Why do you want to disable the menu ? perhaps another solution is possible ?

I want to force the user to go through a modal windows ! If toolbar is enable he can open a new menu. What ever in each case he can hit CTRL+O or ALT+F4… I wonder if it’s possible now. Thanks a lot for the answer.

Yes, you can set a form modal: 1. Create this method void setFormModal(int _thisHWND, boolean _bModal) { DLL _winApiDLL; DLLFunction _EnabledWindow; DLLFunction _getTop; DLLFunction _getNext; DLLFunction _getParent; DLLFunction _getMenu; DLLFunction _getMenuItemCount; DLLFunction _enableMenuItem; DLLFunction _drawMenu; void local_enableWHND(int _lHWND) { int lnextWnd; int menu; int cnt; int i; ; menu = _getMenu.call(_getParent.call(_lHWND)); cnt = _getMenuItemCount.call(menu); if(cnt>1 && strFind(WinApi::getWindowText(_getParent.call(_lHWND)),"Navision Axapta",1,999)) { for(i=0;i<cnt;i++) { if(_bModal) _enableMenuItem.call(menu,i,0x00000400 | 0x00000002 | 0x00000001); else _enableMenuItem.call(menu,i,0x00000400); } _drawMenu.call(_getParent.call(_lHWND)); } lnextWnd = _getTop.call(_getParent.call(_lHWND)); while (lnextWnd) { if (lnextWnd != _lHWND) { _enabledWindow.call(lnextWnd, (!_bModal)); } lnextWnd = _getNext.call(lnextWnd, 2); } } ; _winApiDLL = new DLL('user32'); _getNext = new DLLFunction(_winApiDLL, "GetWindow"); _EnabledWindow = new DLLFunction(_winApiDLL, "EnableWindow"); _getTop = new DLLFunction(_winApiDLL, "GetTopWindow"); _getParent = new DLLFunction(_winApiDLL, "GetParent"); _getMenu = new DLLFunction(_winApiDLL, "GetMenu"); _getMenuItemCount = new DLLFunction(_winApiDLL, "GetMenuItemCount"); _enableMenuItem = new DLLFunction(_winApiDLL, "EnableMenuItem"); _drawMenu = new DLLFunction(_winApiDLL, "DrawMenuBar"); _getParent.returns(ExtTypes:: DWORD); _getParent.arg(ExtTypes:: DWORD); _EnabledWindow.returns(ExtTypes:: DWORD); _EnabledWindow.arg(ExtTypes:: DWORD, ExtTypes:: DWORD); _getTop.returns(ExtTypes:: DWORD); _getTop.arg(ExtTypes:: DWORD); _getNext.returns(ExtTypes:: DWORD); _getNext.arg(ExtTypes:: DWORD, ExtTypes:: DWORD); _getMenu.returns(ExtTypes:: DWORD); _getMenu.arg(ExtTypes:: DWORD); _getMenuItemCount.returns(ExtTypes:: DWORD); _getMenuItemCount.arg(ExtTypes:: DWORD); _enableMenuItem.returns(ExtTypes:: DWORD); _enableMenuItem.arg(ExtTypes:: DWORD,ExtTypes:: DWORD,ExtTypes:: DWORD); _drawMenu.returns(ExtTypes:: DWORD); _drawMenu.arg(ExtTypes:: DWORD); local_enableWHND(_thisHWND); local_enableWHND(_getParent.call(_thisHWND)); } 2. in “init” on that form add: this.setFormModal(this.hWnd(), true);

Thanks to you Søren. It works exactly like I need. Best regards.