|
|
|
@ -66,6 +66,33 @@ kmeleonPlugin kPlugin = {
|
|
|
|
|
DoMessage |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
void Setup() |
|
|
|
|
{ |
|
|
|
|
HBITMAP bitmap; |
|
|
|
|
int ilc_bits = ILC_COLOR; |
|
|
|
|
|
|
|
|
|
wchar_t szFullPath[MAX_PATH]; |
|
|
|
|
kPlugin.kFuncs->FindSkinFile(L"favorites.bmp", szFullPath, MAX_PATH); |
|
|
|
|
FILE *fp = _tfopen(szFullPath, _T("r")); |
|
|
|
|
if (fp) { |
|
|
|
|
fclose(fp); |
|
|
|
|
bitmap = (HBITMAP)LoadImage(NULL, szFullPath, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); |
|
|
|
|
} else { |
|
|
|
|
bitmap = LoadBitmap(kPlugin.hDllInstance, MAKEINTRESOURCE(IDB_IMAGES)); |
|
|
|
|
ilc_bits = ILC_COLOR24; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
BITMAP bmp; |
|
|
|
|
GetObject(bitmap, sizeof(BITMAP), &bmp); |
|
|
|
|
|
|
|
|
|
ilc_bits = (bmp.bmBitsPixel == 32 ? ILC_COLOR32 : (bmp.bmBitsPixel == 24 ? ILC_COLOR24 : (bmp.bmBitsPixel == 16 ? ILC_COLOR16 : (bmp.bmBitsPixel == 8 ? ILC_COLOR8 : (bmp.bmBitsPixel == 4 ? ILC_COLOR4 : ILC_COLOR))))); |
|
|
|
|
gImagelist = ImageList_Create(bmp.bmWidth/6, bmp.bmHeight, ILC_MASK | ilc_bits, 4, 4); |
|
|
|
|
if (gImagelist && bitmap) |
|
|
|
|
ImageList_AddMasked(gImagelist, bitmap, RGB(255, 0, 255)); |
|
|
|
|
if (bitmap) |
|
|
|
|
DeleteObject(bitmap); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
long DoMessage(const char *to, const char *from, const char *subject, long data1, long data2) |
|
|
|
|
{ |
|
|
|
|
if (to[0] == '*' || stricmp(to, kPlugin.dllname) == 0) { |
|
|
|
@ -103,6 +130,9 @@ long DoMessage(const char *to, const char *from, const char *subject, long data1
|
|
|
|
|
if (gLoc) delete gLoc; |
|
|
|
|
gLoc = Locale::kmInit(&kPlugin); |
|
|
|
|
} |
|
|
|
|
else if (stricmp(subject, "Setup") == 0) { |
|
|
|
|
Setup(); |
|
|
|
|
} |
|
|
|
|
else return 0; |
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
@ -110,10 +140,6 @@ long DoMessage(const char *to, const char *from, const char *subject, long data1
|
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "../findskin.cpp" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int Load(){ |
|
|
|
|
gLoc = Locale::kmInit(&kPlugin); |
|
|
|
|
HDC hdcScreen = CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
|
|
|
|
@ -169,30 +195,6 @@ int Load(){
|
|
|
|
|
bTitleSet = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
HBITMAP bitmap; |
|
|
|
|
int ilc_bits = ILC_COLOR; |
|
|
|
|
|
|
|
|
|
TCHAR szFullPath[MAX_PATH]; |
|
|
|
|
FindSkinFile(szFullPath, _T("favorites.bmp")); |
|
|
|
|
FILE *fp = _tfopen(szFullPath, _T("r")); |
|
|
|
|
if (fp) { |
|
|
|
|
fclose(fp); |
|
|
|
|
bitmap = (HBITMAP)LoadImage(NULL, szFullPath, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); |
|
|
|
|
} else { |
|
|
|
|
bitmap = LoadBitmap(kPlugin.hDllInstance, MAKEINTRESOURCE(IDB_IMAGES)); |
|
|
|
|
ilc_bits = ILC_COLOR24; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
BITMAP bmp; |
|
|
|
|
GetObject(bitmap, sizeof(BITMAP), &bmp); |
|
|
|
|
|
|
|
|
|
ilc_bits = (bmp.bmBitsPixel == 32 ? ILC_COLOR32 : (bmp.bmBitsPixel == 24 ? ILC_COLOR24 : (bmp.bmBitsPixel == 16 ? ILC_COLOR16 : (bmp.bmBitsPixel == 8 ? ILC_COLOR8 : (bmp.bmBitsPixel == 4 ? ILC_COLOR4 : ILC_COLOR))))); |
|
|
|
|
gImagelist = ImageList_Create(bmp.bmWidth/6, bmp.bmHeight, ILC_MASK | ilc_bits, 4, 4); |
|
|
|
|
if (gImagelist && bitmap) |
|
|
|
|
ImageList_AddMasked(gImagelist, bitmap, RGB(255, 0, 255)); |
|
|
|
|
if (bitmap) |
|
|
|
|
DeleteObject(bitmap); |
|
|
|
|
|
|
|
|
|
ReadFavorites(gFavoritesPath, _T(""), gFavoritesRoot); |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
@ -523,7 +525,7 @@ void DoRebar(HWND rebarWnd){
|
|
|
|
|
// Register the band name and child hwnd
|
|
|
|
|
if (bTitleSet && szTitle[0] != 0) { |
|
|
|
|
int len = _tcslen(szTitle); |
|
|
|
|
char c = szTitle[len-1]; |
|
|
|
|
TCHAR c = szTitle[len-1]; |
|
|
|
|
if (c == ':') |
|
|
|
|
szTitle[len-1] = 0; |
|
|
|
|
kPlugin.kFuncs->RegisterBand(hWndTB, (char*)(const char*)CT_to_UTF8(szTitle), TRUE); |
|
|
|
|