Beispiel #1
0
static void winCanvasUnMapMethod(Ihandle* ih)
{
  if (iupAttribGetBoolean(ih, "MDICLIENT")) 
  {
    /* hide the MDI client window to avoid multiple re-paints */
    ShowWindow(ih->handle, SW_HIDE);

    /* must destroy all MDI Children */
    winCanvasMDICloseChildren(ih);

    DestroyWindow(ih->handle);

    /* mdiclient class is not a IUP class, must return here */
    return;
  }

  iupwinTipsDestroy(ih);
  iupwinDestroyDragDrop(ih);

  /* remove the association before destroying */
  iupwinHandleRemove(ih->handle);

  /* remove from parent and destroys window */
  SetParent(ih->handle, NULL);
  DestroyWindow(ih->handle);
}
Beispiel #2
0
static void winDialogUnMapMethod(Ihandle* ih)
{
    if (ih->data->menu)
    {
        ih->data->menu->handle = NULL; /* the dialog will destroy the native menu */
        IupDestroy(ih->data->menu);
    }

    if (iupAttribGet(ih, "_IUPDLG_HASTRAY"))
        winDialogSetTrayAttrib(ih, NULL);

    iupwinTipsDestroy(ih);
    iupwinDestroyDragDrop(ih);

    /* remove the association before destroying */
    iupwinHandleRemove(ih->handle);

    /* Destroys the window, so we can destroy the class */
    if (iupAttribGetBoolean(ih, "MDICHILD"))
    {
        /* for MDICHILDs must send WM_MDIDESTROY, instead of calling DestroyWindow */
        Ihandle* client = (Ihandle*)iupAttribGet(ih, "MDICLIENT_HANDLE");
        SendMessage(client->handle, WM_MDIDESTROY, (WPARAM)ih->handle, 0);

        winDialogMDIRefreshMenu(ih);
    }
    else
        DestroyWindow(ih->handle); /* this will destroy the Windows children also. */
    /* but IupDestroy already destroyed the IUP children */
    /* so it is safe to call DestroyWindow */
}
void iupdrvBaseUnMapMethod(Ihandle* ih)
{
  WNDPROC oldProc = (WNDPROC)IupGetCallback(ih, "_IUPWIN_OLDWNDPROC_CB");
  if (oldProc)
  {
    SetWindowLongPtr(ih->handle, GWLP_WNDPROC, (LONG_PTR)oldProc);
    IupSetCallback(ih, "_IUPWIN_OLDWNDPROC_CB",  NULL);
  }

  iupwinTipsDestroy(ih);
  iupwinDestroyDragDrop(ih);

  /* remove the association before destroying */
  iupwinHandleRemove(ih->handle);

  /* destroys window (it will remove from parent) */
  DestroyWindow(ih->handle);
}