Click here to Skip to main content
15,884,298 members
Articles / Desktop Programming / MFC
Article

Get the Start Button Handle

Rate me:
Please Sign up or sign in to vote.
4.33/5 (2 votes)
23 Mar 2002 93.2K   774   28   11
Get the Start button handle and manage it.

The code

First you must get the handle of the Windows Taskbar, then you can capture the Start button that is a child of the taskbar window. You can change the style of it or send message you wish! You can use EnableWindow() function for disabling or enabling the start button, or GetDC() and other Device Context Functions to draw on the button, plus many more things.

The code CWnd* m_Window = CWnd::FindWindow("Shell_TrayWnd","") gets the taskbar window handle and GetTopWindow() returns start button as CWnd pointer.

C++
CWnd* m_Window = CWnd::FindWindow("Shell_TrayWnd","");
m_Window->GetTopWindow()->SendMessage(WM_LBUTTONDOWN,MK_LBUTTON);

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Iran (Islamic Republic of) Iran (Islamic Republic of)
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Questionimprovements Pin
lukas00728-Jun-07 5:27
lukas00728-Jun-07 5:27 
GeneralHe's one cool dude !! Pin
WREY25-Mar-02 3:48
WREY25-Mar-02 3:48 
GeneralDirect Current functions Pin
Ravi Bhavnani24-Mar-02 9:22
professionalRavi Bhavnani24-Mar-02 9:22 
GeneralRe: Direct Current functions Pin
Nish Nishant24-Mar-02 12:40
sitebuilderNish Nishant24-Mar-02 12:40 
GeneralRe: Direct Current functions Pin
Philippe Lhoste26-Mar-02 2:38
Philippe Lhoste26-Mar-02 2:38 
GeneralProblems Has Solved Pin
AFShin Dehghani23-Mar-02 10:14
AFShin Dehghani23-Mar-02 10:14 
GeneralRe: Problems Has Solved Pin
Nish Nishant23-Mar-02 18:08
sitebuilderNish Nishant23-Mar-02 18:08 
Good Lad!

Nish Smile | :)

Oh, I don't know why she's
leaving, or where she's gonna go
I guess she's got her reasons but I just don't wanna know
'Cos for 24 years I've been living next door to Alice
24 years just waitin' for a chance
To tell her how I feel and maybe get a second glance
Now I gotta get used to not living next door to Alice


Questiondownload link: Invalid Archive? Pin
Paul M Watt23-Mar-02 6:57
mentorPaul M Watt23-Mar-02 6:57 
AnswerRe: download link: Invalid Archive? Pin
Nish Nishant23-Mar-02 7:03
sitebuilderNish Nishant23-Mar-02 7:03 
GeneralRe: download link: Invalid Archive? Pin
Matt Newman23-Mar-02 9:33
Matt Newman23-Mar-02 9:33 
GeneralRe: download link: Invalid Archive? Pin
Nish Nishant23-Mar-02 17:14
sitebuilderNish Nishant23-Mar-02 17:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.