borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2009 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Read and Set Regional Settings)Next Topic (Anything wrong with my code?) New Topic New Poll Post Reply
AndreaVB Forum : API : Start MENU Hwnd Solved Topic
Poster Message
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 153

icon Start MENU Hwnd

Hi,
Now I'm looking for the Handle of the Start MENU. I mean the MENU which is showing the menu items: "Shut down, Run, Help... " etc... (Not the bar...)

Waiting for ur replies...

Regards


____________________________
lOsT...

16-03-2006 at 07:30 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Start MENU Hwnd

Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

hStartMenu = FindWindow("DV2ControlHost", vbNullString)


____________________________
If you find the answer helpful, please mark this topic as solved.

16-03-2006 at 09:01 PM
View Profile Send Email to User Show All Posts | Quote Reply
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 153
icon Re: Start MENU Hwnd

Hi,
Thanks for the quick response Goran!
But it doesnt seem to work wimme? Am i missing somethin? I've declared the function in  a module (publicly). i "debug.print" ed the variable hstartmenu..... but its showing 0 (zero)  

Any ideas why this might be happening?

Thanks

____________________________
lOsT...

16-03-2006 at 11:19 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Start MENU Hwnd

Hmmm... dont have Me with me, you could try with the "BaseBar" class, like in 98SE.... Could be that "DV2ControlHost" is only for XP, and in the rest of the WIn OS is "BaseBar"...

____________________________
If you find the answer helpful, please mark this topic as solved.

16-03-2006 at 11:50 PM
View Profile Send Email to User Show All Posts | Quote Reply
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 153
icon Re: Start MENU Hwnd

Hi there,

Thanx again Goran. I'm sorry i was a bit unclear with that ME thingy . I meant to say it isn't working WITH ME... (ME as in I, not Millenium edition )

I'm using Windows 2000... I'll try what u've sed... I have the code to get all the Classes which are currently loaded, and i remember that there is a BASEBAR class up there...

If the probelm is solved, i'll mark the post solved, otherwise i'll post again..
Thanx


Ok, I tried it... But I've got THREE basebar handles.... I don't know what to do!? Actually, i want to use the  "SetLayeredWindowAttributes" API to turn the menu into a translucent one... Is this even possible or not!?

Thanx

[Edited by misterxed on 17-03-2006 at 06:30 PM GMT]

____________________________
lOsT...

17-03-2006 at 12:29 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Start MENU Hwnd

Yes yuo can, but it will have affect only on the start menu, not the programs window. You will need to get the handle of that window too. As for the Win2k, dont have it with me also, but since you have an app that will return Classes, then it shouldnt be difficult. If that app also shows the visible state of windows, then just search fir the invisible ones, since it is in invisible state...

____________________________
If you find the answer helpful, please mark this topic as solved.

17-03-2006 at 09:29 PM
View Profile Send Email to User Show All Posts | Quote Reply
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 153
icon Re: Start MENU Hwnd

Hello,

  How do i search for invisible classes? I tried the GETCLASSINFO API's WNDCLASS.style thing, but that returns a number... I don't quite get what is the number for..

Hope u wouldn't mind if i ask u a sample code to get the Handle for the menu (and the Programs Submenu...)  

Anyways thanx for tellin me that it can be done  

____________________________
lOsT...

19-03-2006 at 08:24 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Start MENU Hwnd

You dont search for invisible classes, you search for invisible windows. Example:

1) use EnumWIndows API to get handles of all the windows.
2) you can also use GetWindowText to get the text of the window, in WinXP for start menu window it is "Start Menu" - this is how I found it
3) There is a IsWindowVisible API to tell you whether window is visible or not.

As for the programs menu, never tried it, and I am now not great with time, so I cant play with it at the moment. You should first investigate if AllPrograms is a 'window' or is a menu, so you can know what you are dealing with.

____________________________
If you find the answer helpful, please mark this topic as solved.

20-03-2006 at 01:51 AM
View Profile Send Email to User Show All Posts | Quote Reply
misterxed
Level: VB Lord


Registered: 12-06-2005
Posts: 153
icon Re: Start MENU Hwnd

Thanx for ur help...

Though i still couldn't get it, i really appreciate ur help...
I think its a menu, and its hwnd isn't displayed in  the EnumWindows API's list.... I've tried the GetWindowText api, and the BASEBAR class  (all 3 instances) return nothing... I also looked for all other class' WINDOWTEXT, but got no idea of the MENU's hwnd....

Anywayz, I'm upto something else now, so i don't need it any more...

____________________________
lOsT...

20-03-2006 at 09:19 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : API : Start MENU Hwnd Solved Topic
Previous Topic (Read and Set Regional Settings)Next Topic (Anything wrong with my code?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2009 Andrea Tincaniborder