In Delphi, is it possible to detect when the user clicks on Windows' Start button (the button on the bottom left that brings up the menu)?
I try to create my own Start menu, so when the Start button is clicked, it will show my menu rather then Windows' menu.
My concept is my app will run automatically in the systray when Windows starts, and detect when the user clicks on the Start button then shown my menu.
I see a similar question, but in C#: How to detect when the Windows start menu / start screen opens? , but how to do that in Delphi?
found solution use mousehook.. 1st get the start button size and position
_handle := FindWindow('Shell_TrayWnd', nil);
_Start.Handle := FindWindowEx(_handle, 0, 'Start', nil);
GetWindowRect(_Start.Handle, _Start.Rect);
then use mousehook to check mouse pointer clicked on start button or not:
if (ms.X >= Start.Rect.Left)
and (ms.X <= Start.Rect.Right)
and (ms.Y >= Start.Rect.Top)
and (ms.Y <= Start.Rect.Bottom) then dowhatiwant ......
no matter where is TASKBAR POSITION in left bottom right or top it will always found the start button position..
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.