pPlugin->makeNPNCall(action_npn_get_url_notify, DEFAULT_DWARG_VALUE, (DWORD)sz1, dwTarget, dwData); } else if(strcmp(szString, STRING_NPN_REQUESTREAD) == 0) { extern NPByteRange * convertStringToNPByteRangeList(LPSTR szString);  Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG2), sz1, sizeof(sz1)); Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), sz2, sizeof(sz2)); DWORD dwData = (DWORD)GetDlgItemInt(hWnd, IDC_EDIT_ARG4, &bTranslated, FALSE); DWORD dwTarget = 0L; NPByteRange *npByteRangeList = convertStringToNPByteRangeList(sz2); if (!npByteRangeList) { npByteRangeList = convertStringToNPByteRangeList(szDefaultNPByteRangeList); } pPlugin->m_firstAction = action_npn_request_read; dwData = (DWORD) npByteRangeList;
void onGo(HWND hWnd){  CPlugin * pPlugin = (CPlugin *)GetWindowLong(hWnd, DWL_USER);  assert(pPlugin != NULL);  char szString[80];  char sz1[128];  char sz2[128];  char sz3[128];  char sz4[128];  BOOL bTranslated = FALSE;  ComboBox_GetText(GetDlgItem(hWnd, IDC_COMBO_API_CALL), szString, sizeof(szString));  if(strcmp(szString, STRING_NPN_VERSION) == 0)  {    pPlugin->makeNPNCall(action_npn_version, DEFAULT_DWARG_VALUE, DEFAULT_DWARG_VALUE,                          DEFAULT_DWARG_VALUE, DEFAULT_DWARG_VALUE);  }  else if(strcmp(szString, STRING_NPN_GETURL) == 0)  {    Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG2), sz1, sizeof(sz1));    Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), sz2, sizeof(sz2));    DWORD dwTarget = 0L;    if(strcmp(sz2, "NULL") == 0)      dwTarget = 0L;    else      dwTarget = (DWORD)sz2;    pPlugin->makeNPNCall(action_npn_get_url, DEFAULT_DWARG_VALUE, (DWORD)sz1, dwTarget);  }  else if(strcmp(szString, STRING_NPN_GETURLNOTIFY) == 0)  {    Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG2), sz1, sizeof(sz1));    Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), sz2, sizeof(sz2));    DWORD dwData = (DWORD)GetDlgItemInt(hWnd, IDC_EDIT_ARG4, &bTranslated, FALSE);    DWORD dwTarget = 0L;    if(strcmp(sz2, "NULL") == 0)      dwTarget = 0L;    else      dwTarget = (DWORD)sz2;    pPlugin->makeNPNCall(action_npn_get_url_notify, DEFAULT_DWARG_VALUE, (DWORD)sz1, dwTarget, dwData);  }  else if(strcmp(szString, STRING_NPN_POSTURL) == 0)  {    Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG2), sz1, sizeof(sz1));    Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), sz2, sizeof(sz2));    DWORD dwLen = (DWORD)GetDlgItemInt(hWnd, IDC_EDIT_ARG4, &bTranslated, FALSE);    Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG5), sz3, sizeof(sz3));    int index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG6));    ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG6), index, sz4);    BOOL bFile = (strcmp(sz4, "TRUE") == 0) ? TRUE : FALSE;    DWORD dwTarget = 0L;    if(strcmp(sz2, "NULL") == 0)      dwTarget = 0L;    else      dwTarget = (DWORD)sz2;    pPlugin->makeNPNCall(action_npn_post_url, DEFAULT_DWARG_VALUE, (DWORD)sz1, dwTarget, dwLen, (DWORD)sz3, (DWORD)bFile);  }  else if(strcmp(szString, STRING_NPN_POSTURLNOTIFY) == 0)  {    Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG2), sz1, sizeof(sz1));    Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), sz2, sizeof(sz2));    DWORD dwLen = (DWORD)GetDlgItemInt(hWnd, IDC_EDIT_ARG4, &bTranslated, FALSE);    Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG5), sz3, sizeof(sz3));    int index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG6));    ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG6), index, sz4);    BOOL bFile = (strcmp(sz4, "TRUE") == 0) ? TRUE : FALSE;    DWORD dwData = (DWORD)GetDlgItemInt(hWnd, IDC_EDIT_ARG7, &bTranslated, FALSE);    DWORD dwTarget = 0L;    if(strcmp(sz2, "NULL") == 0)      dwTarget = 0L;    else      dwTarget = (DWORD)sz2;    pPlugin->makeNPNCall(action_npn_post_url_notify, DEFAULT_DWARG_VALUE, (DWORD)sz1, dwTarget, dwLen, (DWORD)sz3,                          (DWORD)bFile, dwData);  }  else if(strcmp(szString, STRING_NPN_NEWSTREAM) == 0)  {    Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG2), sz1, sizeof(sz1));    Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), sz2, sizeof(sz2));    pPlugin->makeNPNCall(action_npn_new_stream, DEFAULT_DWARG_VALUE, (DWORD)sz1, (DWORD)sz2, DEFAULT_DWARG_VALUE);  }  else if(strcmp(szString, STRING_NPN_DESTROYSTREAM) == 0)  {    int index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG3));    ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG3), index, sz1);      NPError reason;    if(strcmp(sz1, "NPRES_DONE") == 0)      reason = NPRES_DONE;    else if(strcmp(sz1, "NPRES_USER_BREAK") == 0)      reason = NPRES_USER_BREAK;    else if(strcmp(sz1, "NPRES_NETWORK_ERR") == 0)      reason = NPRES_NETWORK_ERR;    else      reason = NPRES_DONE;    pPlugin->makeNPNCall(action_npn_destroy_stream, DEFAULT_DWARG_VALUE, DEFAULT_DWARG_VALUE, (DWORD)reason);  }  else if(strcmp(szString, STRING_NPN_REQUESTREAD) == 0)  {  }  else if(strcmp(szString, STRING_NPN_WRITE) == 0)  {    Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG4), sz1, sizeof(sz1));    DWORD dwLen = (DWORD)GetDlgItemInt(hWnd, IDC_EDIT_ARG3, &bTranslated, FALSE);    pPlugin->makeNPNCall(action_npn_write, DEFAULT_DWARG_VALUE, DEFAULT_DWARG_VALUE, dwLen, (DWORD)sz1);  }  else if(strcmp(szString, STRING_NPN_STATUS) == 0)  {    Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG2), sz1, sizeof(sz1));    pPlugin->makeNPNCall(action_npn_status, DEFAULT_DWARG_VALUE, (DWORD)sz1);  }  else if(strcmp(szString, STRING_NPN_USERAGENT) == 0)  {    pPlugin->makeNPNCall(action_npn_user_agent);  }  else if(strcmp(szString, STRING_NPN_MEMALLOC) == 0)  {    DWORD dwSize = (DWORD)GetDlgItemInt(hWnd, IDC_EDIT_ARG1, &bTranslated, FALSE);    pPlugin->makeNPNCall(action_npn_mem_alloc, dwSize);  }  else if(strcmp(szString, STRING_NPN_MEMFREE) == 0)  {    pPlugin->makeNPNCall(action_npn_mem_free);  }  else if(strcmp(szString, STRING_NPN_MEMFLUSH) == 0)  {    DWORD dwSize = (DWORD)GetDlgItemInt(hWnd, IDC_EDIT_ARG1, &bTranslated, FALSE);    pPlugin->makeNPNCall(action_npn_mem_flush, dwSize);  }  else if(strcmp(szString, STRING_NPN_RELOADPLUGINS) == 0)  {    int index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG1));    ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG1), index, sz1);    BOOL bReloadPages = (strcmp(sz1, "TRUE") == 0) ? TRUE : FALSE;    pPlugin->makeNPNCall(action_npn_reload_plugins, (DWORD)bReloadPages);  }  else if(strcmp(szString, STRING_NPN_GETJAVAENV) == 0)  {    pPlugin->makeNPNCall(action_npn_get_java_env);  }  else if(strcmp(szString, STRING_NPN_GETJAVAPEER) == 0)  {    pPlugin->makeNPNCall(action_npn_get_java_peer);  }  else if(strcmp(szString, STRING_NPN_GETVALUE) == 0)  {    static DWORD dwValue = 0L;    NPNVariable variable = (NPNVariable)NULL;    int index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG2));    ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG2), index, sz1);    if(strcmp(sz1, "NPNVxDisplay") == 0)      variable = NPNVxDisplay;    else if(strcmp(sz1, "NPNVxtAppContext") == 0)      variable = NPNVxtAppContext;    else if(strcmp(sz1, "NPNVnetscapeWindow") == 0)      variable = NPNVnetscapeWindow;    else if(strcmp(sz1, "NPNVjavascriptEnabledBool") == 0)      variable = NPNVjavascriptEnabledBool;    else if(strcmp(sz1, "NPNVasdEnabledBool") == 0)      variable = NPNVasdEnabledBool;    else if(strcmp(sz1, "NPNVisOfflineBool") == 0)      variable = NPNVisOfflineBool;    pPlugin->m_pValue = (void *)&dwValue;    pPlugin->makeNPNCall(action_npn_get_value, DEFAULT_DWARG_VALUE, (DWORD)variable, DEFAULT_DWARG_VALUE);  }  else if(strcmp(szString, STRING_NPN_SETVALUE) == 0)  {    NPPVariable variable = (NPPVariable)NULL;    static char szStringValue[256];    static BOOL bBoolValue;    int index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG2));    ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG2), index, sz1);    if(strcmp(sz1, "NPPVpluginNameString") == 0)    {      variable = NPPVpluginNameString;      Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), szStringValue, sizeof(szStringValue));      pPlugin->m_pValue = (void *)&szStringValue[0];    }    else if(strcmp(sz1, "NPPVpluginDescriptionString") == 0)    {      variable = NPPVpluginDescriptionString;      Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), szStringValue, sizeof(szStringValue));      pPlugin->m_pValue = (void *)&szStringValue[0];    }    else if(strcmp(sz1, "NPPVpluginWindowBool") == 0)    {      variable = NPPVpluginWindowBool;      index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG3));      ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG3), index, szStringValue);      bBoolValue = (strcmp(szStringValue, "TRUE") == 0) ? TRUE : FALSE;      pPlugin->m_pValue = (void *)&bBoolValue;    }    else if(strcmp(sz1, "NPPVpluginTransparentBool") == 0)    {      variable = NPPVpluginTransparentBool;      index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG3));      ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG3), index, szStringValue);      bBoolValue = (strcmp(szStringValue, "TRUE") == 0) ? TRUE : FALSE;      pPlugin->m_pValue = (void *)&bBoolValue;    }    else if(strcmp(sz1, "NPPVpluginWindowSize") == 0)    {      variable = NPPVpluginWindowSize;      static NPSize npsize;      npsize.width = GetDlgItemInt(hWnd, IDC_EDIT_ARG3, &bTranslated, TRUE);      npsize.height = GetDlgItemInt(hWnd, IDC_EDIT_ARG4, &bTranslated, TRUE);      pPlugin->m_pValue = (void *)&npsize;    }    pPlugin->makeNPNCall(action_npn_set_value, DEFAULT_DWARG_VALUE, (DWORD)variable, DEFAULT_DWARG_VALUE);  }  else if(strcmp(szString, STRING_NPN_INVALIDATERECT) == 0)  {    static NPRect nprect;    nprect.top    = GetDlgItemInt(hWnd, IDC_EDIT_ARG2, &bTranslated, TRUE);    nprect.left   = GetDlgItemInt(hWnd, IDC_EDIT_ARG3, &bTranslated, TRUE);    nprect.bottom = GetDlgItemInt(hWnd, IDC_EDIT_ARG4, &bTranslated, TRUE);    nprect.right  = GetDlgItemInt(hWnd, IDC_EDIT_ARG5, &bTranslated, TRUE);    pPlugin->makeNPNCall(action_npn_invalidate_rect, DEFAULT_DWARG_VALUE, (DWORD)&nprect);  }  else if(strcmp(szString, STRING_NPN_INVALIDATEREGION) == 0)  {    int i = GetDlgItemInt(hWnd, IDC_EDIT_ARG2, &bTranslated, FALSE);    pPlugin->makeNPNCall(action_npn_invalidate_region, DEFAULT_DWARG_VALUE, (DWORD)i);  }  else if(strcmp(szString, STRING_NPN_FORCEREDRAW) == 0)  {    pPlugin->makeNPNCall(action_npn_force_redraw);  }  else    assert(0);}