↓でも保存出来るみたいです。(Me,HSP3.0aで確認しました)
#include "shell32.as"
#uselib "ole32.dll"
#func IIDFromString "IIDFromString" wstr, var
#uselib "shlwapi.dll"
#func SHCreateStreamOnFile "SHCreateStreamOnFileA" sptr, int, int
#uselib "oleaut32.dll"
#func OleCreatePictureIndirect "OleCreatePictureIndirect" int, int, int, int
#define IID_IPicture "{7BF80980-BF32-101A-8BBB-00AA00300CAB}"
#usecom IPicture IID_IPicture
#comfunc IPicture_SaveAsFile 15 comobj, int, int
#enum PICTYPE_ICON = 3
#define STGM_READWRITE 2
#define STGM_CREATE 0x1000
dimtype pic, vartype("comobj"), 1
dimtype stream, vartype("comobj"), 1
dim pictdesc, 5
dialog "ico", 17
if stat == 0 : end
path = refstr
ext = getpath(path, 2)
if ext != ".ico" : path += ".ico"
// 電卓のアイコン取得
ExtractIconEx "calc.exe", 0, varptr(hIcon), 0, 1
if hIcon == 0 : end
// アイコンハンドルからピクチャオブジェクト作成
pictdesc(0) = 20 // 構造体のサイズ
pictdesc(1) = PICTYPE_ICON
pictdesc(2) = hIcon // 保存したいアイコンのハンドル
dim iid, 4
IIDFromString IID_IPicture, iid
OleCreatePictureIndirect varptr(pictdesc), varptr(iid), 1, varptr(pic)
if varuse(pic) == 0 : goto *lb_end
// ストリーム作成
SHCreateStreamOnFile path, STGM_READWRITE|STGM_CREATE, varptr(stream)
if varuse(stream) == 0 : goto *lb_end
// 保存
IPicture_SaveAsFile pic, stream, 1, varptr(size)
mes "保存しました"
*lb_end
if varuse(pic) : delcom pic
if varuse(stream) : delcom stream
stop