Back to index

lightning-sunbird  0.9+nobinonly
guihlp.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #include "xp.h"
00039 #include <windowsx.h>
00040 #include <assert.h>
00041 
00042 #include "resource.h"
00043 
00044 #include "guihlp.h"
00045 #include "plugin.h"
00046 #include "comstrs.h"
00047 
00048 static char szDefaultNPByteRangeList[] = "100-100,200-100,300-100";
00049 
00050 static char szNotImplemented[] = "Currently not implemented";
00051 
00052 void EnableWindowNow(HWND hWnd, BOOL bEnable)
00053 {
00054   EnableWindow(hWnd, bEnable);
00055   UpdateWindow(hWnd);
00056 }
00057 
00058 void ShowWindowNow(HWND hWnd, int iShow)
00059 {
00060   ShowWindow(hWnd, iShow);
00061   UpdateWindow(hWnd);
00062 }
00063 
00064 void fillAPIComboBoxAndSetSel(HWND hWndCombo, int iSel)
00065 {
00066   ComboBox_AddString(hWndCombo, STRING_NPN_VERSION);
00067   ComboBox_AddString(hWndCombo, STRING_NPN_GETURL);
00068   ComboBox_AddString(hWndCombo, STRING_NPN_GETURLNOTIFY);
00069   ComboBox_AddString(hWndCombo, STRING_NPN_POSTURL);
00070   ComboBox_AddString(hWndCombo, STRING_NPN_POSTURLNOTIFY);
00071   ComboBox_AddString(hWndCombo, STRING_NPN_REQUESTREAD);
00072   ComboBox_AddString(hWndCombo, STRING_NPN_NEWSTREAM);
00073   ComboBox_AddString(hWndCombo, STRING_NPN_DESTROYSTREAM);
00074   ComboBox_AddString(hWndCombo, STRING_NPN_WRITE);
00075   ComboBox_AddString(hWndCombo, STRING_NPN_STATUS);
00076   ComboBox_AddString(hWndCombo, STRING_NPN_USERAGENT);
00077   ComboBox_AddString(hWndCombo, STRING_NPN_MEMALLOC);
00078   ComboBox_AddString(hWndCombo, STRING_NPN_MEMFREE);
00079   ComboBox_AddString(hWndCombo, STRING_NPN_MEMFLUSH);
00080   ComboBox_AddString(hWndCombo, STRING_NPN_RELOADPLUGINS);
00081   ComboBox_AddString(hWndCombo, STRING_NPN_GETJAVAENV);
00082   ComboBox_AddString(hWndCombo, STRING_NPN_GETJAVAPEER);
00083   ComboBox_AddString(hWndCombo, STRING_NPN_GETVALUE);
00084   ComboBox_AddString(hWndCombo, STRING_NPN_SETVALUE);
00085   ComboBox_AddString(hWndCombo, STRING_NPN_INVALIDATERECT);
00086   ComboBox_AddString(hWndCombo, STRING_NPN_INVALIDATEREGION);
00087   ComboBox_AddString(hWndCombo, STRING_NPN_FORCEREDRAW);
00088 
00089   ComboBox_SetCurSel(hWndCombo, iSel);
00090 }
00091 
00092 static void setStaticTexts7(HWND hWnd, LPSTR s1, LPSTR s2, LPSTR s3, LPSTR s4, LPSTR s5,LPSTR s6, LPSTR s7)
00093 {
00094   Static_SetText(GetDlgItem(hWnd, IDC_STATIC_ARG1), s1);
00095   Static_SetText(GetDlgItem(hWnd, IDC_STATIC_ARG2), s2);
00096   Static_SetText(GetDlgItem(hWnd, IDC_STATIC_ARG3), s3);
00097   Static_SetText(GetDlgItem(hWnd, IDC_STATIC_ARG4), s4);
00098   Static_SetText(GetDlgItem(hWnd, IDC_STATIC_ARG5), s5);
00099   Static_SetText(GetDlgItem(hWnd, IDC_STATIC_ARG6), s6);
00100   Static_SetText(GetDlgItem(hWnd, IDC_STATIC_ARG7), s7);
00101 }
00102 
00103 static void setEditTexts7(HWND hWnd, LPSTR s1, LPSTR s2, LPSTR s3, LPSTR s4, LPSTR s5,LPSTR s6, LPSTR s7)
00104 {
00105   Edit_SetText(GetDlgItem(hWnd, IDC_EDIT_ARG1), s1);
00106   Edit_SetText(GetDlgItem(hWnd, IDC_EDIT_ARG2), s2);
00107   Edit_SetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), s3);
00108   Edit_SetText(GetDlgItem(hWnd, IDC_EDIT_ARG4), s4);
00109   Edit_SetText(GetDlgItem(hWnd, IDC_EDIT_ARG5), s5);
00110   Edit_SetText(GetDlgItem(hWnd, IDC_EDIT_ARG6), s6);
00111   Edit_SetText(GetDlgItem(hWnd, IDC_EDIT_ARG7), s7);
00112 }
00113 
00114 static void showArgControls7(HWND hWnd, BOOL b1, BOOL b2, BOOL b3, BOOL b4, BOOL b5, BOOL b6, BOOL b7)
00115 {
00116   ShowWindow(GetDlgItem(hWnd, IDC_STATIC_ARG1), b1 ? SW_SHOW : SW_HIDE);
00117   ShowWindow(GetDlgItem(hWnd, IDC_STATIC_ARG2), b2 ? SW_SHOW : SW_HIDE);
00118   ShowWindow(GetDlgItem(hWnd, IDC_STATIC_ARG3), b3 ? SW_SHOW : SW_HIDE);
00119   ShowWindow(GetDlgItem(hWnd, IDC_STATIC_ARG4), b4 ? SW_SHOW : SW_HIDE);
00120   ShowWindow(GetDlgItem(hWnd, IDC_STATIC_ARG5), b5 ? SW_SHOW : SW_HIDE);
00121   ShowWindow(GetDlgItem(hWnd, IDC_STATIC_ARG6), b6 ? SW_SHOW : SW_HIDE);
00122   ShowWindow(GetDlgItem(hWnd, IDC_STATIC_ARG7), b7 ? SW_SHOW : SW_HIDE);
00123 
00124   ShowWindow(GetDlgItem(hWnd, IDC_EDIT_ARG1), b1 ? SW_SHOW : SW_HIDE);
00125   ShowWindow(GetDlgItem(hWnd, IDC_EDIT_ARG2), b2 ? SW_SHOW : SW_HIDE);
00126   ShowWindow(GetDlgItem(hWnd, IDC_EDIT_ARG3), b3 ? SW_SHOW : SW_HIDE);
00127   ShowWindow(GetDlgItem(hWnd, IDC_EDIT_ARG4), b4 ? SW_SHOW : SW_HIDE);
00128   ShowWindow(GetDlgItem(hWnd, IDC_EDIT_ARG5), b5 ? SW_SHOW : SW_HIDE);
00129   ShowWindow(GetDlgItem(hWnd, IDC_EDIT_ARG6), b6 ? SW_SHOW : SW_HIDE);
00130   ShowWindow(GetDlgItem(hWnd, IDC_EDIT_ARG7), b7 ? SW_SHOW : SW_HIDE);
00131 }
00132 
00133 static void enableEdits7(HWND hWnd, BOOL b1, BOOL b2, BOOL b3, BOOL b4, BOOL b5, BOOL b6, BOOL b7)
00134 {
00135   EnableWindow(GetDlgItem(hWnd, IDC_EDIT_ARG1), b1);
00136   EnableWindow(GetDlgItem(hWnd, IDC_EDIT_ARG2), b2);
00137   EnableWindow(GetDlgItem(hWnd, IDC_EDIT_ARG3), b3);
00138   EnableWindow(GetDlgItem(hWnd, IDC_EDIT_ARG4), b4);
00139   EnableWindow(GetDlgItem(hWnd, IDC_EDIT_ARG5), b5);
00140   EnableWindow(GetDlgItem(hWnd, IDC_EDIT_ARG6), b6);
00141   EnableWindow(GetDlgItem(hWnd, IDC_EDIT_ARG7), b7);
00142 }
00143 
00144 static void replaceEditWithCombo(HWND hWnd, BOOL b1, BOOL b2, BOOL b3, BOOL b6)
00145 {
00146   if(b1)
00147   {
00148     ShowWindow(GetDlgItem(hWnd, IDC_EDIT_ARG1), SW_HIDE);
00149     ShowWindow(GetDlgItem(hWnd, IDC_COMBO_ARG1), SW_SHOW);
00150   }
00151   if(b2)
00152   {
00153     ShowWindow(GetDlgItem(hWnd, IDC_EDIT_ARG2), SW_HIDE);
00154     ShowWindow(GetDlgItem(hWnd, IDC_COMBO_ARG2), SW_SHOW);
00155   }
00156   if(b3)
00157   {
00158     ShowWindow(GetDlgItem(hWnd, IDC_EDIT_ARG3), SW_HIDE);
00159     ShowWindow(GetDlgItem(hWnd, IDC_COMBO_ARG3), SW_SHOW);
00160   }
00161   if(b6)
00162   {
00163     ShowWindow(GetDlgItem(hWnd, IDC_EDIT_ARG6), SW_HIDE);
00164     ShowWindow(GetDlgItem(hWnd, IDC_COMBO_ARG6), SW_SHOW);
00165   }
00166 }
00167 
00168 #define NS_SAMPLE_URL "http://mozilla.org"
00169 
00170 void updateUI(HWND hWnd)
00171 {
00172   CPlugin * pPlugin = (CPlugin *)GetWindowLong(hWnd, DWL_USER);
00173   assert(pPlugin != NULL);
00174 
00175   DWORD dwNPInstance = (DWORD)pPlugin->getNPInstance();
00176   char szNPInstance[16];
00177   wsprintf(szNPInstance, "%#08lx", dwNPInstance);
00178   Static_SetText(GetDlgItem(hWnd, IDC_STATIC_INFO), "");
00179   ShowWindow(GetDlgItem(hWnd, IDC_STATIC_INFO), SW_HIDE);
00180 
00181   setStaticTexts7(hWnd, "","","","","","","");
00182   setEditTexts7(hWnd, "","","","","","","");
00183   enableEdits7(hWnd, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
00184 
00185   EnableWindow(GetDlgItem(hWnd, IDC_BUTTON_GO), TRUE);
00186 
00187   char szString[80];
00188   int iIndex = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_API_CALL));
00189   ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_API_CALL), iIndex, szString);
00190 
00191   ShowWindow(GetDlgItem(hWnd, IDC_BUTTON_PASTE), SW_SHOW);
00192 
00193   ComboBox_ResetContent(GetDlgItem(hWnd, IDC_COMBO_ARG1));
00194   ComboBox_ResetContent(GetDlgItem(hWnd, IDC_COMBO_ARG2));
00195   ComboBox_ResetContent(GetDlgItem(hWnd, IDC_COMBO_ARG3));
00196   ComboBox_ResetContent(GetDlgItem(hWnd, IDC_COMBO_ARG6));
00197   ShowWindow(GetDlgItem(hWnd, IDC_COMBO_ARG1), SW_HIDE);
00198   ShowWindow(GetDlgItem(hWnd, IDC_COMBO_ARG2), SW_HIDE);
00199   ShowWindow(GetDlgItem(hWnd, IDC_COMBO_ARG3), SW_HIDE);
00200   ShowWindow(GetDlgItem(hWnd, IDC_COMBO_ARG6), SW_HIDE);
00201 
00202   if(strcmp(szString, STRING_NPN_VERSION) == 0)
00203   {
00204     showArgControls7(hWnd, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00205     ShowWindow(GetDlgItem(hWnd, IDC_BUTTON_PASTE), SW_HIDE);
00206   }
00207   else if(strcmp(szString, STRING_NPN_GETURL) == 0)
00208   {
00209     showArgControls7(hWnd, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE);
00210     enableEdits7(hWnd, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE);
00211     setStaticTexts7(hWnd, "instance:", "URL:", "target (or 'NULL'):", "", "", "", "");
00212     setEditTexts7(hWnd, szNPInstance,NS_SAMPLE_URL,"_npapi_Display","","","","");
00213   }
00214   else if(strcmp(szString, STRING_NPN_GETURLNOTIFY) == 0)
00215   {
00216     showArgControls7(hWnd, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE);
00217     enableEdits7(hWnd, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE);
00218     setStaticTexts7(hWnd, "instance:", "URL:", "target (or 'NULL'):", "notifyData:", "", "", "");
00219     setEditTexts7(hWnd, szNPInstance,NS_SAMPLE_URL,"_npapi_Display","0","","","");
00220   }
00221   else if(strcmp(szString, STRING_NPN_POSTURL) == 0)
00222   {
00223     showArgControls7(hWnd, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE);
00224     enableEdits7(hWnd, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE);
00225     setStaticTexts7(hWnd, "instance:", "URL:", "target (or 'NULL'):", "len:", "buf:", "file:", "");
00226     setEditTexts7(hWnd, szNPInstance,NS_SAMPLE_URL,"_npapi_Display","0","","","");
00227     replaceEditWithCombo(hWnd, FALSE, FALSE, FALSE, TRUE);
00228     HWND hWndCombo = GetDlgItem(hWnd, IDC_COMBO_ARG6);
00229     ComboBox_AddString(hWndCombo, "FALSE");
00230     ComboBox_AddString(hWndCombo, "TRUE");
00231     ComboBox_SetCurSel(hWndCombo, 0);
00232   }
00233   else if(strcmp(szString, STRING_NPN_POSTURLNOTIFY) == 0)
00234   {
00235     showArgControls7(hWnd, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
00236     enableEdits7(hWnd, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
00237     setStaticTexts7(hWnd, "instance:", "URL:", "target (or 'NULL'):", "len:", "buf:", "file:", "notifyData:");
00238     setEditTexts7(hWnd, szNPInstance,NS_SAMPLE_URL,"_npapi_Display","0","","","0");
00239     replaceEditWithCombo(hWnd, FALSE, FALSE, FALSE, TRUE);
00240     HWND hWndCombo = GetDlgItem(hWnd, IDC_COMBO_ARG6);
00241     ComboBox_AddString(hWndCombo, "FALSE");
00242     ComboBox_AddString(hWndCombo, "TRUE");
00243     ComboBox_SetCurSel(hWndCombo, 0);
00244   }
00245   else if(strcmp(szString, STRING_NPN_NEWSTREAM) == 0)
00246   {
00247     showArgControls7(hWnd, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE);
00248     enableEdits7(hWnd, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE);
00249     setStaticTexts7(hWnd, "instance:", "type:", "target:", "**stream:", "", "", "");
00250     char szStream[16];
00251     const NPStream * pStream = pPlugin->getNPStream();
00252     wsprintf(szStream, "%#08lx", &pStream);
00253     setEditTexts7(hWnd, szNPInstance,"text/plain","_npapi_Display",szStream,"","","");
00254     EnableWindow(GetDlgItem(hWnd, IDC_BUTTON_GO), (pStream != NULL) ? FALSE : TRUE);
00255   }
00256   else if(strcmp(szString, STRING_NPN_REQUESTREAD) == 0)
00257   {
00258 //serge
00259     showArgControls7(hWnd, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE);
00260     enableEdits7(hWnd, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE);
00261     setStaticTexts7(hWnd, "instance:", "URL:", "Range:", "notifyData:", "", "", "");
00262     setEditTexts7(hWnd, szNPInstance,NS_SAMPLE_URL,szDefaultNPByteRangeList,"0","","","");
00263    /*
00264     EnableWindow(GetDlgItem(hWnd, IDC_BUTTON_GO), FALSE);
00265     ShowWindow(GetDlgItem(hWnd, IDC_STATIC_INFO), SW_SHOW);
00266     Static_SetText(GetDlgItem(hWnd, IDC_STATIC_INFO), szNotImplemented);
00267     showArgControls7(hWnd, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00268     ShowWindow(GetDlgItem(hWnd, IDC_BUTTON_PASTE), SW_HIDE);
00269     */
00270   }
00271   else if(strcmp(szString, STRING_NPN_DESTROYSTREAM) == 0)
00272   {
00273     showArgControls7(hWnd, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE);
00274     enableEdits7(hWnd, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE);
00275     setStaticTexts7(hWnd, "instance:", "stream:", "reason:", "", "", "", "");
00276     char szStream[16];
00277     const NPStream * pStream = pPlugin->getNPStream();
00278     wsprintf(szStream, "%#08lx", pStream);
00279     setEditTexts7(hWnd, szNPInstance,szStream,"","","","","");
00280     replaceEditWithCombo(hWnd, FALSE, FALSE, TRUE, FALSE);
00281     HWND hWndCombo = GetDlgItem(hWnd, IDC_COMBO_ARG3);
00282     ComboBox_AddString(hWndCombo, "NPRES_DONE");
00283     ComboBox_AddString(hWndCombo, "NPRES_USER_BREAK");
00284     ComboBox_AddString(hWndCombo, "NPRES_NETWORK_ERR");
00285     ComboBox_SetCurSel(hWndCombo, 0);
00286     EnableWindow(GetDlgItem(hWnd, IDC_BUTTON_GO), (pStream == NULL) ? FALSE : TRUE);
00287   }
00288   else if(strcmp(szString, STRING_NPN_WRITE) == 0)
00289   {
00290     showArgControls7(hWnd, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE);
00291     enableEdits7(hWnd, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE);
00292     setStaticTexts7(hWnd, "instance:", "stream:", "len:", "buf:", "", "", "");
00293     char szStream[16];
00294     const NPStream * pStream = pPlugin->getNPStream();
00295     wsprintf(szStream, "%#08lx", pStream);
00296     setEditTexts7(hWnd, szNPInstance,szStream,"0","","","","");
00297     EnableWindow(GetDlgItem(hWnd, IDC_BUTTON_GO), (pStream == NULL) ? FALSE : TRUE);
00298   }
00299   else if(strcmp(szString, STRING_NPN_STATUS) == 0)
00300   {
00301     showArgControls7(hWnd, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE);
00302     enableEdits7(hWnd, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE);
00303     setStaticTexts7(hWnd, "instance:", "message:", "", "", "", "", "");
00304     setEditTexts7(hWnd, szNPInstance,"Some message","","","","","");
00305   }
00306   else if(strcmp(szString, STRING_NPN_USERAGENT) == 0)
00307   {
00308     showArgControls7(hWnd, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00309     enableEdits7(hWnd, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00310     setStaticTexts7(hWnd, "instance:", "", "", "", "", "", "");
00311     setEditTexts7(hWnd, szNPInstance,"","","","","","");
00312     ShowWindow(GetDlgItem(hWnd, IDC_BUTTON_PASTE), SW_HIDE);
00313   }
00314   else if(strcmp(szString, STRING_NPN_MEMALLOC) == 0)
00315   {
00316     showArgControls7(hWnd, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00317     enableEdits7(hWnd, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00318     setStaticTexts7(hWnd, "size:", "", "", "", "", "", "");
00319     setEditTexts7(hWnd, "256","","","","","","");
00320     EnableWindow(GetDlgItem(hWnd, IDC_BUTTON_GO), (pPlugin->m_pNPNAlloced == NULL) ? TRUE : FALSE);
00321     ShowWindow(GetDlgItem(hWnd, IDC_BUTTON_PASTE), SW_HIDE);
00322   }
00323   else if(strcmp(szString, STRING_NPN_MEMFREE) == 0)
00324   {
00325     showArgControls7(hWnd, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00326     enableEdits7(hWnd, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00327     setStaticTexts7(hWnd, "ptr:", "", "", "", "", "", "");
00328     char szPtr[16];
00329     wsprintf(szPtr, "%#08lx", pPlugin->m_pNPNAlloced);
00330     setEditTexts7(hWnd, szPtr,"","","","","","");
00331     EnableWindow(GetDlgItem(hWnd, IDC_BUTTON_GO), (pPlugin->m_pNPNAlloced == NULL) ? FALSE : TRUE);
00332     ShowWindow(GetDlgItem(hWnd, IDC_BUTTON_PASTE), SW_HIDE);
00333   }
00334   else if(strcmp(szString, STRING_NPN_MEMFLUSH) == 0)
00335   {
00336     showArgControls7(hWnd, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00337     enableEdits7(hWnd, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00338     setStaticTexts7(hWnd, "size:", "", "", "", "", "", "");
00339     setEditTexts7(hWnd, "256","","","","","","");
00340     ShowWindow(GetDlgItem(hWnd, IDC_BUTTON_PASTE), SW_HIDE);
00341   }
00342   else if(strcmp(szString, STRING_NPN_RELOADPLUGINS) == 0)
00343   {
00344     showArgControls7(hWnd, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00345     enableEdits7(hWnd, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00346     setStaticTexts7(hWnd, "reloadPages:", "", "", "", "", "", "");
00347     setEditTexts7(hWnd, "","","","","","","");
00348     replaceEditWithCombo(hWnd, TRUE, FALSE, FALSE, FALSE);
00349     HWND hWndCombo = GetDlgItem(hWnd, IDC_COMBO_ARG1);
00350     ComboBox_AddString(hWndCombo, "TRUE");
00351     ComboBox_AddString(hWndCombo, "FALSE");
00352     ComboBox_SetCurSel(hWndCombo, 0);
00353     ShowWindow(GetDlgItem(hWnd, IDC_BUTTON_PASTE), SW_HIDE);
00354   }
00355   else if(strcmp(szString, STRING_NPN_GETJAVAENV) == 0)
00356   {
00357     showArgControls7(hWnd, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00358     ShowWindow(GetDlgItem(hWnd, IDC_BUTTON_PASTE), SW_HIDE);
00359   }
00360   else if(strcmp(szString, STRING_NPN_GETJAVAPEER) == 0)
00361   {
00362     showArgControls7(hWnd, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00363     enableEdits7(hWnd, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00364     setStaticTexts7(hWnd, "instance:", "", "", "", "", "", "");
00365     setEditTexts7(hWnd, szNPInstance,"","","","","","");
00366     ShowWindow(GetDlgItem(hWnd, IDC_BUTTON_PASTE), SW_HIDE);
00367   }
00368   else if(strcmp(szString, STRING_NPN_GETVALUE) == 0)
00369   {
00370     showArgControls7(hWnd, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE);
00371     enableEdits7(hWnd, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00372     setStaticTexts7(hWnd, "instance:", "variable:", "", "", "", "", "");
00373     setEditTexts7(hWnd, szNPInstance,"","","","","","");
00374     replaceEditWithCombo(hWnd, FALSE, TRUE, FALSE, FALSE);
00375     HWND hWndCombo = GetDlgItem(hWnd, IDC_COMBO_ARG2);
00376     ComboBox_AddString(hWndCombo, "NPNVxDisplay");
00377     ComboBox_AddString(hWndCombo, "NPNVxtAppContext");
00378     ComboBox_AddString(hWndCombo, "NPNVnetscapeWindow");
00379     ComboBox_AddString(hWndCombo, "NPNVjavascriptEnabledBool");
00380     ComboBox_AddString(hWndCombo, "NPNVasdEnabledBool");
00381     ComboBox_AddString(hWndCombo, "NPNVisOfflineBool");
00382     ComboBox_SetCurSel(hWndCombo, 0);
00383     ShowWindow(GetDlgItem(hWnd, IDC_BUTTON_PASTE), SW_HIDE);
00384   }
00385   else if(strcmp(szString, STRING_NPN_SETVALUE) == 0)
00386   {
00387     showArgControls7(hWnd, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE);
00388     enableEdits7(hWnd, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE);
00389     setStaticTexts7(hWnd, "instance:", "variable:", "*value:", "", "", "", "");
00390     setEditTexts7(hWnd, szNPInstance,"","","","","","");
00391     replaceEditWithCombo(hWnd, FALSE, TRUE, FALSE, FALSE);
00392     HWND hWndCombo = GetDlgItem(hWnd, IDC_COMBO_ARG2);
00393     ComboBox_AddString(hWndCombo, "NPPVpluginNameString");
00394     ComboBox_AddString(hWndCombo, "NPPVpluginDescriptionString");
00395     ComboBox_AddString(hWndCombo, "NPPVpluginWindowBool");
00396     ComboBox_AddString(hWndCombo, "NPPVpluginTransparentBool");
00397     ComboBox_AddString(hWndCombo, "NPPVpluginWindowSize");
00398     ComboBox_AddString(hWndCombo, "NPPVpluginKeepLibraryInMemory");
00399     ComboBox_SetCurSel(hWndCombo, 0);
00400     ShowWindow(GetDlgItem(hWnd, IDC_BUTTON_PASTE), SW_HIDE);
00401   }
00402   else if(strcmp(szString, STRING_NPN_INVALIDATERECT) == 0)
00403   {
00404     showArgControls7(hWnd, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE);
00405     enableEdits7(hWnd, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE);
00406     setStaticTexts7(hWnd, "instance:", "top:", "left:", "bottom:", "right:", "", "");
00407     setEditTexts7(hWnd, szNPInstance,"0","0","0","0","","");
00408     ShowWindow(GetDlgItem(hWnd, IDC_BUTTON_PASTE), SW_HIDE);
00409   }
00410   else if(strcmp(szString, STRING_NPN_INVALIDATEREGION) == 0)
00411   {
00412     showArgControls7(hWnd, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE);
00413     enableEdits7(hWnd, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE);
00414     setStaticTexts7(hWnd, "instance:", "region:", "", "", "", "", "");
00415     setEditTexts7(hWnd, szNPInstance,"0","0","0","0","","");
00416     ShowWindow(GetDlgItem(hWnd, IDC_BUTTON_PASTE), SW_HIDE);
00417   }
00418   else if(strcmp(szString, STRING_NPN_FORCEREDRAW) == 0)
00419   {
00420     showArgControls7(hWnd, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00421     enableEdits7(hWnd, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
00422     setStaticTexts7(hWnd, "instance:", "", "", "", "", "", "");
00423     setEditTexts7(hWnd, szNPInstance,"","","","","","");
00424     ShowWindow(GetDlgItem(hWnd, IDC_BUTTON_PASTE), SW_HIDE);
00425   }
00426   else
00427     assert(0);
00428 }
00429 
00430 /*      
00431 NPByteRange g_npByteRangeList[] = {
00432    {100, 100, npByteRangeList + 1},
00433    {200, 100, npByteRangeList + 2},
00434    {300, 100, 0}
00435 };
00436 */
00437 
00438 void onGo(HWND hWnd)
00439 {
00440   CPlugin * pPlugin = (CPlugin *)GetWindowLong(hWnd, DWL_USER);
00441   assert(pPlugin != NULL);
00442 
00443   char szString[80];
00444   char sz1[128];
00445   char sz2[128];
00446   char sz3[128];
00447   char sz4[128];
00448   BOOL bTranslated = FALSE;
00449 
00450   ComboBox_GetText(GetDlgItem(hWnd, IDC_COMBO_API_CALL), szString, sizeof(szString));
00451 
00452   if(strcmp(szString, STRING_NPN_VERSION) == 0)
00453   {
00454     pPlugin->makeNPNCall(action_npn_version, DEFAULT_DWARG_VALUE, DEFAULT_DWARG_VALUE, 
00455                          DEFAULT_DWARG_VALUE, DEFAULT_DWARG_VALUE);
00456   }
00457   else if(strcmp(szString, STRING_NPN_GETURL) == 0)
00458   {
00459     Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG2), sz1, sizeof(sz1));
00460     Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), sz2, sizeof(sz2));
00461     DWORD dwTarget = 0L;
00462     if(strcmp(sz2, "NULL") == 0)
00463       dwTarget = 0L;
00464     else
00465       dwTarget = (DWORD)sz2;
00466     pPlugin->makeNPNCall(action_npn_get_url, DEFAULT_DWARG_VALUE, (DWORD)sz1, dwTarget);
00467   }
00468   else if(strcmp(szString, STRING_NPN_GETURLNOTIFY) == 0)
00469   {
00470     Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG2), sz1, sizeof(sz1));
00471     Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), sz2, sizeof(sz2));
00472     DWORD dwData = (DWORD)GetDlgItemInt(hWnd, IDC_EDIT_ARG4, &bTranslated, FALSE);
00473     DWORD dwTarget = 0L;
00474     if(strcmp(sz2, "NULL") == 0)
00475       dwTarget = 0L;
00476     else
00477       dwTarget = (DWORD)sz2;
00478     pPlugin->makeNPNCall(action_npn_get_url_notify, DEFAULT_DWARG_VALUE, (DWORD)sz1, dwTarget, dwData);
00479   }
00480   else if(strcmp(szString, STRING_NPN_REQUESTREAD) == 0)
00481   {
00482     extern NPByteRange * convertStringToNPByteRangeList(LPSTR szString);
00483 
00484     Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG2), sz1, sizeof(sz1));
00485     Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), sz2, sizeof(sz2));
00486     DWORD dwData = (DWORD)GetDlgItemInt(hWnd, IDC_EDIT_ARG4, &bTranslated, FALSE);
00487     DWORD dwTarget = 0L;
00488     NPByteRange *npByteRangeList = convertStringToNPByteRangeList(sz2);
00489     if (!npByteRangeList) { // use default szDefaultNPByteRangeList
00490       npByteRangeList = convertStringToNPByteRangeList(szDefaultNPByteRangeList);
00491     }
00492     pPlugin->m_firstAction = action_npn_request_read;
00493     dwData = (DWORD) npByteRangeList;
00494     pPlugin->makeNPNCall(action_npn_get_url_notify, DEFAULT_DWARG_VALUE, (DWORD)sz1, dwTarget, dwData);
00495   }
00496   else if(strcmp(szString, STRING_NPN_POSTURL) == 0)
00497   {
00498     Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG2), sz1, sizeof(sz1));
00499     Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), sz2, sizeof(sz2));
00500     DWORD dwLen = (DWORD)GetDlgItemInt(hWnd, IDC_EDIT_ARG4, &bTranslated, FALSE);
00501     Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG5), sz3, sizeof(sz3));
00502     int index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG6));
00503     ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG6), index, sz4);
00504     BOOL bFile = (strcmp(sz4, "TRUE") == 0) ? TRUE : FALSE;
00505     DWORD dwTarget = 0L;
00506     if(strcmp(sz2, "NULL") == 0)
00507       dwTarget = 0L;
00508     else
00509       dwTarget = (DWORD)sz2;
00510     pPlugin->makeNPNCall(action_npn_post_url, DEFAULT_DWARG_VALUE, (DWORD)sz1, dwTarget, dwLen, (DWORD)sz3, (DWORD)bFile);
00511   }
00512   else if(strcmp(szString, STRING_NPN_POSTURLNOTIFY) == 0)
00513   {
00514     Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG2), sz1, sizeof(sz1));
00515     Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), sz2, sizeof(sz2));
00516     DWORD dwLen = (DWORD)GetDlgItemInt(hWnd, IDC_EDIT_ARG4, &bTranslated, FALSE);
00517     Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG5), sz3, sizeof(sz3));
00518     int index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG6));
00519     ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG6), index, sz4);
00520     BOOL bFile = (strcmp(sz4, "TRUE") == 0) ? TRUE : FALSE;
00521     DWORD dwData = (DWORD)GetDlgItemInt(hWnd, IDC_EDIT_ARG7, &bTranslated, FALSE);
00522     DWORD dwTarget = 0L;
00523     if(strcmp(sz2, "NULL") == 0)
00524       dwTarget = 0L;
00525     else
00526       dwTarget = (DWORD)sz2;
00527     pPlugin->makeNPNCall(action_npn_post_url_notify, DEFAULT_DWARG_VALUE, (DWORD)sz1, dwTarget, dwLen, (DWORD)sz3, 
00528                          (DWORD)bFile, dwData);
00529   }
00530   else if(strcmp(szString, STRING_NPN_NEWSTREAM) == 0)
00531   {
00532     Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG2), sz1, sizeof(sz1));
00533     Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), sz2, sizeof(sz2));
00534     pPlugin->makeNPNCall(action_npn_new_stream, DEFAULT_DWARG_VALUE, (DWORD)sz1, (DWORD)sz2, DEFAULT_DWARG_VALUE);
00535   }
00536   else if(strcmp(szString, STRING_NPN_DESTROYSTREAM) == 0)
00537   {
00538     int index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG3));
00539     ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG3), index, sz1);
00540   
00541     NPError reason;
00542     if(strcmp(sz1, "NPRES_DONE") == 0)
00543       reason = NPRES_DONE;
00544     else if(strcmp(sz1, "NPRES_USER_BREAK") == 0)
00545       reason = NPRES_USER_BREAK;
00546     else if(strcmp(sz1, "NPRES_NETWORK_ERR") == 0)
00547       reason = NPRES_NETWORK_ERR;
00548     else
00549       reason = NPRES_DONE;
00550 
00551     pPlugin->makeNPNCall(action_npn_destroy_stream, DEFAULT_DWARG_VALUE, DEFAULT_DWARG_VALUE, (DWORD)reason);
00552   }
00553   else if(strcmp(szString, STRING_NPN_REQUESTREAD) == 0)
00554   {
00555   }
00556   else if(strcmp(szString, STRING_NPN_WRITE) == 0)
00557   {
00558     Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG4), sz1, sizeof(sz1));
00559     DWORD dwLen = (DWORD)GetDlgItemInt(hWnd, IDC_EDIT_ARG3, &bTranslated, FALSE);
00560     pPlugin->makeNPNCall(action_npn_write, DEFAULT_DWARG_VALUE, DEFAULT_DWARG_VALUE, dwLen, (DWORD)sz1);
00561   }
00562   else if(strcmp(szString, STRING_NPN_STATUS) == 0)
00563   {
00564     Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG2), sz1, sizeof(sz1));
00565     pPlugin->makeNPNCall(action_npn_status, DEFAULT_DWARG_VALUE, (DWORD)sz1);
00566   }
00567   else if(strcmp(szString, STRING_NPN_USERAGENT) == 0)
00568   {
00569     pPlugin->makeNPNCall(action_npn_user_agent);
00570   }
00571   else if(strcmp(szString, STRING_NPN_MEMALLOC) == 0)
00572   {
00573     DWORD dwSize = (DWORD)GetDlgItemInt(hWnd, IDC_EDIT_ARG1, &bTranslated, FALSE);
00574     pPlugin->makeNPNCall(action_npn_mem_alloc, dwSize);
00575   }
00576   else if(strcmp(szString, STRING_NPN_MEMFREE) == 0)
00577   {
00578     pPlugin->makeNPNCall(action_npn_mem_free);
00579   }
00580   else if(strcmp(szString, STRING_NPN_MEMFLUSH) == 0)
00581   {
00582     DWORD dwSize = (DWORD)GetDlgItemInt(hWnd, IDC_EDIT_ARG1, &bTranslated, FALSE);
00583     pPlugin->makeNPNCall(action_npn_mem_flush, dwSize);
00584   }
00585   else if(strcmp(szString, STRING_NPN_RELOADPLUGINS) == 0)
00586   {
00587     int index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG1));
00588     ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG1), index, sz1);
00589     BOOL bReloadPages = (strcmp(sz1, "TRUE") == 0) ? TRUE : FALSE;
00590     pPlugin->makeNPNCall(action_npn_reload_plugins, (DWORD)bReloadPages);
00591   }
00592   else if(strcmp(szString, STRING_NPN_GETJAVAENV) == 0)
00593   {
00594     pPlugin->makeNPNCall(action_npn_get_java_env);
00595   }
00596   else if(strcmp(szString, STRING_NPN_GETJAVAPEER) == 0)
00597   {
00598     pPlugin->makeNPNCall(action_npn_get_java_peer);
00599   }
00600   else if(strcmp(szString, STRING_NPN_GETVALUE) == 0)
00601   {
00602     static DWORD dwValue = 0L;
00603     NPNVariable variable = (NPNVariable)NULL;
00604 
00605     int index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG2));
00606     ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG2), index, sz1);
00607     if(strcmp(sz1, "NPNVxDisplay") == 0)
00608       variable = NPNVxDisplay;
00609     else if(strcmp(sz1, "NPNVxtAppContext") == 0)
00610       variable = NPNVxtAppContext;
00611     else if(strcmp(sz1, "NPNVnetscapeWindow") == 0)
00612       variable = NPNVnetscapeWindow;
00613     else if(strcmp(sz1, "NPNVjavascriptEnabledBool") == 0)
00614       variable = NPNVjavascriptEnabledBool;
00615     else if(strcmp(sz1, "NPNVasdEnabledBool") == 0)
00616       variable = NPNVasdEnabledBool;
00617     else if(strcmp(sz1, "NPNVisOfflineBool") == 0)
00618       variable = NPNVisOfflineBool;
00619 
00620     pPlugin->m_pValue = (void *)&dwValue;
00621 
00622     pPlugin->makeNPNCall(action_npn_get_value, DEFAULT_DWARG_VALUE, (DWORD)variable, DEFAULT_DWARG_VALUE);
00623   }
00624   else if(strcmp(szString, STRING_NPN_SETVALUE) == 0)
00625   {
00626     NPPVariable variable = (NPPVariable)NULL;
00627     static char szStringValue[256];
00628     static BOOL bBoolValue;
00629 
00630     int index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG2));
00631     ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG2), index, sz1);
00632     if(strcmp(sz1, "NPPVpluginNameString") == 0)
00633     {
00634       variable = NPPVpluginNameString;
00635       Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), szStringValue, sizeof(szStringValue));
00636       pPlugin->m_pValue = (void *)&szStringValue[0];
00637     }
00638     else if(strcmp(sz1, "NPPVpluginDescriptionString") == 0)
00639     {
00640       variable = NPPVpluginDescriptionString;
00641       Edit_GetText(GetDlgItem(hWnd, IDC_EDIT_ARG3), szStringValue, sizeof(szStringValue));
00642       pPlugin->m_pValue = (void *)&szStringValue[0];
00643     }
00644     else if(strcmp(sz1, "NPPVpluginWindowBool") == 0)
00645     {
00646       variable = NPPVpluginWindowBool;
00647       index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG3));
00648       ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG3), index, szStringValue);
00649       bBoolValue = (strcmp(szStringValue, "TRUE") == 0) ? TRUE : FALSE;
00650       pPlugin->m_pValue = (void *)&bBoolValue;
00651     }
00652     else if(strcmp(sz1, "NPPVpluginTransparentBool") == 0)
00653     {
00654       variable = NPPVpluginTransparentBool;
00655       index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG3));
00656       ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG3), index, szStringValue);
00657       bBoolValue = (strcmp(szStringValue, "TRUE") == 0) ? TRUE : FALSE;
00658       pPlugin->m_pValue = (void *)&bBoolValue;
00659     }
00660     else if(strcmp(sz1, "NPPVpluginWindowSize") == 0)
00661     {
00662       variable = NPPVpluginWindowSize;
00663       static NPSize npsize;
00664       npsize.width = GetDlgItemInt(hWnd, IDC_EDIT_ARG3, &bTranslated, TRUE);
00665       npsize.height = GetDlgItemInt(hWnd, IDC_EDIT_ARG4, &bTranslated, TRUE);
00666       pPlugin->m_pValue = (void *)&npsize;
00667     }
00668     else if(strcmp(sz1, "NPPVpluginKeepLibraryInMemory") == 0)
00669     {
00670       variable = NPPVpluginKeepLibraryInMemory;
00671       index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG3));
00672       ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG3), index, szStringValue);
00673       bBoolValue = (strcmp(szStringValue, "TRUE") == 0) ? TRUE : FALSE;
00674       pPlugin->m_pValue = (void *)&bBoolValue;
00675     }
00676     pPlugin->makeNPNCall(action_npn_set_value, DEFAULT_DWARG_VALUE, (DWORD)variable, DEFAULT_DWARG_VALUE);
00677   }
00678   else if(strcmp(szString, STRING_NPN_INVALIDATERECT) == 0)
00679   {
00680     static NPRect nprect;
00681     nprect.top    = GetDlgItemInt(hWnd, IDC_EDIT_ARG2, &bTranslated, TRUE);
00682     nprect.left   = GetDlgItemInt(hWnd, IDC_EDIT_ARG3, &bTranslated, TRUE);
00683     nprect.bottom = GetDlgItemInt(hWnd, IDC_EDIT_ARG4, &bTranslated, TRUE);
00684     nprect.right  = GetDlgItemInt(hWnd, IDC_EDIT_ARG5, &bTranslated, TRUE);
00685     pPlugin->makeNPNCall(action_npn_invalidate_rect, DEFAULT_DWARG_VALUE, (DWORD)&nprect);
00686   }
00687   else if(strcmp(szString, STRING_NPN_INVALIDATEREGION) == 0)
00688   {
00689     int i = GetDlgItemInt(hWnd, IDC_EDIT_ARG2, &bTranslated, FALSE);
00690     pPlugin->makeNPNCall(action_npn_invalidate_region, DEFAULT_DWARG_VALUE, (DWORD)i);
00691   }
00692   else if(strcmp(szString, STRING_NPN_FORCEREDRAW) == 0)
00693   {
00694     pPlugin->makeNPNCall(action_npn_force_redraw);
00695   }
00696   else
00697     assert(0);
00698 }
00699 
00700 void onPaste(HWND hWndToPasteTo)
00701 {
00702   if(hWndToPasteTo == NULL)
00703     return;
00704   if(!OpenClipboard(NULL))
00705     return;
00706   HANDLE hData = GetClipboardData(CF_TEXT);
00707   Edit_ReplaceSel(hWndToPasteTo, (char *)hData);
00708   CloseClipboard();
00709 }