AutoCAD.net(一):更改AutoCAD窗口的标题和图标

本文分享了作者使用.net+ObjectARX进行AutoCAD二次开发的经验,介绍了WinAPI在该过程中的应用,包括窗口消息发送及图标加载等操作。
    对AutoCAD二次开发方向的发展,是我为从事.net前就有的愿望,现在.net + ObjectARX 已经形成很完美的结合,遗憾的是目前国内关于.net对 ObjectARX 开发的资料太少。我会将自己的学习经验不断的与大家分享,希望关注。
WinAPI的引用:
public class WinAPI
{
    
#region  宏定义  
    public const int WM_SETICON = 0x80;
    
public const int IMAGW_ICON = 1;
    
public const int LR_LOADFROMFILE = 0x10;
    
#endregion
    
    
#region  WinAPI定义
    [DllImport(
"User32.dll", EntryPoint = "SendMessage")]
    
public static extern int SendMessage(
        
int hWnd, // handle to destination window 
        int Msg, // message 
        int wParam, // first message parameter 
        int lParam // second message parameter 
    );
    
    [DllImport(
"user32", EntryPoint = "LoadImage")]
    
public static extern int LoadImageA(int hInst, string lpsz, int un1, int n1, int n2, int un2);

    [DllImport(
"user32", EntryPoint = "SetWindowText")]
    
public static extern int SetWindowTextA(int hwnd, string lpString);
    
#endregion
}

文章来源于 http://www.cnblogs.com/wf225 版权归原作者所有
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值