现在遇到下面的问题
一:现在我要开两个程序,一个是汉化的程序,一个是目标程序.这两个怎么合在一起啊,就是源程序起动是就完成汉化.
二:只有打开过的菜单,才可以汉化.二级菜单没有打开过就不能汉化
procedure TNameMain.Button1Click(Sender: TObject);
var
Caption: array[0..255] of char;
start1,start2,start3,start4,start5:integer;
begin
//通过标题获得窗口句柄
wndhandle:=findwindow(nil,mystr);
//通过标题获得菜单句柄
mainmenu:=getmenu(wndhandle);
//取得顶行菜单数
mainnum:=getmenuitemcount(mainmenu);
//汉化菜单
for start1:=0 to mainnum do
begin
mm5:='';
//取得菜单项的标题
childmenu:=getsubmenu(mainmenu,start1); //子菜单句柄
Childnum:=getmenuitemcount(childmenu); //子菜单数量
for start2:=0 to childnum do
begin
getmenustring(childmenu,start2,@Caption,254,MF_BYPOSITION);
mm6:=string(Caption);
mm5:='asg';
start5:=getmenuitemid(childmenu,start2);
modifymenu(childmenu,start2,MF_BYPOSITION,start5,pchar(mm5));
end;
mm5:='';
getmenustring(mainmenu,start1,@Caption,254,MF_BYPOSITION);
mm6:=string(Caption);
mm5:='123456';
start3:=getmenuitemid(mainmenu,start1);
modifymenu(mainmenu,start1,MF_BYPOSITION,start3,pchar(mm5));
end;
代码如上
一:现在我要开两个程序,一个是汉化的程序,一个是目标程序.这两个怎么合在一起啊,就是源程序起动是就完成汉化.
二:只有打开过的菜单,才可以汉化.二级菜单没有打开过就不能汉化
procedure TNameMain.Button1Click(Sender: TObject);
var
Caption: array[0..255] of char;
start1,start2,start3,start4,start5:integer;
begin
//通过标题获得窗口句柄
wndhandle:=findwindow(nil,mystr);
//通过标题获得菜单句柄
mainmenu:=getmenu(wndhandle);
//取得顶行菜单数
mainnum:=getmenuitemcount(mainmenu);
//汉化菜单
for start1:=0 to mainnum do
begin
mm5:='';
//取得菜单项的标题
childmenu:=getsubmenu(mainmenu,start1); //子菜单句柄
Childnum:=getmenuitemcount(childmenu); //子菜单数量
for start2:=0 to childnum do
begin
getmenustring(childmenu,start2,@Caption,254,MF_BYPOSITION);
mm6:=string(Caption);
mm5:='asg';
start5:=getmenuitemid(childmenu,start2);
modifymenu(childmenu,start2,MF_BYPOSITION,start5,pchar(mm5));
end;
mm5:='';
getmenustring(mainmenu,start1,@Caption,254,MF_BYPOSITION);
mm6:=string(Caption);
mm5:='123456';
start3:=getmenuitemid(mainmenu,start1);
modifymenu(mainmenu,start1,MF_BYPOSITION,start3,pchar(mm5));
end;
代码如上
解决方案 »
- 难题(续):不用MDI方式,如何能让背景主窗体总是在本程序最底?(用SetWindowPos会变成所有程序最底)
- 灌水,诸位给我小外甥想个好名字,姓曾,名字里要带火和金。
- 谁知道如何通过客户端向服务端发送消息,现在老出错误!
- 局域网内侦测某台主机的外联(比如MODEM上网),有没可能实现?
- 域的问题。(急)
- 编译时老是出现错误:[fataL error] internal error:L470,不知是为什么?请指教!
- dbgrid的dgmultiselect设为ture就可以在表格选择多条记录,我现在要删除在表格中的选择记录,就是返回选择中的记录。
- 我在delphi5里没有找到fseek(),只有fileseek(),fileopen()...
- 我是一个新手 写了一段程序 但执行起来比较慢 不知各位高手有没有办法
- 怎样安装下载到的控件?
- 如何实现分页查看数据库记录呢
- 求助一个很小的程序
删除某一个菜单功能(父或子菜单),用哪个函数?