I forgot to include it originally.
This is straight from Screenshot Sender 5.
js code:
/*
Name: SetWndIcon
Purpose: Sets the window icon
Parameters: None
Return: None
*/
function SetWndIcon(hWnd) {
_debug.getfuncname(arguments);
_win32.SendMessageW(hWnd, 0x80 /* WM_SETICON */, 0 /* ICON_SMALL */, hScriptIcon);
_win32.SendMessageW(hWnd, 0x80 /* WM_SETICON */, 1 /* ICON_BIG */, hScriptIcon);
}