|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转新大榭论坛!
您需要 登录 才可以下载或查看,没有账号?注册
x
- Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long* V1 C1 _( `( d1 h- Y, j2 o0 K# ~
- Private Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
1 K( e6 o: M8 V4 a - Private Declare Function SetFocus Lib "user32" (ByVal hWnd As Long) As Long5 F/ G( B( f/ g; x% h* i
- Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long* h) y3 l" ?* m5 ~# H
- Private Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long
! g7 X$ G8 h6 U* e - Private Const WM_SETICON = &H80& B4 q5 | T) }4 H
- Private Sub Workbook_Open()( b, E1 ]$ z% X; v& M0 }- G
- Dim IStyle As Long
0 u4 P4 p3 k$ v# \ - Dim hIcon As Long( {% e% Q# q" B7 }* ?# H; G9 S+ ?2 E
- Dim hWndForm As Long
9 S5 l. m1 D3 q# W; x& I9 T- x - hWndForm = FindWindow(vbNullString, Application.Caption), F$ A" }9 D c9 h( j' D0 d
- hIcon = ExtractIcon(0, ActiveWorkbook.Path & "\p.bmp", 0)
( Y% t8 M P1 h! U1 T1 Q3 ~ - SendMessage hWndForm, WM_SETICON, True, hIcon( x5 } e- s8 E; B
- SendMessage hWndForm, WM_SETICON, False, hIcon
4 R( a0 q4 {) |. s8 } - End Sub
复制代码
% A9 j. {; Q' ^8 p- ~, |8 u* V' k: F y6 \; k+ o! u
|
|