Пример #1
0
BOOL CALLBACK ParentWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
  BOOL bRes;
  if (message == WM_NOTIFY_OUTER_NEXT && wParam == 1)
  {
    // Don't call leave function if fields aren't valid
    if (!g_NotifyField && !ValidateFields())
      return 0;
    // Get the settings ready for the leave function verification
    SaveSettings();
    // Reset the record of activated control
    g_NotifyField = 0;
  }
  bRes = CallWindowProc((long (__stdcall *)(struct HWND__ *,unsigned int,unsigned int,long))lpWndProcOld,hwnd,message,wParam,lParam);
  if (message == WM_NOTIFY_OUTER_NEXT && !bRes)
  {
    // if leave function didn't abort (bRes != 0 in that case)
    if (wParam == -1)
      g_is_back++;
    if (wParam == NOTIFY_BYE_BYE)
      g_is_cancel++;
    g_done++;
    PostMessage(hConfigWindow,WM_CLOSE,0,0);
  }
  return bRes;
}
bool CGUIDialogFirstTimeUseConfNetwork::OnMessage(CGUIMessage& message)
{
  switch (message.GetMessage())
  {
  case GUI_MSG_CLICKED:
  {
    int senderId = message.GetSenderId();

    CLog::Log(LOGDEBUG,"CGUIDialogFirstTimeUseConfNetwork::OnMessage - GUI_MSG_CLICKED - [buttonId=%d] (initbox)",senderId);

    switch (senderId)
    {
    case BUTTON_NEXT:
    {
      if (!ValidateFields())
      {
        CGUIDialogOK2::ShowAndGetInput(257,54653);
        return true;
      }
    }
    break;
    }
  }
  }

  return CGUIDialogFirstTimeUseBase::OnMessage(message);
}