Declare INTEGER FindWindowEx IN user32.dll ; Long, Long, string, String Declare INTEGER EnableWindow IN user32.dll Long, Long =EnableStartMenuButton(0) =INKEY(10) =EnableStartMenuButton(1) PROCEDURE EnableStartMenuButton(liEnable) * Don't forget to re-enable it ! LOCAL lHwnd lHwnd = FindWindowEx(0, 0, "Shell_TrayWnd", .NULL.) lHwnd = FindWindowEx(lHwnd, 0, "Button", .NULL.) =EnableWindow(lHwnd, liEnable)But using EnableWindow() is safer.
DECLARE LONG FindWindow IN "user32" STRING lpClassName, STRING lpWindowName >DECLARE LONG SendMessage IN "user32" LONG hWnd, LONG wMsg, LONG wParam, LONG lParam >DECLARE LONG FindWindowEx IN "user32" LONG hWnd1, LONG hWnd2, STRING lpsz1, STRING lpsz2 >#DEFINE WM_CLOSE 0x10 >SendMessage(FindWindowEx(FindWindow("Shell_TrayWnd", ""), 0x0, "Button", .NULL.), WM_CLOSE, 0, 0)>
>>Declare INTEGER FindWindowEx IN user32.dll ; >> Long, Long, string, String >> >>Declare INTEGER EnableWindow Lib user32.dll Long, Long) >> >>=EnableStartMenuButton(0) >>=INKEY(10) >>=EnableStartMenuButton(1) >> >>PROCEDURE EnableStartMenuButton(liEnable) >>* Don't forget to re-enable it ! >>LOCAL lHwnd >>lHwnd = FindWindowEx(0&, 0&, "Shell_TrayWnd", .NULL.) >>lHwnd = FindWindowEx(lHwnd, 0&, "Button", .NULL.) >>=EnableWindow(lHwnd, liEnable) >>>>
>>>This small code sample shows how to disable >> the Start Menu button through code, simply paste >> it into a BAS module and use : >>> >>>' >>>' Paste this into a Code Mode (BAS) >>>' >>>option Explicit >>> >>> >>>