| Private Sub Command1_Click() Static total As Long,p(50) As Long,i As Integer dlgOpen.Filter = ″图标|*.Exe; *.Ico;*.Dll″ dlgOpen.ShowOpen If Dir(dlgOpen.filename)<>″″ Then If ExtractIcon(App.hInstance, dlgOpen.filename, -1) = 0 Then ′如果没有图标 MsgBox ″No Icon!″ Else total = ExtractIcon(App.hIns tance, dlgOpen.filename, -1) ′取得总图标数 For i = 0 To total - 1 p(i) = ExtractIcon(App.hIn stance, dlgOpen.filename, i) ′读取每个图标 Next i For i = 0 To total - 1 ′依次显示每个图标 DrawIcon Picture1.hdc, 34 * i, 0, p(i) Next i End If End If End Sub |
| deskhwnd = GetNextWindow(hwnd, GW_HWNDLAST) ′取最下面一个窗口 deskdc = GetWindowDC(deskhwnd) ′取窗口的情景设备 For i=0 To Screen.Width/32/15 ′将屏幕坐标单位换算成“Pixel”,并计算可画的图标数 For j=0 To Screen.Height/32/15 DrawIcon deskdc, 32*i, 32*j, p ′在桌面上画图 Next j Next i |
| Declare Function SystemParametersInfo Lib ″user32″ Alias “SystemParametersInfoA” (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long |