精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>编程开发>>● Delphi>>Windows API函数>>更改开始按钮的位图

主题:更改开始按钮的位图
发信人: daji(妲姬)
整理人: delfan(2001-04-25 21:22:26), 站内信件
var 
  Form1: TForm1; 
  StartButton: hWnd; 
  OldBitmap: THandle; 
  NewImage: TPicture; 

procedure TForm1.FormCreate(Sender: TObject); 
begin 
  NewImage := TPicture.create; 
  NewImage.LoadFromFile('C:WindowsCircles.BMP'); 
  StartButton := FindWindowEx(FindWindow('Shell_TrayWnd', nil),0,'Button', nil); 
  OldBitmap := SendMessage(StartButton, BM_SetImage, 0, NewImage.Bitmap.Handle); 
end; 

procedure TForm1.FormDestroy(Sender: TObject); 
begin 
  SendMessage(StartButton,BM_SetImage,0,OldBitmap); 
  NewImage.Free; 
end; 



----
                ^^                                    `_ ,
 ^^           |    |    |      Hello,                -(_)-
      ^^     )_)  )_)  )_)         My Friends!        ,  `
姬海涵      )___))___))___)\                  ,
           )____)____)_____)\\              __)\_
妲姬网苑 _____|____|____|____\\\__    (\_.-'    a`-.
---------\                   /--------(/~~````(/~^^`--------
  ^^^^^ ^^^^^^^^^^^^^^^^^^^^^
    ^^^^      ^^^^     ^^^    ^^      [email protected]
         ^^^^      ^^^

[关闭][返回]