1,184
社区成员
发帖
与我相关
我的任务
分享function CC_Plugininit(CCVersion:PAnsiChar;CChWnd:HWND;hInst:Cardinal;var CplhWnd:HWND;var CplhIcon:HICON;shortname:PAnsiChar):UINT;stdcall;
begin
hWndMain := CChWnd;
Form1 := TForm1.CreateParented(CChWnd);
//Form1 := TForm1.Create(nil);
CplhWnd := Form1.Handle;
CplhIcon := LoadIcon(HInstance,'MYICON');
lstrcpy(shortname,'我是Delphi');
CC_InitFunction(hInst);
CC_Addtolist('我是Delphi',RGB(255,0,0));
Result := 1;
end;
HWND CplhWnd = NULL;
HICON CplhIcon = NULL;
char szTabCaption[32] = {0};
pPluginInfo.CC_Plugininit("2.6",hWndMain,hInst,CplhWnd,CplhIcon,szTabCaption);
if (CplhWnd != NULL && IsWindow(CplhWnd))
{
pPluginInfo.hPluginWnd = CplhWnd;
TCITEM tie;
int nIcon = -1;
if (CplhIcon != NULL)
{
nIcon = ImageList_AddIcon(hImageList,CplhIcon);
}
tie.mask = TCIF_TEXT|TCIF_IMAGE|TCIF_PARAM;
tie.iImage = nIcon;
tie.pszText = (LPSTR)szTabCaption;
tie.lParam = nPos;
TabCtrl_InsertItem(hWndTabCtrl,nPos,&tie);
//SetWindowLong(CplhWnd,GWL_STYLE,WS_CHILDWINDOW|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN);
SetParent(CplhWnd,hWndTabCtrl);
RECT rc;
GetClientRect(hWndTabCtrl,&rc);
rc.right -= 4;
rc.left += 1;
rc.top += 22;
rc.bottom -= 24;
MoveWindow(CplhWnd,rc.left,rc.top,rc.right,rc.bottom,TRUE);
//SetWindowPos(CplhWnd,HWND_TOP,rc.left,rc.top,0,0,SWP_NOSIZE);
ShowWindow(CplhWnd,SW_SHOW);
}