Exemple #1
0
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    LRESULT result;

    if (msg == _msgAttach)
        return HandleAPIAttach((HWND)wParam, lParam);

    if (msg == _msgDiscoverTest)
        return HandleAPIDiscoverTest((HWND)wParam);

    switch(msg)
    {
    case WM_CREATE:
        CreateControls(hwnd);
        break;

    case WM_DESTROY:
        PostQuitMessage(0);
        return FALSE;

    case WM_TIMER:
        break;

    case WM_COPYDATA:
        // reattach if fails
        result = HandleCopyData((HWND)wParam, (PCOPYDATASTRUCT)lParam);
        if (!result)
        {
            SkypeAttach(_hwnd);
            result = HandleCopyData((HWND)wParam, (PCOPYDATASTRUCT)lParam);
        }
        UpdateMessageCntText();
        return result;

    case API_ATTACH_AVAILABLE:
        SetConnStatusText("API_ATTACH_AVAILABLE");
        _hwndSkype = NULL;
        SkypeAttach(_hwnd);
        return TRUE;

    } // msg

    return DefWindowProcW(hwnd, msg, wParam, lParam);
}
// WindowProc -- Dispatches and routes window messages
LRESULT cef_main_window::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message) 
    {
    case WM_CREATE:
        if (HandleCreate())
            return 0L;
        break;
    case WM_ERASEBKGND:
        if (HandleEraseBackground())
            return 1L;
        break;
    case WM_SETFOCUS:
        if (HandleSetFocus((HWND)wParam))
            return 0L;
        break;
    case WM_PAINT:
        if (HandlePaint())
            return 0L;
        break;
    case WM_GETMINMAXINFO:
        if (HandleGetMinMaxInfo((LPMINMAXINFO) lParam))
            return 0L;
        break;
    case WM_DESTROY:
        if (HandleDestroy())
            return 0L;
        break;
    case WM_CLOSE:
        if (HandleClose())
            return 0L;
        break;
    case WM_SIZE:
        if (HandleSize(wParam == SIZE_MINIMIZED))
            return 0L;
        break;
    case WM_COMMAND:
        if (HandleCommand(LOWORD(wParam)))
            return 0L;
        break;
    case WM_COPYDATA:
        if (HandleCopyData((HWND)wParam, (PCOPYDATASTRUCT)lParam))
            return 0L;
        break;
    }

    LRESULT lr = cef_host_window::WindowProc(message, wParam, lParam);

    return lr;
}