|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转新大榭论坛!
您需要 登录 才可以下载或查看,没有账号?注册
x
- Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long8 g, ?; p2 S; M
- Private Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
7 R# v; t; S" }: I$ P5 Z - Private Declare Function SetFocus Lib "user32" (ByVal hWnd As Long) As Long
/ W, v: J, g9 J; w2 C - 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
" W9 Z- F; D: G% V7 P1 ?! h$ ]9 c( z - Private Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long: Y5 Z v! |; i; I3 k. `7 V. T
- Private Const WM_SETICON = &H803 j1 \2 A E; k4 V" r% C) C
- Private Sub Workbook_Open()7 \" E$ H4 [* x) n7 |. D l
- Dim IStyle As Long) u7 `: Z+ {, H6 v' G" J
- Dim hIcon As Long9 y8 e, J: ?& K6 u
- Dim hWndForm As Long
& x4 |, O% c5 G - hWndForm = FindWindow(vbNullString, Application.Caption)! A v3 C# X/ ~- ^, d# P, Y
- hIcon = ExtractIcon(0, ActiveWorkbook.Path & "\p.bmp", 0)
6 q" ]2 ~$ D. N7 z - SendMessage hWndForm, WM_SETICON, True, hIcon3 a& h) }# u( ~. P) w8 ]
- SendMessage hWndForm, WM_SETICON, False, hIcon
6 T+ J1 V: ]& M/ f5 w - End Sub
复制代码
7 K4 I( W) w5 b, Y; T$ i% X
# f' v4 o6 J+ b& b7 \* A |
|