• λ我爱Aspx >> Asp.Net >> 在系统菜单中添加自定义菜单项
  • 在系统菜单中添加自定义菜单项

  • :未知  Դ:internet  :2007-5-20 16:44:31  ؼ:
  • 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 ...)

    Ҷƪл˵?
  • һƪ使用ASP.NET中调用WebService时不能以Name为数据库中的字段
    һƪ利用SOAP(Webservice)上传文件