VB.NET

Moderators: seancampbell
Number of threads: 4020
Number of posts: 10026

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Detect clicks on Start Button of XP Posted by fogelsoft on 17 Jun 2007 at 11:49 AM
Hello here,

i wonder if there's somebody who can help me out. By clicking on XP's Start button i'd like to open up my own menuform (called menu_frm). I know how to find the start button's hwnd just need to act on the leftbutton click and disable opening up the default menu... any help on this?

Thnx
Report
Re: Detect clicks on Start Button of XP Posted by BitByBit_Thor on 19 Jun 2007 at 8:36 AM
: Hello here,
:
: i wonder if there's somebody who can help me out. By clicking on
: XP's Start button i'd like to open up my own menuform (called
: menu_frm). I know how to find the start button's hwnd just need to
: act on the leftbutton click and disable opening up the default
: menu... any help on this?
:
: Thnx
:

I *think* this would involve setting up your own messageloop. You have the window handle of the button, so you can use SetWindowLong API to set it's Window Procedure address to your custom Window Procedure. In it, you check if the message is a click. If it is, handle it the way you want.
If it's not, pass along the message to the original Window Procedure for the Start Button.
Atleast, that's the theory ;) I don't think SetWindowLong is a function of the .NET framework, so you're probably going to have to use API's. It requires some trial and error to get it programmed, but it should be do-able. Also, I expect you might want to handle more event than just the click for 'beauty' reasons - but you'll see after you've implemented the click override whether this is neccesary or not.
Have fun and if you need any further help (like with steeling the Window Procedure) let us know.

Best Regards,
Richard

The way I see it... Well, it's all pretty blurry



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.