Exemple #1
0
static struct command_result *waitsendpay_done(struct command *cmd,
					       const char *buf,
					       const jsmntok_t *result,
					       struct pay_command *pc)
{
	struct pay_attempt *attempt = current_attempt(pc);

	attempt->result = json_strdup(pc->ps->attempts, buf, result);
	attempt->end = time_now();

	return forward_result(cmd, buf, result, pc);
}
LRESULT CALLBACK tab_group_subclass_proc(HWND     window,
        UINT     message,
        WPARAM   wParam,
        LPARAM   lParam,
        UINT_PTR ptr,
        DWORD_PTR /* ref */)
{
    tab_group_t& tab_group(*reinterpret_cast<tab_group_t*>(ptr));
    NMHDR*                         notice((NMHDR*) lParam);

    //
    // Here we report the selected tab changing to ui-core users.
    //

    if (message == WM_NOTIFY && notice && notice->hwndFrom == window)
    {
        if (notice->code == TCN_SELCHANGE)
        {
            long index(static_cast<long>(::SendMessage(tab_group.control_m, TCM_GETCURSEL, 0, 0)));

            if (!tab_group.value_proc_m.empty())
                tab_group.value_proc_m(tab_group.items_m[index].value_m);
        }

        return 0;
    }
    else
    {
        LRESULT forward_result(0);

        if (forward_message(message, wParam, lParam, forward_result))
            return forward_result;
    }

    return ::DefSubclassProc(window, message, wParam, lParam);
}