ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

INT_PTR CALLBACK DeleteDialogProc ( HWND  hDlg,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 60 of file delete.c.

Referenced by MainWndCommand().

{
    PMAIN_WND_INFO Info = NULL;
    HICON hIcon = NULL;

    /* Get the window context */
    Info = (PMAIN_WND_INFO)GetWindowLongPtr(hDlg,
                                            GWLP_USERDATA);
    if (Info == NULL && message != WM_INITDIALOG)
    {
        return FALSE;
    }

    switch (message)
    {
        case WM_INITDIALOG:
        {
            LPTSTR lpDescription;

            Info = (PMAIN_WND_INFO)lParam;
            if (Info != NULL)
            {
                SetWindowLongPtr(hDlg,
                                 GWLP_USERDATA,
                                 (LONG_PTR)Info);

                hIcon = (HICON)LoadImage(hInstance,
                                         MAKEINTRESOURCE(IDI_SM_ICON),
                                         IMAGE_ICON,
                                         16,
                                         16,
                                         0);
                if (hIcon)
                {
                    SendMessage(hDlg,
                                WM_SETICON,
                                ICON_SMALL,
                                (LPARAM)hIcon);
                    DestroyIcon(hIcon);
                }

                SendDlgItemMessage(hDlg,
                                   IDC_DEL_NAME,
                                   WM_SETTEXT,
                                   0,
                                   (LPARAM)Info->pCurrentService->lpDisplayName);

                lpDescription = GetServiceDescription(Info->pCurrentService->lpServiceName);
                if (lpDescription)
                {
                    SendDlgItemMessage(hDlg,
                                       IDC_DEL_DESC,
                                       WM_SETTEXT,
                                       0,
                                       (LPARAM)lpDescription);
                    HeapFree(ProcessHeap,
                             0,
                             lpDescription);
                }

                return TRUE;
            }

            return FALSE;
        }

        case WM_COMMAND:
        {
            switch (LOWORD(wParam))
            {
                case IDOK:
                {
                    if (DoDeleteService(Info, hDlg))
                    {
                        (void)ListView_DeleteItem(Info->hListView,
                                                  Info->SelectedItem);
                        UpdateServiceCount(Info);
                    }
                    EndDialog(hDlg,
                              LOWORD(wParam));
                    return TRUE;
                }

                case IDCANCEL:
                {
                    EndDialog(hDlg,
                              LOWORD(wParam));
                    return TRUE;
                }
            }
        }
    }

    return FALSE;
}

Generated on Sat May 26 2012 04:40:10 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.