我爱Aspx >> Asp.Net >> 在系统菜单中添加自定义菜单项First, you need to include the System.Runtime.InteropServices namespace:
(第一步,你需要包含 System.Runtime.InteropServices 命名空间. )
Next, define the functions necessary to add items to the system menu:
(接下来,定义...添加项目到系统菜单中...所必需的函数....)
也就是:
[C# .NET]
[DllImport("user32.dll")]
private static extern int GetSystemMenu(int hwnd, int bRevert);
[DllImport("user32.dll")]
private static extern int AppendMenu(int hMenu, int Flagsw, int IDNewItem, string lpNewItem);
[Visual Basic .NET]
Private Declare Function GetSystemMenu Lib "user32.dll" (ByVal hwnd As Integer, _
ByVal bRevert As Integer) As Integer
Private Declare Function AppendMenu Lib "user32.dll" Alias "AppendMenuA" (ByVal hMenu As Integer, _
ByVal Flagsw As Integer, IDNewItem As Integer, ByVal lpNewItem As String) As Integer
(作者还说..他始终没有办法明白的是,为什么'别名' Alias "AppendMenuA" 在VB.NET中是必需的,如果你不包含它,.Net会抛出一个异常说,在调用AppendMenu的时候,在User32.dll中无法找到entry point ...)
Ҷƪл˵?
利用SOAP(Webservice)上传文件[05-20]
利用ASP.NET实现域名查询[05-20]
网页防刷新重复提交、防后退解决..[05-20]
IE经典故障大全[05-20]
用ASP的方法动态写出JavaScript的..[05-20]
JavaScript 更改网页中字体大小,..[05-20]
Javascript里的类构造[05-20]
用 JavaScript 操作字符串[05-20]
JavaScript中this关键字使用方法..[05-20]
[例程]使用VBScript 中的类组织开..[05-20]