#include "stdafx.h" #include "common.h" #include "CIEsink.h" #define ID_TIMER_POPUP_ANIMATION 100 #define ID_TIMER_IDLE 200 extern FWINLAYER pSetLayeredWindowAttributes; LRESULT CALLBACK ResultListProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ CResultList *pobj_ResultList; POINT pos; RECT rc; int iItem; switch(message){ case WM_TIMER: if(wParam==ID_TIMER_POPUP_ANIMATION){ pobj_ResultList=(CResultList *)GetWindowLongPtr(hwnd,GWLP_USERDATA); pSetLayeredWindowAttributes(hwnd, 0,(int)((double)255/(double)100*(double)(pobj_ResultList->iAnimeCount*10)), LWA_ALPHA); GetWindowRect(hwnd,&rc); rc.top++; SetWindowPos(hwnd,0,rc.left,rc.top,0,0,SWP_NOSIZE); pobj_ResultList->iAnimeCount+=1; if(pobj_ResultList->iAnimeCount>10){ KillTimer(hwnd,ID_TIMER_POPUP_ANIMATION); SetTimer(hwnd,ID_TIMER_IDLE,100,NULL); } } else if(wParam==ID_TIMER_IDLE){ InvalidateRect(hwnd,NULL,0); } return 0; case WM_PAINT: pobj_ResultList=(CResultList *)GetWindowLongPtr(hwnd,GWLP_USERDATA); RECT ClientRect; GetClientRect(hwnd,&ClientRect); //描画を開始 HDC hdc; PAINTSTRUCT ps; hdc=BeginPaint(hwnd,&ps); //メモリデバイスコンテキストを生成 HDC memdc; HBITMAP hMemBmp; memdc=CreateCompatibleDC(hdc); hMemBmp=CreateCompatibleBitmap(hdc,ClientRect.right,ClientRect.bottom); SelectObject(memdc,hMemBmp); //フォントをセット extern HFONT hStatusFont; HFONT hOldFont; hOldFont=(HFONT)SelectObject(memdc,hStatusFont); //ウィンドウサイズを取得(アイテム座標を取得) GetCursorPos(&pos); GetWindowRect(hwnd,&rc); rc.bottom=rc.top+LINK_ITEM_HEIGHT; //クライアント アイテム 座標を取得 ClientRect.left+=10; ClientRect.bottom=ClientRect.top+LINK_ITEM_HEIGHT; //ブラシを生成 HBRUSH hFaceBrush,hShadowBrush,hOldBrush; hFaceBrush=CreateSolidBrush(GetSysColor(COLOR_3DFACE)); hShadowBrush=CreateSolidBrush(GetSysColor(COLOR_3DSHADOW)); for(iItem=0;iItem<10;iItem++){ if(rc.leftpobj_OneTab->lpszTitle[iItem],-1,&ClientRect,DT_LEFT|DT_VCENTER|DT_SINGLELINE); rc.top+=LINK_ITEM_HEIGHT; rc.bottom=rc.top+LINK_ITEM_HEIGHT; ClientRect.top+=LINK_ITEM_HEIGHT; ClientRect.bottom=ClientRect.top+LINK_ITEM_HEIGHT; } SelectObject(memdc,hOldFont); GetClientRect(hwnd,&ClientRect); BitBlt(hdc,0,0,ClientRect.right,ClientRect.bottom,memdc,0,0,SRCCOPY); EndPaint(hwnd,&ps); DeleteObject(hFaceBrush); DeleteObject(hShadowBrush); DeleteDC(memdc); DeleteObject(hMemBmp); break; case WM_LBUTTONDOWN: pobj_ResultList=(CResultList *)GetWindowLongPtr(hwnd,GWLP_USERDATA); GetCursorPos(&pos); GetWindowRect(hwnd,&rc); rc.bottom=rc.top+LINK_ITEM_HEIGHT; for(iItem=0;iItem<10;iItem++){ if(rc.leftpobj_OneTab->lpszUrl[iItem],NULL,NULL,SW_SHOWNORMAL); break; } rc.top+=LINK_ITEM_HEIGHT; rc.bottom=rc.top+LINK_ITEM_HEIGHT; } return 0; } return DefWindowProc(hwnd,message,wParam,lParam); } CResultList::CResultList(COneTab *pot){ pobj_OneTab=pot; iAnimeCount=0; hwnd=CreateWindowEx(0,"ResultList","ResultList", WS_POPUP|WS_CLIPCHILDREN|WS_VISIBLE|WS_BORDER, 0,0,0,0, hOwner,0,hInst,0); //ウィンドウを半透明にする int lStyle; lStyle=GetWindowLongPtr(hwnd,GWL_EXSTYLE) | WS_EX_LAYERED; SetWindowLongPtr(hwnd,GWL_EXSTYLE,lStyle); pSetLayeredWindowAttributes(hwnd, 0, 0, LWA_ALPHA); SetWindowLongPtr(hwnd,GWLP_USERDATA,(long)this); SetTimer(hwnd,ID_TIMER_POPUP_ANIMATION,10,NULL); BringWindowToTop(hwnd); RECT rc; GetWindowRect(pobj_OneTab->hTabWnd,&rc); HDC hdc; hdc=GetDC(hwnd); extern HFONT hStatusFont; HFONT hOldFont; hOldFont=(HFONT)SelectObject(hdc,hStatusFont); //アイテム数を取得 int iItem,iMaxWidth=0; for(iItem=0;iItem<10;iItem++){ if(pobj_OneTab->lpszTitle[iItem]==0){ break; } SIZE size; GetTextExtentPoint32(hdc,pobj_OneTab->lpszTitle[iItem],lstrlen(pobj_OneTab->lpszTitle[iItem]),&size); if(iMaxWidthpobj_ResultList==0){ pobj_OneTab->pobj_ResultList=new CResultList(pobj_OneTab); } } else{ extern HFONT hStatusFont; hOldFont=(HFONT)SelectObject(hdc,hStatusFont); SetBkColor(hdc,GetSysColor(COLOR_3DFACE)); hBrush=CreateSolidBrush(GetSysColor(COLOR_3DFACE)); //リストを破棄 if(pobj_OneTab->pobj_ResultList){ GetWindowRect(pobj_OneTab->pobj_ResultList->hwnd,&rc); if(!(rc.left<=pos.x && pos.x<=rc.right && rc.top<=pos.y && pos.y<=rc.bottom)){ delete pobj_OneTab->pobj_ResultList; pobj_OneTab->pobj_ResultList=0; } } } SetTextColor(hdc,RGB(0,0,255)); GetClientRect(hwnd,&rc); hOldBrush=(HBRUSH)SelectObject(hdc,hBrush); PatBlt(hdc,0,0,rc.right,rc.bottom,PATCOPY); SelectObject(hdc,hOldBrush); rc.left++; DrawText(hdc,pobj_OneTab->lpszString,-1,&rc,DT_CENTER|DT_VCENTER|DT_SINGLELINE); SelectObject(hdc,hOldFont); //左端の境界線 HPEN hPen,hOldPen; hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DSHADOW)); hOldPen=(HPEN)SelectObject(hdc,hPen); MoveToEx(hdc,0,0,NULL); LineTo(hdc,0,rc.bottom-rc.top); SelectObject(hdc,hOldPen); DeleteObject(hPen); EndPaint(hwnd,&ps); DeleteObject(hBrush); return 0; case WM_LBUTTONDOWN: pobj_OneTab=(COneTab *)GetWindowLongPtr(hwnd,GWLP_USERDATA); ShellExecute(hwnd,"open",pobj_OneTab->lpszUrl[0],NULL,NULL,SW_SHOWNORMAL); return 0; case WM_COMMAND: break; } return DefWindowProc(hwnd,message,wParam,lParam); } COneTab::COneTab(int WndNum,char *str){ //0で初期化 memset(this,0,sizeof(COneTab)); m_WndNum=WndNum; lpszString=(char *)malloc(lstrlen(str)+1); lstrcpy(lpszString,str); //Web検索をかける WebSearch(); ///////////////////////////////// // テキストアイテムの幅を取得 ///////////////////////////////// HDC hdc; SIZE size; hdc=GetDC(hOwner); extern HFONT hStatusFont; HFONT hOldFont; hOldFont=(HFONT)SelectObject(hdc,hStatusFont); GetTextExtentPoint32(hdc,lpszString,lstrlen(lpszString),&size); SelectObject(hdc,hOldFont); ReleaseDC(hOwner,hdc); iWindowWidth=size.cx+20; if(MdiInfo[WndNum]->pMdiTextEdit==0) return; hTabWnd=(HWND)SendMessage(MdiInfo[WndNum]->pMdiTextEdit->hEdit,WM_SEARCH_TAB_CREATE,(WPARAM)WndNum,(LPARAM)this); } COneTab::~COneTab(){ free(lpszString); int i; for(i=0;i<10;i++){ if(lpszTitle[i]) free(lpszTitle[i]); if(lpszUrl[i]) free(lpszUrl[i]); } if(MdiInfo[m_WndNum]->pMdiTextEdit) SendMessage(MdiInfo[m_WndNum]->pMdiTextEdit->hEdit,WM_SEARCH_TAB_CLOSE,0,(LPARAM)hTabWnd); } void COneTab::WebSearch(){ //URLエンコード char *temporary; temporary=(char *)malloc(lstrlen(lpszString)*3+1024); wsprintf(temporary,"辞書 %s",lpszString); URLEncode(temporary); char *lpszTempUrl; lpszTempUrl=(char *)malloc(lstrlen(temporary)+1024); sprintf(lpszTempUrl,"http://www.activebasic.com/application_web_search/search.php?query=%s&type=web&utf_sw=1&start=1",temporary); free(temporary); HINTERNET hInternet; HINTERNET hNetFile; hInternet = InternetOpen("Agent", 0, NULL, NULL, 0); if(hInternet==0){ return; } hNetFile = InternetOpenUrl(hInternet, lpszTempUrl, NULL, 0, 0, 0); if(hNetFile==0){ InternetCloseHandle(hInternet); return; } /* オープンしたURLからデータを(1000バイトずつ)読み込む */ DWORD dwReadSize; BOOL bResult; char *buffer; buffer=(char *)malloc(8192); buffer[0]=0; while(1){ char temp3[1024]; bResult = InternetReadFile( hNetFile, temp3, 1000, &dwReadSize); /* 全て読み込んだらループを抜ける */ if(bResult && (dwReadSize == 0)) break; temp3[dwReadSize]=0; lstrcat(buffer,temp3); } //UTF-8からShift-JISに変換 char *temp2; temp2=(char *)malloc(8192); nkf.pSetNkfOption("-sx"); //Shift-JISに変換(xは半角カタカナを全角に変換しないオプション) nkf.pNkfConvert(temp2,buffer); free(buffer); InternetCloseHandle(hNetFile); InternetCloseHandle(hInternet); //タイトル・URLを取得 int iItem; int i=0,i2; for(iItem=0;iItem<10;iItem++){ lpszTitle[iItem]=(char *)malloc(lstrlen(temp2)+1); lpszUrl[iItem]=(char *)malloc(lstrlen(temp2)+1); for(i2=0;;i++,i2++){ //タイトル if(temp2[i]=='\n'||temp2[i]=='\0'){ lpszTitle[iItem][i2]=0; break; } lpszTitle[iItem][i2]=temp2[i]; } if(temp2[i]){ //URL for(i++,i2=0;;i++,i2++){ if(temp2[i]=='\n'||temp2[i]=='\0'){ lpszUrl[iItem][i2]=0; break; } lpszUrl[iItem][i2]=temp2[i]; } } if(temp2[i]){ //サマリー for(i++,i2=0;;i++,i2++){ if(temp2[i]=='\n'||temp2[i]=='\0'){ break; } } } if(temp2[i]=='\0') break; i++; } free(temp2); free(lpszTempUrl); } LRESULT CALLBACK WebResultWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){ switch(message){ case WM_COMMAND: break; } return DefWindowProc(hwnd,message,wParam,lParam); } CWebResult::CWebResult(HWND hParent){ ppobj_OneTab=(COneTab **)malloc(1); iTabNum=0; hwnd=CreateWindowEx(0,"WebResult","WebResult", WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE, 0,0,0,0, hParent,0,hInst,0); } CWebResult::~CWebResult(){ int i; for(i=0;ipMdiTextEdit==0){ delete pobj_temp_OneTab; return; } if(pobj_temp_OneTab->lpszTitle[0]){ if(pobj_temp_OneTab->lpszTitle[0][0]=='\0'){ delete pobj_temp_OneTab; return; } } else{ delete pobj_temp_OneTab; return; } ppobj_OneTab=(COneTab **)realloc(ppobj_OneTab,(iTabNum+1)*sizeof(COneTab)); //ローテーション int i; for(i=iTabNum-1;i>=0;i--){ ppobj_OneTab[i+1]=ppobj_OneTab[i]; } ppobj_OneTab[0]=pobj_temp_OneTab; iTabNum++; if(iTabNum==10){ //古いアイテムを破棄 delete ppobj_OneTab[iTabNum-1]; iTabNum--; } int offset=0; for(i=0;iiWindowWidth; } for(i=iTabNum-1;i>=0;i--){ offset-=ppobj_OneTab[i]->iWindowWidth; MoveWindow(ppobj_OneTab[i]->hTabWnd, offset, 0, ppobj_OneTab[i]->iWindowWidth, 20, 1); } } BOOL CWebResult::DuplicateCheck(char *str){ int i; for(i=0;ilpszString,str)==0){ return 1; } } return 0; } BOOL bSearchingWeb; char *lpszRetrySearchStr; void WebSearchThread(void *temp_str){ char *str; str=(char *)malloc(lstrlen((char *)temp_str)+1); lstrcpy(str,(char *)temp_str); HeapDefaultFree(temp_str); int WndNum; WndNum=GetWndNum(GetWindow(hClient,GW_CHILD)); if(bSearchingWeb){ if(lpszRetrySearchStr) free(lpszRetrySearchStr); lpszRetrySearchStr=str; _endthread(); return; } bSearchingWeb=1; wait_repeat: Sleep(500); if(lpszRetrySearchStr){ free(str); str=lpszRetrySearchStr; lpszRetrySearchStr=0; goto wait_repeat; } if(WndNum==-1){ goto exit; } if(MdiInfo[WndNum]->pMdiTextEdit==0){ goto exit; } //重複チェック if(MdiInfo[WndNum]->pMdiTextEdit->pobj_WebResult->DuplicateCheck(str)){ goto exit; } MdiInfo[WndNum]->pMdiTextEdit->pobj_WebResult->add(WndNum,str); exit: bSearchingWeb=0; free(str); if(lpszRetrySearchStr){ str=lpszRetrySearchStr; lpszRetrySearchStr=0; goto wait_repeat; } _endthread(); } //////////////////////////// // 以下、SideWeb //////////////////////////// BEGIN_OBJECT_MAP(ObjectMap) END_OBJECT_MAP() HWND hNowIEWnd; LRESULT CALLBACK SideWebProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) { CComQIPtr pWB2 ; switch (iMsg) { case WM_CREATE : { AtlAxWinInit(); hNowIEWnd = CreateWindow("AtlAxWin", "Shell.Explorer.2", WS_CHILD|WS_VISIBLE, 0,0,0,0, hwnd, (HMENU)0, hInst, NULL); if(!hNowIEWnd){ MessageBox(hOwner,"IEコンポーネントの生成に失敗しました","lockey_browser",MB_OK|MB_ICONEXCLAMATION); PostQuitMessage(0); return 0; } // ActiveXコントロールのインターフェースを要求 CComPtr punkIE; if (AtlAxGetControl(hNowIEWnd, &punkIE) == S_OK) { // IUnknownポインタからIWebBrowser2ポインタへキャスト pWB2 = punkIE; if(pWB2) { // シンクオブジェクトの作成 CComObject* sink; CComObject::CreateInstance(&sink); // イベントをDispatchするよう、IEコントロールにお願い HRESULT hr = sink->AdviseToIE(punkIE); if(SUCCEEDED(hr)) { //成功 return 0; } } MessageBox(hOwner,"IEコンポーネントの生成に失敗しました","ProjectEditor",MB_OK|MB_ICONEXCLAMATION); PostQuitMessage(0); return 0; } return 0 ; } case WM_SIZE : MoveWindow(GetWindow(hwnd,GW_CHILD), 0, 0, LOWORD(lParam), HIWORD(lParam), 1) ; return 0 ; case WM_KEYDOWN: { // ActiveXコントロールのインターフェースを要求 CComPtr punkIE; if (AtlAxGetControl(hNowIEWnd, &punkIE) == S_OK) { // IUnknownポインタからIWebBrowser2ポインタへキャスト pWB2 = punkIE; CComQIPtr pIOIPAO(pWB2) ; if(pIOIPAO) { MSG msg; msg.message = iMsg; msg.wParam = wParam; msg.lParam = lParam; pIOIPAO->TranslateAccelerator(&msg); } return 0 ; } } case WM_BROWS_GO: { // ActiveXコントロールのインターフェースを要求 CComPtr punkIE; if (AtlAxGetControl(hNowIEWnd, &punkIE) == S_OK) { // IUnknownポインタからIWebBrowser2ポインタへキャスト pWB2 = punkIE; // URLへ移動 CComVariant vempty, vUrl((char *)lParam); pWB2->Navigate2 (&vUrl, &vempty, &vempty, &vempty, &vempty ); } } return 0; case WM_BROWS_DESTROY: DestroyWindow(hwnd); return 0; case WM_DESTROY : { // ActiveXコントロールのインターフェースを要求 CComPtr punkIE; if (AtlAxGetControl(hNowIEWnd, &punkIE) == S_OK) { // IUnknownポインタからIWebBrowser2ポインタへキャスト pWB2 = punkIE; pWB2.Release(); } } return 0 ; } return DefWindowProc (hwnd, iMsg, wParam, lParam) ; } CChildSideWeb::CChildSideWeb(HWND hParent,HWND hTab,char *title,char *site){ hwnd=CreateWindowEx(WS_EX_CLIENTEDGE,"SideWeb","SideWeb", WS_CHILD|WS_CLIPCHILDREN, 0,0,0,0, hParent,0,hInst,0); hIEWnd=hNowIEWnd; TC_ITEM tcItem; tcItem.mask=TCIF_TEXT; tcItem.pszText=title; TabCtrl_InsertItem(hTab,SendMessage(hTab,TCM_GETITEMCOUNT,0,0),&tcItem); //タイトル lpszTitle=(char *)malloc(lstrlen(title)+1); lstrcpy(lpszTitle,title); //サイト lpszSite=(char *)malloc(lstrlen(site)+1); lstrcpy(lpszSite,site); } CChildSideWeb::~CChildSideWeb(){ free(lpszTitle); free(lpszSite); DestroyWindow(hwnd); } CSideWeb *pobj_SideWeb=0; CSideWeb::CSideWeb(HWND hParent){ lpszNowUrl=0; bShow=0; /* TODO: ここをしっかりしないと動きませーん extern CComModule _Module; _Module.Init(ObjectMap, hInst); */ //タブを生成 extern HFONT hStatusFont; hTab=CreateWindowEx(0,WC_TABCONTROL,NULL, WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_VISIBLE, 0,0,0,0, hParent,0,hInst,0); SendMessage(hTab,WM_SETFONT,(long)hStatusFont,0); //→ボタンを生成 hRightButton=CreateWindow("BUTTON","→",WS_CHILD|WS_VISIBLE, 0,0,20,13, hParent,(HMENU)IDC_CLIP,hInst,0); SendMessage(hRightButton,WM_SETFONT,(long)hStatusFont,0); iChildSideWebNum=pobj_nv->pobj_DBDomain->iDomainNum+1; ppobj_ChildSideWeb=(CChildSideWeb **)malloc(iChildSideWebNum*sizeof(CChildSideWeb *)); ppobj_ChildSideWeb[0]=new CChildSideWeb(hParent,hTab,"全般",""); int i; for(i=0;ipobj_DBDomain->iDomainNum;i++){ ppobj_ChildSideWeb[i+1]=new CChildSideWeb(hParent,hTab, pobj_nv->pobj_DBDomain->ppobj_Domain[i]->lpszName, pobj_nv->pobj_DBDomain->ppobj_Domain[i]->lpszDomain); } TabCtrl_SetCurSel(hTab,0); ShowWindow(ppobj_ChildSideWeb[0]->hwnd,SW_SHOW); hNowIEWnd=ppobj_ChildSideWeb[0]->hIEWnd; } CSideWeb::~CSideWeb(){ int i; for(i=0;ihwnd,x,y+iTabHeight,cx,cy-iTabHeight,1); } m_Rect.left=x; m_Rect.top=y; m_Rect.right=x+cx; m_Rect.bottom=y+cy; } void CSideWeb::GoPage(char *lpszUrl){ char *pTemp; pTemp=(char *)malloc(lstrlen(lpszUrl)+1); lstrcpy(pTemp,lpszUrl); if(lpszNowUrl) free(lpszNowUrl); lpszNowUrl=pTemp; int iTabPos; iTabPos=SendMessage(hTab,TCM_GETCURSEL,0,0); pTemp=(char *)malloc(lstrlen(lpszNowUrl)+1024); if(ppobj_ChildSideWeb[iTabPos]->lpszSite[0]) sprintf(pTemp,"%s&site=%s",lpszNowUrl,ppobj_ChildSideWeb[iTabPos]->lpszSite); else lstrcpy(pTemp,lpszNowUrl); SendMessage(ppobj_ChildSideWeb[iTabPos]->hwnd,WM_BROWS_GO,0,(LPARAM)pTemp); free(pTemp); bShow=1; ActiveBasic::IDE::Program::mainFrame.Resized(); } void CSideWeb::SelChangeEvent(){ char temporary[MAX_PATH]; int i; i=TabCtrl_GetCurSel(hTab); TC_ITEM tcItem; tcItem.mask=TCIF_TEXT; tcItem.pszText=temporary; tcItem.cchTextMax=MAX_PATH; TabCtrl_GetItem(hTab,i,&tcItem); for(i=0;ihwnd,SW_HIDE); } for(i=0;ilpszTitle)==0){ ShowWindow(ppobj_ChildSideWeb[i]->hwnd,SW_SHOW); hNowIEWnd=ppobj_ChildSideWeb[i]->hIEWnd; GoPage(lpszNowUrl); break; } } } void CSideWeb::GetRect(RECT *prc){ *prc=m_Rect; } CWebStrings obj_WebStrings; CWebStrings::CWebStrings(){ buffer=(char *)malloc(1); buffer[0]=0; ppStr=(char **)malloc(1); iStrNum=0; } CWebStrings::~CWebStrings(){ free(buffer); int i; for(i=0;ilpszName,ppobj_Domain[i]->lpszDomain); } WriteBuffer(temporary,buffer,lstrlen(buffer)); HeapDefaultFree(buffer); } void CDBDomain::copy_get(CDBDomain *pobj_DBDomain){ init(); int i; for(i=0;iiDomainNum;i++){ add(pobj_DBDomain->ppobj_Domain[i]->lpszName,pobj_DBDomain->ppobj_Domain[i]->lpszDomain); } } void CDBDomain::SetListView(HWND hListView){ m_hListView=hListView; int i; for(i=0;ilpszName; item.iItem=i; item.iSubItem=0; ListView_InsertItem(m_hListView,&item); item.pszText=ppobj_Domain[i]->lpszDomain; item.iItem=i; item.iSubItem++; ListView_SetItem(m_hListView,&item); } } void CDBDomain::add(char *name,char *domain){ ppobj_Domain=(CDomain **)HeapReAlloc(hHeap,0,ppobj_Domain,(iDomainNum+1)*sizeof(CDomain *)); ppobj_Domain[iDomainNum]=new CDomain(name,domain); iDomainNum++; if(m_hListView){ int i; i=ListView_GetItemCount(m_hListView); //リストビューに追加 LV_ITEM item; item.mask=LVIF_TEXT; item.pszText=name; item.iItem=i; item.iSubItem=0; ListView_InsertItem(m_hListView,&item); item.pszText=domain; item.iItem=i; item.iSubItem++; ListView_SetItem(m_hListView,&item); } } void CDBDomain::del(char *name){ int i; for(i=0;ilpszName,name)==0) break; } if(i==iDomainNum) return; if(m_hListView){ //リストビューから削除 ListView_DeleteItem(m_hListView,i); } delete ppobj_Domain[i]; iDomainNum--; for(;ilpszName,szBeforeName)==0) break; } if(i==iDomainNum) return; ppobj_Domain[i]->lpszName=(char *)HeapReAlloc(hHeap,0,ppobj_Domain[i]->lpszName,lstrlen(name)+1); lstrcpy(ppobj_Domain[i]->lpszName,name); ppobj_Domain[i]->lpszDomain=(char *)HeapReAlloc(hHeap,0,ppobj_Domain[i]->lpszDomain,lstrlen(domain)+1); lstrcpy(ppobj_Domain[i]->lpszDomain,domain); if(m_hListView){ //リストビューの設定 ListView_SetItemText(m_hListView,i,0,name); ListView_SetItemText(m_hListView,i,1,domain); } }