Click to See Complete Forum and Search --> : Windows Menu, Please help
Danial
Sep 6th, 2000, 05:27 PM
Hi,
I was wondering if any one here know if it is possible to chnage the windows menu using API. I have a friend in Sweden who purchased a PC which comes with Swidish version of Win 2000, naturally all the menus are in Swedish. I was wondering if there is a way i can change the menus to English.
If its not possibe through VB is there any utility or program that i can use.
Thanks for your help
hitcgar
Sep 7th, 2000, 08:53 AM
Sounds dangerous to me!
To change an applications menus you have to either write
another app that hooks into the original app's menu system
and then you'd have to know exactly what menu items
to change. And still if the original app does any kind of
menu manipulation at run-time you'll end up messing the whole
thing up sooner or later unless you designed that app and you know exactly how it works.
However if the original was compiled and written to use menu and string
resources in a resource file you simply need a good
resource editor to open the .exe or a .dll that contains
those string resources and then change one by one manually.
Then you save your changes (to a copy) and that should work.
Still, if it's not your app, I would not recommend this kind of thing.
You're better off checking for another language version.;)
Danial
Sep 7th, 2000, 04:07 PM
Hi,
Thanks for your reply. After reading the reply from u guys i think i will tell my friend to buy a English version of the Windows.
Thanks again
hitcgar
Sep 7th, 2000, 04:12 PM
good idea :)
I would recommend you first return this version (to get your money back) then get the Engligh version.
Danial
Sep 7th, 2000, 04:38 PM
Hi Megatron,
He already tried that, the PC comes with Swidish version of Windows 2000 and the PC manufacture wouldnt give him a English version.
Danial
Sep 7th, 2000, 04:45 PM
Hi,
Talking of modifying menu is there any way i can create a full menu structure at run time. I know how to make menu at run time using the control array but this way it is not very flexible. I wanna create menu which can have more then two sub menus. The best example would be IE's Favorite menu. I want to create a similar Favorite menu for my Browser.
Any sample code will be great help.
Thanks again
Use AppendMenu.
Private Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As Any) As Long
Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Const MF_BYPOSITION = &H400&
Private Sub Command1_Click()
Dim hMenu As Integer
Dim hSubMenu As Integer
hMenu = GetMenu(hwnd)
hSubMenu = GetSubMenu(hMenu, 0)
AppendMenu hSubMenu, MF_BYPOSITION, 1, "New Item"
End Sub
Danial
Sep 7th, 2000, 05:28 PM
Hi Megatron,
Thanks for your code, but it gives me "Over Flow" error in the line.
hMenu = GetMenu(hwnd)
Any ideas why.
Thanks again
Sorry about that. Change the declarations to Long. It should work now.
Private Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As Any) As Long
Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Const MF_BYPOSITION = &H400&
Private Sub Command1_Click()
Dim hMenu As Long
Dim hSubMenu As Long
hMenu = GetMenu(hwnd)
hSubMenu = GetSubMenu(hMenu, 0)
AppendMenu hSubMenu, MF_BYPOSITION, 1, "New Item"
End Sub
[Edited by Megatron on 09-07-2000 at 07:41 PM]
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.