From e58823d961a630eb62e60d2ccb443761ba5f1704 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 14 Jun 2012 15:51:34 +0000 Subject: - all MS_CLIST_ADD*ITEM services replaced with Menu_Add*Item stubs. - massive cleanup of the menu-related code git-svn-id: http://svn.miranda-ng.org/main/trunk@410 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/utils/bmpfilter.cpp | 108 +++---- src/modules/utils/colourpicker.cpp | 50 ++-- src/modules/utils/hyperlink.cpp | 82 +++--- src/modules/utils/imgconv.cpp | 2 +- src/modules/utils/md5.cpp | 26 +- src/modules/utils/openurl.cpp | 82 +++--- src/modules/utils/path.cpp | 14 +- src/modules/utils/resizer.cpp | 18 +- src/modules/utils/sha1.cpp | 16 +- src/modules/utils/timeutils.cpp | 12 +- src/modules/utils/timezones.cpp | 4 +- src/modules/utils/utf.cpp | 20 +- src/modules/utils/utils.cpp | 568 ++++++++++++++++++------------------- src/modules/utils/windowlist.cpp | 32 +-- 14 files changed, 517 insertions(+), 517 deletions(-) (limited to 'src/modules/utils') diff --git a/src/modules/utils/bmpfilter.cpp b/src/modules/utils/bmpfilter.cpp index 1ea930baf9..5dbf37b12f 100644 --- a/src/modules/utils/bmpfilter.cpp +++ b/src/modules/utils/bmpfilter.cpp @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -29,10 +29,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static INT_PTR sttBitmapLoader( const TCHAR* ptszFileName ) { IPicture *pic; - HBITMAP hBmp,hBmpCopy; + HBITMAP hBmp, hBmpCopy; HBITMAP hOldBitmap, hOldBitmap2; BITMAP bmpInfo; - HDC hdc,hdcMem1,hdcMem2; + HDC hdc, hdcMem1, hdcMem2; short picType; TCHAR szFilename[MAX_PATH]; @@ -103,21 +103,21 @@ static INT_PTR sttBitmapLoader( const TCHAR* ptszFileName ) OLE_HANDLE hOleBmp; pic->get_Handle(&hOleBmp); hBmp = (HBITMAP)hOleBmp; - GetObject(hBmp,sizeof(bmpInfo),&bmpInfo); + GetObject(hBmp, sizeof(bmpInfo), &bmpInfo); //need to copy bitmap so we can free the IPicture hdc=GetDC(NULL); hdcMem1=CreateCompatibleDC(hdc); hdcMem2=CreateCompatibleDC(hdc); - hOldBitmap=( HBITMAP )SelectObject(hdcMem1,hBmp); - hBmpCopy=CreateCompatibleBitmap(hdcMem1,bmpInfo.bmWidth,bmpInfo.bmHeight); - hOldBitmap2=( HBITMAP )SelectObject(hdcMem2,hBmpCopy); - BitBlt(hdcMem2,0,0,bmpInfo.bmWidth,bmpInfo.bmHeight,hdcMem1,0,0,SRCCOPY); - SelectObject(hdcMem1,hOldBitmap); - SelectObject(hdcMem2,hOldBitmap2); + hOldBitmap=( HBITMAP )SelectObject(hdcMem1, hBmp); + hBmpCopy=CreateCompatibleBitmap(hdcMem1, bmpInfo.bmWidth, bmpInfo.bmHeight); + hOldBitmap2=( HBITMAP )SelectObject(hdcMem2, hBmpCopy); + BitBlt(hdcMem2, 0, 0, bmpInfo.bmWidth, bmpInfo.bmHeight, hdcMem1, 0, 0, SRCCOPY); + SelectObject(hdcMem1, hOldBitmap); + SelectObject(hdcMem2, hOldBitmap2); DeleteDC(hdcMem2); DeleteDC(hdcMem1); - ReleaseDC(NULL,hdc); + ReleaseDC(NULL, hdc); DeleteObject(hBmp); pic->Release(); @@ -138,45 +138,45 @@ static INT_PTR BmpFilterLoadBitmapW(WPARAM, LPARAM lParam) /////////////////////////////////////////////////////////////////////////////////////////////////// -static INT_PTR BmpFilterGetStrings(WPARAM wParam,LPARAM lParam) +static INT_PTR BmpFilterGetStrings(WPARAM wParam, LPARAM lParam) { int bytesLeft=wParam; - char *filter=(char*)lParam,*pfilter; + char *filter=(char*)lParam, *pfilter; - lstrcpynA(filter,Translate("All Bitmaps"),bytesLeft); bytesLeft-=lstrlenA(filter); - strncat(filter," (*.bmp;*.jpg;*.gif;*.png)",bytesLeft); + lstrcpynA(filter, Translate("All Bitmaps"), bytesLeft); bytesLeft-=lstrlenA(filter); + strncat(filter, " (*.bmp;*.jpg;*.gif;*.png)", bytesLeft); pfilter=filter+lstrlenA(filter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpynA(pfilter,"*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG",bytesLeft); + lstrcpynA(pfilter, "*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG", bytesLeft); pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpynA(pfilter,Translate("Windows Bitmaps"),bytesLeft); bytesLeft-=lstrlenA(pfilter); - strncat(pfilter," (*.bmp;*.rle)",bytesLeft); + lstrcpynA(pfilter, Translate("Windows Bitmaps"), bytesLeft); bytesLeft-=lstrlenA(pfilter); + strncat(pfilter, " (*.bmp;*.rle)", bytesLeft); pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpynA(pfilter,"*.BMP;*.RLE",bytesLeft); + lstrcpynA(pfilter, "*.BMP;*.RLE", bytesLeft); pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpynA(pfilter,Translate("JPEG Bitmaps"),bytesLeft); bytesLeft-=lstrlenA(pfilter); - strncat(pfilter," (*.jpg;*.jpeg)",bytesLeft); + lstrcpynA(pfilter, Translate("JPEG Bitmaps"), bytesLeft); bytesLeft-=lstrlenA(pfilter); + strncat(pfilter, " (*.jpg;*.jpeg)", bytesLeft); pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpynA(pfilter,"*.JPG;*.JPEG",bytesLeft); + lstrcpynA(pfilter, "*.JPG;*.JPEG", bytesLeft); pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpynA(pfilter,Translate("GIF Bitmaps"),bytesLeft); bytesLeft-=lstrlenA(pfilter); - strncat(pfilter," (*.gif)",bytesLeft); + lstrcpynA(pfilter, Translate("GIF Bitmaps"), bytesLeft); bytesLeft-=lstrlenA(pfilter); + strncat(pfilter, " (*.gif)", bytesLeft); pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpynA(pfilter,"*.GIF",bytesLeft); + lstrcpynA(pfilter, "*.GIF", bytesLeft); pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpynA(pfilter,Translate("PNG Bitmaps"),bytesLeft); bytesLeft-=lstrlenA(pfilter); - strncat(pfilter," (*.png)",bytesLeft); + lstrcpynA(pfilter, Translate("PNG Bitmaps"), bytesLeft); bytesLeft-=lstrlenA(pfilter); + strncat(pfilter, " (*.png)", bytesLeft); pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpynA(pfilter,"*.PNG",bytesLeft); + lstrcpynA(pfilter, "*.PNG", bytesLeft); pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpynA(pfilter,Translate("All Files"),bytesLeft); bytesLeft-=lstrlenA(pfilter); - strncat(pfilter," (*)",bytesLeft); + lstrcpynA(pfilter, Translate("All Files"), bytesLeft); bytesLeft-=lstrlenA(pfilter); + strncat(pfilter, " (*)", bytesLeft); pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpynA(pfilter,"*",bytesLeft); + lstrcpynA(pfilter, "*", bytesLeft); pfilter+=lstrlenA(pfilter)+1; bytesLeft=wParam-(pfilter-filter); if (bytesLeft) *pfilter='\0'; @@ -184,45 +184,45 @@ static INT_PTR BmpFilterGetStrings(WPARAM wParam,LPARAM lParam) } #if defined( _UNICODE ) -static INT_PTR BmpFilterGetStringsW(WPARAM wParam,LPARAM lParam) +static INT_PTR BmpFilterGetStringsW(WPARAM wParam, LPARAM lParam) { int bytesLeft=wParam; - TCHAR *filter=(TCHAR*)lParam,*pfilter; + TCHAR *filter=(TCHAR*)lParam, *pfilter; - lstrcpyn(filter,TranslateT("All Bitmaps"),bytesLeft); bytesLeft-=lstrlen(filter); + lstrcpyn(filter, TranslateT("All Bitmaps"), bytesLeft); bytesLeft-=lstrlen(filter); _tcsncat(filter, _T(" (*.bmp;*.jpg;*.gif;*.png)"), bytesLeft ); pfilter=filter+lstrlen(filter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpyn(pfilter,_T("*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG"),bytesLeft); + lstrcpyn(pfilter, _T("*.BMP;*.RLE;*.JPG;*.JPEG;*.GIF;*.PNG"), bytesLeft); pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpyn(pfilter,TranslateT("Windows Bitmaps"),bytesLeft); bytesLeft-=lstrlen(pfilter); - _tcsncat(pfilter,_T(" (*.bmp;*.rle)"),bytesLeft); + lstrcpyn(pfilter, TranslateT("Windows Bitmaps"), bytesLeft); bytesLeft-=lstrlen(pfilter); + _tcsncat(pfilter, _T(" (*.bmp;*.rle)"), bytesLeft); pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpyn(pfilter,_T("*.BMP;*.RLE"),bytesLeft); + lstrcpyn(pfilter, _T("*.BMP;*.RLE"), bytesLeft); pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpyn(pfilter,TranslateT("JPEG Bitmaps"),bytesLeft); bytesLeft-=lstrlen(pfilter); - _tcsncat(pfilter,_T(" (*.jpg;*.jpeg)"),bytesLeft); + lstrcpyn(pfilter, TranslateT("JPEG Bitmaps"), bytesLeft); bytesLeft-=lstrlen(pfilter); + _tcsncat(pfilter, _T(" (*.jpg;*.jpeg)"), bytesLeft); pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpyn(pfilter,_T("*.JPG;*.JPEG"),bytesLeft); + lstrcpyn(pfilter, _T("*.JPG;*.JPEG"), bytesLeft); pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpyn(pfilter,TranslateT("GIF Bitmaps"),bytesLeft); bytesLeft-=lstrlen(pfilter); - _tcsncat(pfilter,_T(" (*.gif)"),bytesLeft); + lstrcpyn(pfilter, TranslateT("GIF Bitmaps"), bytesLeft); bytesLeft-=lstrlen(pfilter); + _tcsncat(pfilter, _T(" (*.gif)"), bytesLeft); pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpyn(pfilter,_T("*.GIF"),bytesLeft); + lstrcpyn(pfilter, _T("*.GIF"), bytesLeft); pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpyn(pfilter,TranslateT("PNG Bitmaps"),bytesLeft); bytesLeft-=lstrlen(pfilter); - _tcsncat(pfilter,_T(" (*.png)"),bytesLeft); + lstrcpyn(pfilter, TranslateT("PNG Bitmaps"), bytesLeft); bytesLeft-=lstrlen(pfilter); + _tcsncat(pfilter, _T(" (*.png)"), bytesLeft); pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpyn(pfilter,_T("*.PNG"),bytesLeft); + lstrcpyn(pfilter, _T("*.PNG"), bytesLeft); pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpyn(pfilter,TranslateT("All Files"),bytesLeft); bytesLeft-=lstrlen(pfilter); - _tcsncat(pfilter,_T(" (*)"),bytesLeft); + lstrcpyn(pfilter, TranslateT("All Files"), bytesLeft); bytesLeft-=lstrlen(pfilter); + _tcsncat(pfilter, _T(" (*)"), bytesLeft); pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter); - lstrcpyn(pfilter,_T("*"),bytesLeft); + lstrcpyn(pfilter, _T("*"), bytesLeft); pfilter+=lstrlen(pfilter)+1; bytesLeft=wParam-(pfilter-filter); if (bytesLeft) *pfilter='\0'; @@ -232,11 +232,11 @@ static INT_PTR BmpFilterGetStringsW(WPARAM wParam,LPARAM lParam) int InitBitmapFilter(void) { - CreateServiceFunction(MS_UTILS_LOADBITMAP,BmpFilterLoadBitmap); - CreateServiceFunction(MS_UTILS_GETBITMAPFILTERSTRINGS,BmpFilterGetStrings); + CreateServiceFunction(MS_UTILS_LOADBITMAP, BmpFilterLoadBitmap); + CreateServiceFunction(MS_UTILS_GETBITMAPFILTERSTRINGS, BmpFilterGetStrings); #if defined( _UNICODE ) - CreateServiceFunction(MS_UTILS_GETBITMAPFILTERSTRINGSW,BmpFilterGetStringsW); - CreateServiceFunction(MS_UTILS_LOADBITMAPW,BmpFilterLoadBitmapW); + CreateServiceFunction(MS_UTILS_GETBITMAPFILTERSTRINGSW, BmpFilterGetStringsW); + CreateServiceFunction(MS_UTILS_LOADBITMAPW, BmpFilterLoadBitmapW); #endif return 0; } diff --git a/src/modules/utils/colourpicker.cpp b/src/modules/utils/colourpicker.cpp index 29d25a175f..731f61f1e1 100644 --- a/src/modules/utils/colourpicker.cpp +++ b/src/modules/utils/colourpicker.cpp @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -22,44 +22,44 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "..\..\core\commonheaders.h" -static LRESULT CALLBACK ColourPickerWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam) +static LRESULT CALLBACK ColourPickerWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch(message) { case WM_CREATE: - SetWindowLongPtr(hwnd,0,0); - SetWindowLongPtr(hwnd,sizeof(COLORREF),0); + SetWindowLongPtr(hwnd, 0, 0); + SetWindowLongPtr(hwnd, sizeof(COLORREF), 0); break; case CPM_SETDEFAULTCOLOUR: - SetWindowLongPtr(hwnd,sizeof(COLORREF),lParam); + SetWindowLongPtr(hwnd, sizeof(COLORREF), lParam); break; case CPM_GETDEFAULTCOLOUR: - return GetWindowLongPtr(hwnd,sizeof(COLORREF)); + return GetWindowLongPtr(hwnd, sizeof(COLORREF)); case CPM_SETCOLOUR: - SetWindowLongPtr(hwnd,0,lParam); - InvalidateRect(hwnd,NULL,FALSE); + SetWindowLongPtr(hwnd, 0, lParam); + InvalidateRect(hwnd, NULL, FALSE); break; case CPM_GETCOLOUR: - return GetWindowLongPtr(hwnd,0); + return GetWindowLongPtr(hwnd, 0); case WM_LBUTTONUP: { CHOOSECOLOR cc={0}; COLORREF custColours[16]={0}; - custColours[0]=GetWindowLongPtr(hwnd,sizeof(COLORREF)); + custColours[0]=GetWindowLongPtr(hwnd, sizeof(COLORREF)); cc.lStructSize=sizeof(CHOOSECOLOR); cc.hwndOwner=hwnd; cc.hInstance=(HWND)hMirandaInst; - cc.rgbResult=GetWindowLongPtr(hwnd,0); + cc.rgbResult=GetWindowLongPtr(hwnd, 0); cc.lpCustColors=custColours; cc.Flags=CC_ANYCOLOR|CC_FULLOPEN|CC_RGBINIT; if (ChooseColor(&cc)) { - SetWindowLongPtr(hwnd,0,cc.rgbResult); - SendMessage(GetParent(hwnd),WM_COMMAND,MAKEWPARAM(GetDlgCtrlID(hwnd),CPN_COLOURCHANGED),(LPARAM)hwnd); - InvalidateRect(hwnd,NULL,FALSE); + SetWindowLongPtr(hwnd, 0, cc.rgbResult); + SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), CPN_COLOURCHANGED), (LPARAM)hwnd); + InvalidateRect(hwnd, NULL, FALSE); } break; } case WM_ENABLE: - InvalidateRect(hwnd,NULL,FALSE); + InvalidateRect(hwnd, NULL, FALSE); break; case WM_NCPAINT: case WM_PAINT: @@ -68,24 +68,24 @@ static LRESULT CALLBACK ColourPickerWndProc(HWND hwnd,UINT message,WPARAM wParam RECT rc; HBRUSH hBrush; - hdc1=BeginPaint(hwnd,&ps); - GetClientRect(hwnd,&rc); - DrawEdge(hdc1,&rc,EDGE_ETCHED,BF_RECT); - InflateRect(&rc,-2,-2); + hdc1=BeginPaint(hwnd, &ps); + GetClientRect(hwnd, &rc); + DrawEdge(hdc1, &rc, EDGE_ETCHED, BF_RECT); + InflateRect(&rc, -2, -2); if (IsWindowEnabled(hwnd)) - hBrush=CreateSolidBrush(GetWindowLongPtr(hwnd,0)); + hBrush=CreateSolidBrush(GetWindowLongPtr(hwnd, 0)); else - hBrush=CreateHatchBrush(HS_BDIAGONAL,GetSysColor(COLOR_GRAYTEXT)); - SetBkColor(hdc1,GetSysColor(COLOR_BTNFACE)); - FillRect(hdc1,&rc,hBrush); + hBrush=CreateHatchBrush(HS_BDIAGONAL, GetSysColor(COLOR_GRAYTEXT)); + SetBkColor(hdc1, GetSysColor(COLOR_BTNFACE)); + FillRect(hdc1, &rc, hBrush); DeleteObject(hBrush); - EndPaint(hwnd,&ps); + EndPaint(hwnd, &ps); break; } case WM_DESTROY: break; } - return DefWindowProc(hwnd,message,wParam,lParam); + return DefWindowProc(hwnd, message, wParam, lParam); } int InitColourPicker(void) diff --git a/src/modules/utils/hyperlink.cpp b/src/modules/utils/hyperlink.cpp index 8100fe1f48..bde00a35ef 100644 --- a/src/modules/utils/hyperlink.cpp +++ b/src/modules/utils/hyperlink.cpp @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "..\..\core\commonheaders.h" struct HyperlinkWndData { - HFONT hEnableFont,hDisableFont; + HFONT hEnableFont, hDisableFont; RECT rcText; COLORREF enableColor, disableColor, focusColor; BYTE flags; /* see HLKF_* */ @@ -37,18 +37,18 @@ struct HyperlinkWndData { #define HLK_MEASURETEXT (WM_USER+1) #define HLK_INVALIDATE (WM_USER+2) -static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) +static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - struct HyperlinkWndData *dat=(struct HyperlinkWndData*)GetWindowLongPtr(hwnd,0); + struct HyperlinkWndData *dat=(struct HyperlinkWndData*)GetWindowLongPtr(hwnd, 0); switch(msg) { case WM_NCCREATE: dat=(struct HyperlinkWndData*)mir_calloc(sizeof(struct HyperlinkWndData)); if (dat == NULL) return FALSE; /* fail creation */ - SetWindowLongPtr(hwnd,0,(LONG_PTR)dat); /* always succeeds */ + SetWindowLongPtr(hwnd, 0, (LONG_PTR)dat); /* always succeeds */ /* fall thru */ case WM_SYSCOLORCHANGE: if (!(dat->flags&HLKF_HASENABLECOLOR)) { - if (GetSysColorBrush(COLOR_HOTLIGHT) == NULL) dat->enableColor=RGB(0,0,255); + if (GetSysColorBrush(COLOR_HOTLIGHT) == NULL) dat->enableColor=RGB(0, 0, 255); else dat->enableColor=GetSysColor(COLOR_HOTLIGHT); dat->focusColor = RGB(GetRValue(dat->enableColor) / 2, GetGValue(dat->enableColor) / 2, GetBValue(dat->enableColor) / 2); } @@ -92,7 +92,7 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM { case VK_SPACE: case VK_RETURN: - SendMessage(GetParent(hwnd),WM_COMMAND,MAKEWPARAM(GetDlgCtrlID(hwnd),STN_CLICKED),(LPARAM)hwnd); + SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), STN_CLICKED), (LPARAM)hwnd); break; } return 0; @@ -100,9 +100,9 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM case WM_LBUTTONDOWN: { POINT pt; - POINTSTOPOINT(pt,MAKEPOINTS(lParam)); - if (!PtInRect(&dat->rcText,pt)) break; - SendMessage(GetParent(hwnd),WM_COMMAND,MAKEWPARAM(GetDlgCtrlID(hwnd),STN_CLICKED),(LPARAM)hwnd); + POINTSTOPOINT(pt, MAKEPOINTS(lParam)); + if (!PtInRect(&dat->rcText, pt)) break; + SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), STN_CLICKED), (LPARAM)hwnd); return 0; } case WM_SETFONT: @@ -112,14 +112,14 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM dat->hEnableFont=dat->hDisableFont=NULL; return 0; } - if (GetObject((HFONT)wParam,sizeof(lf),&lf)) { + if (GetObject((HFONT)wParam, sizeof(lf), &lf)) { lf.lfUnderline=1; hFont=CreateFontIndirect(&lf); if (hFont != NULL) { dat->hEnableFont=hFont; dat->hDisableFont=(HFONT)wParam; - if (LOWORD(lParam)) SendMessage(hwnd,HLK_INVALIDATE,0,0); - SendMessage(hwnd,HLK_MEASURETEXT,0,0); + if (LOWORD(lParam)) SendMessage(hwnd, HLK_INVALIDATE, 0, 0); + SendMessage(hwnd, HLK_MEASURETEXT, 0, 0); } } return 0; @@ -131,17 +131,17 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM { RECT rcWnd; POINT pt; HWND hwndParent; - if (!GetWindowRect(hwnd,&rcWnd)) break; + if (!GetWindowRect(hwnd, &rcWnd)) break; pt.x=rcWnd.left; pt.y=rcWnd.top; hwndParent=GetParent(hwnd); if (hwndParent == NULL) hwndParent=hwnd; - if (!ScreenToClient(hwndParent,&pt)) break; + if (!ScreenToClient(hwndParent, &pt)) break; rcWnd.right=pt.x+(rcWnd.right-rcWnd.left); rcWnd.bottom=pt.y+(rcWnd.bottom-rcWnd.top); rcWnd.left=pt.x; rcWnd.top=pt.y; - InvalidateRect(hwndParent,&rcWnd,TRUE); + InvalidateRect(hwndParent, &rcWnd, TRUE); return 0; } case WM_GETFONT: @@ -149,7 +149,7 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM case WM_CREATE: case HLK_MEASURETEXT: { TCHAR szText[256]; - if (!GetWindowText(hwnd,szText,SIZEOF(szText))) return 0; + if (!GetWindowText(hwnd, szText, SIZEOF(szText))) return 0; lParam=(LPARAM)szText; /* fall thru */ case WM_SETTEXT: @@ -161,35 +161,35 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM BOOL fMeasured=FALSE; hdc=GetDC(hwnd); if (hdc == NULL) return 0; /* text change failed */ - if (dat->hEnableFont != NULL) hPrevFont=(HFONT)SelectObject(hdc,dat->hEnableFont); + if (dat->hEnableFont != NULL) hPrevFont=(HFONT)SelectObject(hdc, dat->hEnableFont); if (dat->hEnableFont == NULL || hPrevFont != NULL) /* select failed? */ - if (GetTextExtentPoint32(hdc,(TCHAR*)lParam,lstrlen((TCHAR*)lParam),&textSize)) - if (GetClientRect(hwnd,&rc)) { + if (GetTextExtentPoint32(hdc, (TCHAR*)lParam, lstrlen((TCHAR*)lParam), &textSize)) + if (GetClientRect(hwnd, &rc)) { dat->rcText.top=0; dat->rcText.bottom=dat->rcText.top+textSize.cy; - style=GetWindowLongPtr(hwnd,GWL_STYLE); + style=GetWindowLongPtr(hwnd, GWL_STYLE); if (style&SS_CENTER) dat->rcText.left=(rc.right-textSize.cx)/2; else if (style&SS_RIGHT) dat->rcText.left=rc.right-textSize.cx; else dat->rcText.left=0; dat->rcText.right=dat->rcText.left+textSize.cx; fMeasured=TRUE; } - if (dat->hEnableFont != NULL && hPrevFont != NULL) SelectObject(hdc,hPrevFont); - ReleaseDC(hwnd,hdc); + if (dat->hEnableFont != NULL && hPrevFont != NULL) SelectObject(hdc, hPrevFont); + ReleaseDC(hwnd, hdc); if (!fMeasured) return 0; /* text change failed */ - SendMessage(hwnd,HLK_INVALIDATE,0,0); + SendMessage(hwnd, HLK_INVALIDATE, 0, 0); break; }} case WM_SETCURSOR: { POINT pt; HCURSOR hCursor; if (!GetCursorPos(&pt)) return FALSE; - if (!ScreenToClient(hwnd,&pt)) return FALSE; - if (PtInRect(&dat->rcText,pt)) { - hCursor=(HCURSOR)GetClassLongPtr(hwnd,GCLP_HCURSOR); - if (hCursor == NULL) hCursor=LoadCursor(NULL,IDC_HAND); /* Win2000+ */ + if (!ScreenToClient(hwnd, &pt)) return FALSE; + if (PtInRect(&dat->rcText, pt)) { + hCursor=(HCURSOR)GetClassLongPtr(hwnd, GCLP_HCURSOR); + if (hCursor == NULL) hCursor=LoadCursor(NULL, IDC_HAND); /* Win2000+ */ } - else hCursor=LoadCursor(NULL,IDC_ARROW); + else hCursor=LoadCursor(NULL, IDC_ARROW); SetCursor(hCursor); return TRUE; } @@ -217,16 +217,16 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM PAINTSTRUCT ps; HDC hdc; - hdc=BeginPaint(hwnd,&ps); + hdc=BeginPaint(hwnd, &ps); if (hdc != NULL) { if (IsWindowEnabled(hwnd)) { - hPrevFont=(HFONT)SelectObject(hdc,dat->hEnableFont); + hPrevFont=(HFONT)SelectObject(hdc, dat->hEnableFont); textColor = (GetFocus() == hwnd) ? dat->focusColor : dat->enableColor; } else { - hPrevFont=(HFONT)SelectObject(hdc,dat->hDisableFont); + hPrevFont=(HFONT)SelectObject(hdc, dat->hDisableFont); textColor=dat->disableColor; } - if (GetClientRect(hwnd,&rc) && GetWindowText(hwnd,szText,SIZEOF(szText))) { + if (GetClientRect(hwnd, &rc) && GetWindowText(hwnd, szText, SIZEOF(szText))) { if (drawThemeParentBackground && IsWinVerXPPlus()) { BOOL fSmoothing; @@ -236,13 +236,13 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM if (fSmoothing && fSmoothingType == FE_FONTSMOOTHINGCLEARTYPE) drawThemeParentBackground(hwnd, hdc, &rc); } - SetBkMode(hdc,TRANSPARENT); - SetTextColor(hdc,textColor); - alignFlag=(GetWindowLongPtr(hwnd,GWL_STYLE)&(SS_CENTER|SS_RIGHT|SS_LEFT)); - DrawText(hdc,szText,-1,&rc,alignFlag|DT_NOPREFIX|DT_SINGLELINE|DT_TOP); + SetBkMode(hdc, TRANSPARENT); + SetTextColor(hdc, textColor); + alignFlag=(GetWindowLongPtr(hwnd, GWL_STYLE)&(SS_CENTER|SS_RIGHT|SS_LEFT)); + DrawText(hdc, szText, -1, &rc, alignFlag|DT_NOPREFIX|DT_SINGLELINE|DT_TOP); } - if (hPrevFont != NULL) SelectObject(hdc,hPrevFont); - EndPaint(hwnd,&ps); + if (hPrevFont != NULL) SelectObject(hdc, hPrevFont); + EndPaint(hwnd, &ps); } return 0; } @@ -251,7 +251,7 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM mir_free(dat); break; } - return DefWindowProc(hwnd,msg,wParam,lParam); + return DefWindowProc(hwnd, msg, wParam, lParam); } int InitHyperlink(void) @@ -263,7 +263,7 @@ int InitHyperlink(void) wcl.cbWndExtra=sizeof(struct HyperlinkWndData*); wcl.hInstance=hMirandaInst; if (IsWinVer2000Plus()) wcl.hCursor=NULL; - else wcl.hCursor=LoadCursor(wcl.hInstance,MAKEINTRESOURCE(IDC_HYPERLINKHAND)); + else wcl.hCursor=LoadCursor(wcl.hInstance, MAKEINTRESOURCE(IDC_HYPERLINKHAND)); wcl.lpszClassName=WNDCLASS_HYPERLINK; wcl.hbrBackground=NULL; wcl.hIcon=NULL; diff --git a/src/modules/utils/imgconv.cpp b/src/modules/utils/imgconv.cpp index 431ae3343d..118ffc3acb 100644 --- a/src/modules/utils/imgconv.cpp +++ b/src/modules/utils/imgconv.cpp @@ -10,7 +10,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. diff --git a/src/modules/utils/md5.cpp b/src/modules/utils/md5.cpp index 3fb835abdd..241aa2270f 100644 --- a/src/modules/utils/md5.cpp +++ b/src/modules/utils/md5.cpp @@ -5,7 +5,7 @@ warranty. In no event will the authors be held liable for any damages arising from the use of this software. - Permission is granted to anyone to use this software for any purpose, + Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: @@ -126,7 +126,7 @@ static void md5_process(mir_md5_state_t *pms, const mir_md5_byte_t *data /*[64]*/) { mir_md5_word_t - a = pms->abcd[0], b = pms->abcd[1], + a = pms->abcd[0], b = pms->abcd[1], c = pms->abcd[2], d = pms->abcd[3]; mir_md5_word_t t; /* Define storage for little-endian or both types of CPUs. */ @@ -175,10 +175,10 @@ static void md5_process(mir_md5_state_t *pms, const mir_md5_byte_t *data /*[64]* /* Round 1. */ /* Let [abcd k s i] denote the operation - a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ + a = b + ((a + F(b, c, d) + X[k] + T[i]) <<< s). */ #define F(x, y, z) (((x) & (y)) | (~(x) & (z))) #define SET1(a, b, c, d, k, s, Ti)\ - t = a + F(b,c,d) + X[k] + Ti;\ + t = a + F(b, c, d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET1(a, b, c, d, 0, 7, T1); @@ -200,10 +200,10 @@ static void md5_process(mir_md5_state_t *pms, const mir_md5_byte_t *data /*[64]* /* Round 2. */ /* Let [abcd k s i] denote the operation - a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */ + a = b + ((a + G(b, c, d) + X[k] + T[i]) <<< s). */ #define G(x, y, z) (((x) & (z)) | ((y) & ~(z))) #define SET2(a, b, c, d, k, s, Ti)\ - t = a + G(b,c,d) + X[k] + Ti;\ + t = a + G(b, c, d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET2(a, b, c, d, 1, 5, T17); @@ -225,10 +225,10 @@ static void md5_process(mir_md5_state_t *pms, const mir_md5_byte_t *data /*[64]* /* Round 3. */ /* Let [abcd k s t] denote the operation - a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */ + a = b + ((a + H(b, c, d) + X[k] + T[i]) <<< s). */ #define H(x, y, z) ((x) ^ (y) ^ (z)) #define SET3(a, b, c, d, k, s, Ti)\ - t = a + H(b,c,d) + X[k] + Ti;\ + t = a + H(b, c, d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET3(a, b, c, d, 5, 4, T33); @@ -250,10 +250,10 @@ static void md5_process(mir_md5_state_t *pms, const mir_md5_byte_t *data /*[64]* /* Round 4. */ /* Let [abcd k s t] denote the operation - a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */ + a = b + ((a + I(b, c, d) + X[k] + T[i]) <<< s). */ #define I(x, y, z) ((y) ^ ((x) | ~(z))) #define SET4(a, b, c, d, k, s, Ti)\ - t = a + I(b,c,d) + X[k] + Ti;\ + t = a + I(b, c, d) + X[k] + Ti;\ a = ROTATE_LEFT(t, s) + b /* Do the following 16 operations. */ SET4(a, b, c, d, 0, 6, T49); @@ -331,9 +331,9 @@ void md5_append(mir_md5_state_t *pms, const mir_md5_byte_t *data, int nbytes) void md5_finish(mir_md5_state_t *pms, mir_md5_byte_t digest[16]) { static const mir_md5_byte_t pad[64] = { - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; mir_md5_byte_t data[8]; diff --git a/src/modules/utils/openurl.cpp b/src/modules/utils/openurl.cpp index fb10c5f43c..46e95f954e 100644 --- a/src/modules/utils/openurl.cpp +++ b/src/modules/utils/openurl.cpp @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -27,24 +27,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define WNDCLASS_DDEMSGWINDOW _T("MirandaDdeMsgWindow") struct DdeMsgWindowData { - int fAcked,fData; + int fAcked, fData; HWND hwndDde; }; -static LRESULT CALLBACK DdeMessageWindow(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) +static LRESULT CALLBACK DdeMessageWindow(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { struct DdeMsgWindowData *dat; ATOM hSzItem; HGLOBAL hDdeData; - dat=(struct DdeMsgWindowData*)GetWindowLongPtr(hwnd,0); + dat=(struct DdeMsgWindowData*)GetWindowLongPtr(hwnd, 0); switch(msg) { case WM_DDE_ACK: dat->fAcked=1; dat->hwndDde=(HWND)wParam; return 0; case WM_DDE_DATA: - UnpackDDElParam(msg,lParam,(PUINT_PTR)&hDdeData,(PUINT_PTR)&hSzItem); + UnpackDDElParam(msg, lParam, (PUINT_PTR)&hDdeData, (PUINT_PTR)&hSzItem); dat->fData=1; if (hDdeData) { DDEDATA *data; @@ -52,7 +52,7 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd,UINT msg,WPARAM wParam,LPARAM data=(DDEDATA*)GlobalLock(hDdeData); if (data->fAckReq) { DDEACK ack={0}; - PostMessage((HWND)wParam,WM_DDE_ACK,(WPARAM)hwnd,PackDDElParam(WM_DDE_ACK,*(PUINT)&ack,(UINT)hSzItem)); + PostMessage((HWND)wParam, WM_DDE_ACK, (WPARAM)hwnd, PackDDElParam(WM_DDE_ACK, *(PUINT)&ack, (UINT)hSzItem)); } else GlobalDeleteAtom(hSzItem); release=data->fRelease; @@ -62,32 +62,32 @@ static LRESULT CALLBACK DdeMessageWindow(HWND hwnd,UINT msg,WPARAM wParam,LPARAM else GlobalDeleteAtom(hSzItem); return 0; } - return DefWindowProc(hwnd,msg,wParam,lParam); + return DefWindowProc(hwnd, msg, wParam, lParam); } -static int DoDdeRequest(const char *szItemName,HWND hwndDdeMsg) +static int DoDdeRequest(const char *szItemName, HWND hwndDdeMsg) { ATOM hSzItemName; - DWORD timeoutTick,thisTick; + DWORD timeoutTick, thisTick; MSG msg; - struct DdeMsgWindowData *dat=(struct DdeMsgWindowData*)GetWindowLongPtr(hwndDdeMsg,0); + struct DdeMsgWindowData *dat=(struct DdeMsgWindowData*)GetWindowLongPtr(hwndDdeMsg, 0); hSzItemName=GlobalAddAtomA(szItemName); - if (!PostMessage(dat->hwndDde,WM_DDE_REQUEST,(WPARAM)hwndDdeMsg,MAKELPARAM(CF_TEXT,hSzItemName))) { + if (!PostMessage(dat->hwndDde, WM_DDE_REQUEST, (WPARAM)hwndDdeMsg, MAKELPARAM(CF_TEXT, hSzItemName))) { GlobalDeleteAtom(hSzItemName); return 1; } timeoutTick=GetTickCount()+5000; dat->fData=0; dat->fAcked=0; do { - if (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) { + if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } if (dat->fData || dat->fAcked) break; thisTick=GetTickCount(); if (thisTick>timeoutTick) break; - } while (MsgWaitForMultipleObjects(0,NULL,FALSE,timeoutTick-thisTick,QS_ALLINPUT) == WAIT_OBJECT_0); + } while (MsgWaitForMultipleObjects(0, NULL, FALSE, timeoutTick-thisTick, QS_ALLINPUT) == WAIT_OBJECT_0); if (!dat->fData) { GlobalDeleteAtom(hSzItemName); @@ -97,31 +97,31 @@ static int DoDdeRequest(const char *szItemName,HWND hwndDdeMsg) } //see Q160957 and http://developer.netscape.com/docs/manuals/communicator/DDE/index.htm -static int DdeOpenUrl(const char *szBrowser,char *szUrl,int newWindow,HWND hwndDdeMsg) +static int DdeOpenUrl(const char *szBrowser, char *szUrl, int newWindow, HWND hwndDdeMsg) { - ATOM hSzBrowser,hSzTopic; + ATOM hSzBrowser, hSzTopic; DWORD_PTR dwResult; char *szItemName; - struct DdeMsgWindowData *dat=(struct DdeMsgWindowData*)GetWindowLongPtr(hwndDdeMsg,0); + struct DdeMsgWindowData *dat=(struct DdeMsgWindowData*)GetWindowLongPtr(hwndDdeMsg, 0); hSzBrowser=GlobalAddAtomA(szBrowser); hSzTopic=GlobalAddAtomA("WWW_OpenURL"); dat->fAcked=0; - if (!SendMessageTimeout(HWND_BROADCAST,WM_DDE_INITIATE,(WPARAM)hwndDdeMsg,MAKELPARAM(hSzBrowser,hSzTopic),SMTO_ABORTIFHUNG|SMTO_NORMAL,DDEMESSAGETIMEOUT,&dwResult) + if (!SendMessageTimeout(HWND_BROADCAST, WM_DDE_INITIATE, (WPARAM)hwndDdeMsg, MAKELPARAM(hSzBrowser, hSzTopic), SMTO_ABORTIFHUNG|SMTO_NORMAL, DDEMESSAGETIMEOUT, &dwResult) || !dat->fAcked) { GlobalDeleteAtom(hSzTopic); GlobalDeleteAtom(hSzBrowser); return 1; } szItemName=(char*)mir_alloc(lstrlenA(szUrl)+7); - wsprintfA(szItemName,"\"%s\",,%d",szUrl,newWindow?0:-1); - if (DoDdeRequest(szItemName,hwndDdeMsg)) { + wsprintfA(szItemName, "\"%s\", , %d", szUrl, newWindow?0:-1); + if (DoDdeRequest(szItemName, hwndDdeMsg)) { mir_free(szItemName); GlobalDeleteAtom(hSzTopic); GlobalDeleteAtom(hSzBrowser); return 1; } - PostMessage(dat->hwndDde,WM_DDE_TERMINATE,(WPARAM)hwndDdeMsg,0); + PostMessage(dat->hwndDde, WM_DDE_TERMINATE, (WPARAM)hwndDdeMsg, 0); GlobalDeleteAtom(hSzTopic); GlobalDeleteAtom(hSzBrowser); mir_free(szItemName); @@ -147,25 +147,25 @@ static void OpenURLThread(void *arg) int success=0; if (!hUrlInfo->szUrl) return; - hwndDdeMsg=CreateWindow(WNDCLASS_DDEMSGWINDOW,_T(""),0,0,0,0,0,NULL,NULL,hMirandaInst,NULL); - SetWindowLongPtr(hwndDdeMsg,0,(LONG_PTR)&msgWndData); + hwndDdeMsg=CreateWindow(WNDCLASS_DDEMSGWINDOW, _T(""), 0, 0, 0, 0, 0, NULL, NULL, hMirandaInst, NULL); + SetWindowLongPtr(hwndDdeMsg, 0, (LONG_PTR)&msgWndData); - if (!_strnicmp(hUrlInfo->szUrl,"ftp:",4) || !_strnicmp(hUrlInfo->szUrl,"ftp.",4)) pszProtocol="ftp"; - if (!_strnicmp(hUrlInfo->szUrl,"mailto:",7)) pszProtocol="mailto"; - if (!_strnicmp(hUrlInfo->szUrl,"news:",5)) pszProtocol="news"; + if (!_strnicmp(hUrlInfo->szUrl, "ftp:", 4) || !_strnicmp(hUrlInfo->szUrl, "ftp.", 4)) pszProtocol="ftp"; + if (!_strnicmp(hUrlInfo->szUrl, "mailto:", 7)) pszProtocol="mailto"; + if (!_strnicmp(hUrlInfo->szUrl, "news:", 5)) pszProtocol="news"; else pszProtocol="http"; - wsprintfA(szSubkey,"%s\\shell\\open\\command",pszProtocol); - if (RegOpenKeyExA(HKEY_CURRENT_USER,szSubkey,0,KEY_QUERY_VALUE,&hKey) == ERROR_SUCCESS - || RegOpenKeyExA(HKEY_CLASSES_ROOT,szSubkey,0,KEY_QUERY_VALUE,&hKey) == ERROR_SUCCESS) { + wsprintfA(szSubkey, "%s\\shell\\open\\command", pszProtocol); + if (RegOpenKeyExA(HKEY_CURRENT_USER, szSubkey, 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS + || RegOpenKeyExA(HKEY_CLASSES_ROOT, szSubkey, 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS) { dataLength=SIZEOF(szCommandName); - if (RegQueryValueEx(hKey,NULL,NULL,NULL,(PBYTE)szCommandName,&dataLength) == ERROR_SUCCESS) { + if (RegQueryValueEx(hKey, NULL, NULL, NULL, (PBYTE)szCommandName, &dataLength) == ERROR_SUCCESS) { _strlwr(szCommandName); - if (strstr(szCommandName,"mozilla") || strstr(szCommandName,"netscape")) - success=(DdeOpenUrl("mozilla",hUrlInfo->szUrl,hUrlInfo->newWindow,hwndDdeMsg) == 0 || DdeOpenUrl("netscape",hUrlInfo->szUrl,hUrlInfo->newWindow,hwndDdeMsg) == 0); - else if (strstr(szCommandName,"iexplore") || strstr(szCommandName,"msimn")) - success=0 == DdeOpenUrl("iexplore",hUrlInfo->szUrl,hUrlInfo->newWindow,hwndDdeMsg); - else if (strstr(szCommandName,"opera")) - success=0 == DdeOpenUrl("opera",hUrlInfo->szUrl,hUrlInfo->newWindow,hwndDdeMsg); + if (strstr(szCommandName, "mozilla") || strstr(szCommandName, "netscape")) + success=(DdeOpenUrl("mozilla", hUrlInfo->szUrl, hUrlInfo->newWindow, hwndDdeMsg) == 0 || DdeOpenUrl("netscape", hUrlInfo->szUrl, hUrlInfo->newWindow, hwndDdeMsg) == 0); + else if (strstr(szCommandName, "iexplore") || strstr(szCommandName, "msimn")) + success=0 == DdeOpenUrl("iexplore", hUrlInfo->szUrl, hUrlInfo->newWindow, hwndDdeMsg); + else if (strstr(szCommandName, "opera")) + success=0 == DdeOpenUrl("opera", hUrlInfo->szUrl, hUrlInfo->newWindow, hwndDdeMsg); //opera's the default anyway } RegCloseKey(hKey); @@ -177,20 +177,20 @@ static void OpenURLThread(void *arg) //wack a protocol on it if ((isalpha(hUrlInfo->szUrl[0]) && hUrlInfo->szUrl[1] == ':') || hUrlInfo->szUrl[0] == '\\') { szResult=(char*)mir_alloc(lstrlenA(hUrlInfo->szUrl)+9); - wsprintfA(szResult,"file:///%s",hUrlInfo->szUrl); + wsprintfA(szResult, "file:///%s", hUrlInfo->szUrl); } else { int i; for (i=0;isalpha(hUrlInfo->szUrl[i]);i++); if (hUrlInfo->szUrl[i] == ':') szResult=mir_strdup(hUrlInfo->szUrl); else { - if (!_strnicmp(hUrlInfo->szUrl,"ftp.",4)) { + if (!_strnicmp(hUrlInfo->szUrl, "ftp.", 4)) { szResult=(char*)mir_alloc(lstrlenA(hUrlInfo->szUrl)+7); - wsprintfA(szResult,"ftp://%s",hUrlInfo->szUrl); + wsprintfA(szResult, "ftp://%s", hUrlInfo->szUrl); } else { szResult=(char*)mir_alloc(lstrlenA(hUrlInfo->szUrl)+8); - wsprintfA(szResult,"http://%s",hUrlInfo->szUrl); + wsprintfA(szResult, "http://%s", hUrlInfo->szUrl); } } } @@ -201,7 +201,7 @@ static void OpenURLThread(void *arg) return; } -static INT_PTR OpenURL(WPARAM wParam,LPARAM lParam) { +static INT_PTR OpenURL(WPARAM wParam, LPARAM lParam) { TOpenUrlInfo *hUrlInfo = (TOpenUrlInfo*)mir_alloc(sizeof(TOpenUrlInfo)); hUrlInfo->szUrl = (char*)lParam?mir_strdup((char*)lParam):NULL; hUrlInfo->newWindow = (int)wParam; @@ -223,6 +223,6 @@ int InitOpenUrl(void) wcl.lpszMenuName=NULL; wcl.style=0; RegisterClass(&wcl); - CreateServiceFunction(MS_UTILS_OPENURL,OpenURL); + CreateServiceFunction(MS_UTILS_OPENURL, OpenURL); return 0; } diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp index ed29b7fa24..49e5ae8bf4 100644 --- a/src/modules/utils/path.cpp +++ b/src/modules/utils/path.cpp @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -231,7 +231,7 @@ static INT_PTR createDirTreeW(WPARAM, LPARAM lParam) int InitPathUtilsW(void) { GetModuleFileName(hMirandaInst, szMirandaPathW, SIZEOF(szMirandaPathW)); - TCHAR *p = _tcsrchr(szMirandaPathW,'\\'); + TCHAR *p = _tcsrchr(szMirandaPathW, '\\'); if ( p ) p[1] = 0; mir_sntprintf(szMirandaPathWLower, SIZEOF(szMirandaPathWLower), _T("%s"), szMirandaPathW); @@ -457,7 +457,7 @@ XCHAR *GetInternalVariable(XCHAR *key, size_t keyLength, HANDLE hContact) if (!_xcscmp(theKey, XSTR(key, "nick"))) theValue = GetContactNickX(key, hContact); else if (!_xcscmp(theKey, XSTR(key, "proto"))) - theValue = mir_a2x(key, (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact,0)); + theValue = mir_a2x(key, (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0)); else if (!_xcscmp(theKey, XSTR(key, "userid"))) theValue = GetContactIDX(key, hContact); } @@ -478,11 +478,11 @@ XCHAR *GetInternalVariable(XCHAR *key, size_t keyLength, HANDLE hContact) else if (!_xcscmp(theKey, XSTR(key, "username"))) theValue = GetUserNameX(key); else if (!_xcscmp(theKey, XSTR(key, "miranda_avatarcache"))) - theValue = GetPathVarX(key,1); + theValue = GetPathVarX(key, 1); else if (!_xcscmp(theKey, XSTR(key, "miranda_logpath"))) - theValue = GetPathVarX(key,2); + theValue = GetPathVarX(key, 2); else if (!_xcscmp(theKey, XSTR(key, "miranda_userdata"))) - theValue = GetPathVarX(key,3); + theValue = GetPathVarX(key, 3); } if (!theValue) @@ -583,7 +583,7 @@ int InitPathUtils(void) { char *p = 0; GetModuleFileNameA(hMirandaInst, szMirandaPath, SIZEOF(szMirandaPath)); - p = strrchr(szMirandaPath,'\\'); + p = strrchr(szMirandaPath, '\\'); if ( p ) p[1] = 0; mir_snprintf(szMirandaPathLower, MAX_PATH, "%s", szMirandaPath); diff --git a/src/modules/utils/resizer.cpp b/src/modules/utils/resizer.cpp index b68e874753..1ddfa3fb75 100644 --- a/src/modules/utils/resizer.cpp +++ b/src/modules/utils/resizer.cpp @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -59,10 +59,10 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam) START_OF_DLGTEMPLATEEX *pTemplateEx; UTILRESIZECONTROL urc; int procResult; - int extendedDlg,itemCount; + int extendedDlg, itemCount; if (urd == NULL||urd->cbSize != sizeof(UTILRESIZEDIALOG)) return 1; - pTemplate=(DLGTEMPLATE*)LockResource(LoadResource(urd->hInstance,FindResourceA(urd->hInstance,urd->lpTemplate,MAKEINTRESOURCEA(5)))); + pTemplate=(DLGTEMPLATE*)LockResource(LoadResource(urd->hInstance, FindResourceA(urd->hInstance, urd->lpTemplate, MAKEINTRESOURCEA(5)))); pTemplateEx=(START_OF_DLGTEMPLATEEX*)pTemplate; extendedDlg=pTemplateEx->signature == 0xFFFF; if (extendedDlg && pTemplateEx->dlgVer != 1) @@ -75,7 +75,7 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam) while (*pWord++); //title if (extendedDlg) { if (pTemplateEx->style&DS_SETFONT) { - pWord+=3; //font size,weight,italic + pWord+=3; //font size, weight, italic while (*pWord++); //font name } } @@ -90,9 +90,9 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam) rc.left=0; rc.top=0; if (extendedDlg) {rc.right=pTemplateEx->cx; rc.bottom=pTemplateEx->cy;} else {rc.right=pTemplate->cx; rc.bottom=pTemplate->cy;} - MapDialogRect(urd->hwndDlg,&rc); + MapDialogRect(urd->hwndDlg, &rc); urc.dlgOriginalSize.cx=rc.right; urc.dlgOriginalSize.cy=rc.bottom; - GetClientRect(urd->hwndDlg,&rc); + GetClientRect(urd->hwndDlg, &rc); urc.dlgNewSize.cx=rc.right; urc.dlgNewSize.cy=rc.bottom; if (extendedDlg) itemCount=pTemplateEx->cDlgItems; @@ -123,8 +123,8 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam) if (urc.wId == 65535) continue; //using this breaks the dwp, so just ignore it - MapDialogRect(urd->hwndDlg,&urc.rcItem); - procResult=(urd->pfnResizer)(urd->hwndDlg,urd->lParam,&urc); + MapDialogRect(urd->hwndDlg, &urc.rcItem); + procResult=(urd->pfnResizer)(urd->hwndDlg, urd->lParam, &urc); if (procResult&RD_ANCHORX_RIGHT) { urc.rcItem.left+=urc.dlgNewSize.cx-urc.dlgOriginalSize.cx; urc.rcItem.right+=urc.dlgNewSize.cx-urc.dlgOriginalSize.cx; @@ -145,7 +145,7 @@ INT_PTR ResizeDialog(WPARAM, LPARAM lParam) urc.rcItem.top+=(urc.dlgNewSize.cy-urc.dlgOriginalSize.cy)/2; urc.rcItem.bottom+=(urc.dlgNewSize.cy-urc.dlgOriginalSize.cy)/2; } - hDwp = DeferWindowPos(hDwp,GetDlgItem(urd->hwndDlg,extendedDlg?pItemEx->id:pItem->id),0,urc.rcItem.left,urc.rcItem.top,urc.rcItem.right-urc.rcItem.left,urc.rcItem.bottom-urc.rcItem.top,SWP_NOZORDER); + hDwp = DeferWindowPos(hDwp, GetDlgItem(urd->hwndDlg, extendedDlg?pItemEx->id:pItem->id), 0, urc.rcItem.left, urc.rcItem.top, urc.rcItem.right-urc.rcItem.left, urc.rcItem.bottom-urc.rcItem.top, SWP_NOZORDER); } EndDeferWindowPos(hDwp); return 0; diff --git a/src/modules/utils/sha1.cpp b/src/modules/utils/sha1.cpp index 3900d67fff..3d71239bab 100644 --- a/src/modules/utils/sha1.cpp +++ b/src/modules/utils/sha1.cpp @@ -6,7 +6,7 @@ * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * - * Software distributed under the License is distributed on an "AS IS" basis, + * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. @@ -22,7 +22,7 @@ * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to @@ -119,11 +119,11 @@ void shaBlock(mir_sha1_byte_t *dataIn, int len, mir_sha1_byte_t hashout[20]) { } -#define SHA_ROTL(X,n) (((X) << (n)) | ((X) >> (32-(n)))) +#define SHA_ROTL(X, n) (((X) << (n)) | ((X) >> (32-(n)))) static void shaHashBlock(mir_sha1_ctx *ctx) { int t; - unsigned long A,B,C,D,E,TEMP; + unsigned long A, B, C, D, E, TEMP; for (t = 16; t <= 79; t++) ctx->W[t] = @@ -136,19 +136,19 @@ static void shaHashBlock(mir_sha1_ctx *ctx) { E = ctx->H[4]; for (t = 0; t <= 19; t++) { - TEMP = SHA_ROTL(A,5) + (((C^D)&B)^D) + E + ctx->W[t] + 0x5a827999L; + TEMP = SHA_ROTL(A, 5) + (((C^D)&B)^D) + E + ctx->W[t] + 0x5a827999L; E = D; D = C; C = SHA_ROTL(B, 30); B = A; A = TEMP; } for (t = 20; t <= 39; t++) { - TEMP = SHA_ROTL(A,5) + (B^C^D) + E + ctx->W[t] + 0x6ed9eba1L; + TEMP = SHA_ROTL(A, 5) + (B^C^D) + E + ctx->W[t] + 0x6ed9eba1L; E = D; D = C; C = SHA_ROTL(B, 30); B = A; A = TEMP; } for (t = 40; t <= 59; t++) { - TEMP = SHA_ROTL(A,5) + ((B&C)|(D&(B|C))) + E + ctx->W[t] + 0x8f1bbcdcL; + TEMP = SHA_ROTL(A, 5) + ((B&C)|(D&(B|C))) + E + ctx->W[t] + 0x8f1bbcdcL; E = D; D = C; C = SHA_ROTL(B, 30); B = A; A = TEMP; } for (t = 60; t <= 79; t++) { - TEMP = SHA_ROTL(A,5) + (B^C^D) + E + ctx->W[t] + 0xca62c1d6L; + TEMP = SHA_ROTL(A, 5) + (B^C^D) + E + ctx->W[t] + 0xca62c1d6L; E = D; D = C; C = SHA_ROTL(B, 30); B = A; A = TEMP; } diff --git a/src/modules/utils/timeutils.cpp b/src/modules/utils/timeutils.cpp index 0b39d47ea9..cea409ef82 100644 --- a/src/modules/utils/timeutils.cpp +++ b/src/modules/utils/timeutils.cpp @@ -1,7 +1,7 @@ /* Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2010 Miranda ICQ/IM project, +Copyright 2010 Miranda ICQ/IM project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -10,7 +10,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -93,16 +93,16 @@ void FormatTime(const SYSTEMTIME *st, const TCHAR *szFormat, TCHAR *szDest, int if (iso) { - dateTimeStrLen = mir_sntprintf(dateTimeStr, SIZEOF(dateTimeStr), + dateTimeStrLen = mir_sntprintf(dateTimeStr, SIZEOF(dateTimeStr), _T("%d-%02d-%02dT%02d:%02d:%02dZ"), st->wYear, st->wMonth, st->wDay, st->wHour, st->wMinute, st->wSecond) + 1; } else if (date) - dateTimeStrLen = GetDateFormat(LOCALE_USER_DEFAULT, fmt, st, NULL, + dateTimeStrLen = GetDateFormat(LOCALE_USER_DEFAULT, fmt, st, NULL, dateTimeStr, SIZEOF(dateTimeStr)); else - dateTimeStrLen = GetTimeFormat(LOCALE_USER_DEFAULT, fmt, st, NULL, + dateTimeStrLen = GetTimeFormat(LOCALE_USER_DEFAULT, fmt, st, NULL, dateTimeStr, SIZEOF(dateTimeStr)); if (dateTimeStrLen) --dateTimeStrLen; @@ -158,7 +158,7 @@ void ConvertToAbsolute (const SYSTEMTIME * pstLoc, const SYSTEMTIME * pstDst, SY // Now iDay is a day of the month ranging from 1 to 7. // Recall that the wDay field of the structure can range - // from 1 to 5, 1 meaning "first", 2 meaning "second", + // from 1 to 5, 1 meaning "first", 2 meaning "second", // and 5 meaning "last". // So, increase iDay so it's the proper day of the month. diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp index b7947d6e98..1fe186d633 100644 --- a/src/modules/utils/timezones.cpp +++ b/src/modules/utils/timezones.cpp @@ -1,7 +1,7 @@ /* Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2010 Miranda ICQ/IM project, +Copyright 2010 Miranda ICQ/IM project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -10,7 +10,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. diff --git a/src/modules/utils/utf.cpp b/src/modules/utils/utf.cpp index 670f9f5edf..4c86e1c4ee 100644 --- a/src/modules/utils/utf.cpp +++ b/src/modules/utils/utf.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-2009 Miranda ICQ/IM project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -14,7 +14,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -29,14 +29,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* number of following bytes in sequence based on first byte value (for bytes above 0x7f) */ static const char utf8_length[128] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x80-0x8f */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x90-0x9f */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xa0-0xaf */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xb0-0xbf */ - 0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 0xc0-0xcf */ - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 0xd0-0xdf */ - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, /* 0xe0-0xef */ - 3,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0 /* 0xf0-0xff */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x80-0x8f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0x90-0x9f */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xa0-0xaf */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 0xb0-0xbf */ + 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xc0-0xcf */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0xd0-0xdf */ + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 0xe0-0xef */ + 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* 0xf0-0xff */ }; /* first byte mask depending on UTF-8 sequence length */ diff --git a/src/modules/utils/utils.cpp b/src/modules/utils/utils.cpp index 2e113f877a..de49be7ab1 100644 --- a/src/modules/utils/utils.cpp +++ b/src/modules/utils/utils.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-2009 Miranda ICQ/IM project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "..\..\core\commonheaders.h" -INT_PTR ResizeDialog(WPARAM wParam,LPARAM lParam); +INT_PTR ResizeDialog(WPARAM wParam, LPARAM lParam); int InitOpenUrl(void); int InitWindowList(void); void FreeWindowList(void); @@ -39,262 +39,262 @@ INT_PTR GetSHA1Interface(WPARAM, LPARAM); static BOOL bModuleInitialized = FALSE; static struct CountryListEntry countries[]={ - {0 ,"Unspecified"}, - {9999,"Other"}, - {0xFFFF,"Unknown"}, - {93 ,"Afghanistan"}, - {355 ,"Albania"}, - {213 ,"Algeria"}, - {376 ,"Andorra"}, - {244 ,"Angola"}, - {1264,"Anguilla"}, /* change county code to NANP (from 101) */ - {1268,"Antigua and Barbuda"}, /* change county code to NANP (from 1021) */ -// {5902,"Antilles"}, /* removed: it is not a country, it's a group of islands from diffrent countries (all are included in the list)*/ - {54 ,"Argentina"}, - {374 ,"Armenia"}, - {297 ,"Aruba"}, - {247 ,"Ascension Island"}, - {61 ,"Australia"}, - {6720 ,"Australia, Antarctic Territory"}, /* added country code 672(0)*/ - {614 ,"Australia, Christmas Island"}, /* rename (from Christmas Island) and change to official county code 61(4) (from 672) */ - {61891,"Australia, Cocos (Keeling) Islands"}, /* rename and change to official county code 61(891) (from 6102) */ - {6723 ,"Australia, Norfolk Island"}, /* rename (from Norfolk Island) and change to official county code 672(3) (from 6722) */ - {43 ,"Austria"}, - {994 ,"Azerbaijan"}, - {1242,"Bahamas"}, /* change county code to NANP (from 103) */ - {973 ,"Bahrain"}, - {880 ,"Bangladesh"}, - {1246,"Barbados"}, /* change county code to NANP (from 103) */ -// {120 ,"Barbuda"}, /* removed: it is not a country and no special island, see Antigua and Barbuda*/ - {375 ,"Belarus"}, - {32 ,"Belgium"}, - {501 ,"Belize"}, - {229 ,"Benin"}, - {1441,"Bermuda"}, /* change county code to NANP (from 105) */ - {975 ,"Bhutan"}, - {591 ,"Bolivia"}, - {387 ,"Bosnia and Herzegovina"}, - {267 ,"Botswana"}, - {55 ,"Brazil"}, - {673 ,"Brunei"}, - {359 ,"Bulgaria"}, - {226 ,"Burkina Faso"}, - {257 ,"Burundi"}, - {855 ,"Cambodia"}, - {237 ,"Cameroon"}, - {1002,"Canada"}, /* change county code to NANP (from 107 to virtual 1(002) -> reflect NANP*/ - {238 ,"Cape Verde Islands"}, - {1345,"Cayman Islands"}, /* change county code to NANP (from 108) */ - {236 ,"Central African Republic"}, - {235 ,"Chad"}, - {56 ,"Chile, Republic of"}, - {86 ,"China"}, -// {6101,"Cocos-Keeling Islands"}, /* removed (double): see Australia, Cocos (Keeling) Islands */ - {57 ,"Colombia"}, - {269 ,"Comoros"}, /* change county code (from 2691) */ - {243 ,"Congo, Democratic Republic of (Zaire)"}, - {242 ,"Congo, Republic of the"}, - {682 ,"Cook Islands"}, - {506 ,"Costa Rica"}, - {225 ,"Cote d'Ivoire (Ivory Coast)"}, - {385 ,"Croatia"}, - {53 ,"Cuba"}, - {357 ,"Greek, Republic of South Cyprus"}, /* rename coz Turkey, Republic of Northern Cyprus */ - {420 ,"Czech Republic"}, - {45 ,"Denmark"}, - {246 ,"Diego Garcia"}, - {253 ,"Djibouti"}, - {1767,"Dominica"}, /* change county code to NANP (from 109) */ - {1809,"Dominican Republic"}, /* change county code to NANP 809, 829, 849 (from 110) */ - {593 ,"Ecuador"}, - {20 ,"Egypt"}, - {503 ,"El Salvador"}, - {240 ,"Equatorial Guinea"}, - {291 ,"Eritrea"}, - {372 ,"Estonia"}, - {251 ,"Ethiopia"}, - {3883,"Europe"}, /* add county code +388 3 official European Telephony Numbering Space*/ - {298 ,"Faeroe Islands"}, - {500 ,"Falkland Islands"}, - {679 ,"Fiji"}, - {358 ,"Finland"}, - {33 ,"France"}, - {5901,"French Antilles"}, - {594 ,"French Guiana"}, - {689 ,"French Polynesia"}, - {241 ,"Gabon"}, - {220 ,"Gambia"}, - {995 ,"Georgia"}, - {49 ,"Germany"}, - {233 ,"Ghana"}, - {350 ,"Gibraltar"}, - {30 ,"Greece"}, - {299 ,"Greenland"}, - {1473,"Grenada"}, /* change county code to NANP (from 111) */ - {590 ,"Guadeloupe"}, - {1671,"Guam, US Territory of"}, /* change county code to NANP (from 671) */ - {502 ,"Guatemala"}, - {224 ,"Guinea"}, - {245 ,"Guinea-Bissau"}, - {592 ,"Guyana"}, - {509 ,"Haiti"}, - {504 ,"Honduras"}, - {852 ,"Hong Kong"}, - {36 ,"Hungary"}, - {354 ,"Iceland"}, - {91 ,"India"}, - {62 ,"Indonesia"}, - {98 ,"Iran (Islamic Republic of)"}, - {964 ,"Iraq"}, - {353 ,"Ireland"}, - {972 ,"Israel"}, - {39 ,"Italy"}, - {1876,"Jamaica"}, /* change county code to NANP (from 112) */ - {81 ,"Japan"}, - {962 ,"Jordan"}, - {705 ,"Kazakhstan"}, - {254 ,"Kenya"}, - {686 ,"Kiribati"}, - {850 ,"Korea, North"}, - {82 ,"Korea, South"}, - {965 ,"Kuwait"}, - {996 ,"Kyrgyzstan"}, /* change county code (from 706) */ - {856 ,"Laos"}, - {371 ,"Latvia"}, - {961 ,"Lebanon"}, - {266 ,"Lesotho"}, - {231 ,"Liberia"}, - {218 ,"Libyan Arab Jamahiriya"}, - {423 ,"Liechtenstein"}, /* change county code (from 4101) */ - {370 ,"Lithuania"}, - {352 ,"Luxembourg"}, - {853 ,"Macau"}, - {389 ,"Macedonia, Republic of"}, /* rename coz war */ - {261 ,"Madagascar"}, - {265 ,"Malawi"}, - {60 ,"Malaysia"}, - {960 ,"Maldives"}, - {223 ,"Mali"}, - {356 ,"Malta"}, - {692 ,"Marshall Islands"}, - {596 ,"Martinique"}, - {222 ,"Mauritania"}, - {230 ,"Mauritius"}, - {262 ,"Mayotte Island"}, /* change county code coz bug (from 269) */ - {52 ,"Mexico"}, - {691 ,"Micronesia, Federated States of"}, - {373 ,"Moldova, Republic of"}, - {377 ,"Monaco"}, - {976 ,"Mongolia"}, - {1664,"Montserrat"}, /* change county code to NANP (from 113) */ - {212 ,"Morocco"}, - {258 ,"Mozambique"}, - {95 ,"Myanmar"}, - {264 ,"Namibia"}, - {674 ,"Nauru"}, - {977 ,"Nepal"}, - {31 ,"Netherlands"}, - {599 ,"Netherlands Antilles"}, /* dissolved 2010 */ - {5995 ,"St. Maarten"}, /* add new country in 2010 (from Netherlands Antilles) */ - {5999 ,"Curacao"}, /* add new country in 2010 (from Netherlands Antilles) */ - {5997 ,"Netherlands (Bonaire Island)"}, /* add new Part of Netherlands in 2010 (from Netherlands Antilles) */ - {59946,"Netherlands (Saba Island)"}, /* add new Part of Netherlands in 2010 (from Netherlands Antilles) */ - {59938,"Netherlands (St. Eustatius Island)"}, /* add new Part of Netherlands in 2010 (from Netherlands Antilles) */ - // {114 ,"Nevis"}, /* removed: it is not a country, it's part of Saint Kitts and Nevis*/ - {687 ,"New Caledonia"}, - {64 ,"New Zealand"}, - {505 ,"Nicaragua"}, - {227 ,"Niger"}, - {234 ,"Nigeria"}, - {683 ,"Niue"}, - {1670,"Northern Mariana Islands, US Territory of"}, /* added NANP */ - {47 ,"Norway"}, - {968 ,"Oman"}, - {92 ,"Pakistan"}, - {680 ,"Palau"}, - {507 ,"Panama"}, - {675 ,"Papua New Guinea"}, - {595 ,"Paraguay"}, - {51 ,"Peru"}, - {63 ,"Philippines"}, - {48 ,"Poland"}, - {351 ,"Portugal"}, - {1939,"Puerto Rico"}, /* change county code to NANP 939, 787 (from 121) */ - {974 ,"Qatar"}, - {262 ,"Reunion Island"}, - {40 ,"Romania"}, -// {6701,"Rota Island"}, /* removed: it is not a country it is part of Northern Mariana Islands, US Territory of */ - {7 ,"Russia"}, - {250 ,"Rwanda"}, - {1684,"Samoa (USA)"}, /* rename (from American Samoa) change county code to NANP (from 684) */ - {685 ,"Samoa, Western"}, /* rename (from Western Samoa) */ - {290 ,"Saint Helena"}, -// {115 ,"Saint Kitts"}, /* removed: it is not a country it is part of Saint Kitts and Nevis*/ - {1869,"Saint Kitts and Nevis"}, /* change county code to NANP (from 1141) */ - {1758,"Saint Lucia"}, /* change county code to NANP (from 122) */ - {508 ,"Saint Pierre and Miquelon"}, - {1784,"Saint Vincent and the Grenadines"}, /* change county code to NANP (from 116) */ -// {670 ,"Saipan Island"}, /* removed: it is not a country it is part of Northern Mariana Islands, US Territory of */ - {378 ,"San Marino"}, - {239 ,"Sao Tome and Principe"}, - {966 ,"Saudi Arabia"}, - {442 ,"Scotland"}, - {221 ,"Senegal"}, - {248 ,"Seychelles"}, - {232 ,"Sierra Leone"}, - {65 ,"Singapore"}, - {421 ,"Slovakia"}, - {386 ,"Slovenia"}, - {677 ,"Solomon Islands"}, - {252 ,"Somalia"}, - {27 ,"South Africa"}, - {34 ,"Spain"}, - {3492,"Spain, Canary Islands"}, /*rename and change county code to 34(92) spain + canary code*/ - {94 ,"Sri Lanka"}, - {249 ,"Sudan"}, - {597 ,"Suriname"}, - {268 ,"Swaziland"}, - {46 ,"Sweden"}, - {41 ,"Switzerland"}, - {963 ,"Syrian Arab Republic"}, - {886 ,"Taiwan"}, - {992 ,"Tajikistan"}, /* change county code (from 708) */ - {255 ,"Tanzania"}, - {66 ,"Thailand"}, -// {6702,"Tinian Island"}, /* removed: it is not a country it is part of Northern Mariana Islands, US Territory of */ - {670 ,"Timor, East"}, /* added (is part off Northern Mariana Islands but not US Territory*/ - {228 ,"Togo"}, - {690 ,"Tokelau"}, - {676 ,"Tonga"}, - {1868,"Trinidad and Tobago"}, /* change county code to NANP (from 1141) */ - {216 ,"Tunisia"}, - {90 ,"Turkey"}, - {90392,"Turkey, Republic of Northern Cyprus"}, /* added (is diffrent from Greek part)*/ - {993 ,"Turkmenistan"}, /* change county code (from 709) */ - {1649,"Turks and Caicos Islands"}, /* change county code to NANP (from 118) */ - {688 ,"Tuvalu"}, - {256 ,"Uganda"}, - {380 ,"Ukraine"}, - {971 ,"United Arab Emirates"}, - {44 ,"United Kingdom"}, - {598 ,"Uruguay"}, - {1 ,"USA"}, - {998 ,"Uzbekistan"}, /* change county code (from 711) */ - {678 ,"Vanuatu"}, - {379 ,"Vatican City"}, - {58 ,"Venezuela"}, - {84 ,"Vietnam"}, - {1284,"Virgin Islands (UK)"}, /* change county code to NANP (from 105) - rename coz Virgin Islands (USA) */ - {1340,"Virgin Islands (USA)"}, /* change county code to NANP (from 123) */ - {441 ,"Wales"}, - {681 ,"Wallis and Futuna Islands"}, - {967 ,"Yemen"}, - {38 ,"Yugoslavia"}, /* added for old values like birth-country */ - {381 ,"Serbia, Republic of"}, /* rename need (from Yugoslavia)*/ - {383 ,"Kosovo, Republic of"}, /*change country code (from 3811), rename need (from Yugoslavia - Serbia) */ - {382 ,"Montenegro, Republic of"}, /* rename need (from Yugoslavia - Montenegro) */ - {260 ,"Zambia"}, - {263 ,"Zimbabwe"}, + {0 , "Unspecified"}, + {9999, "Other"}, + {0xFFFF, "Unknown"}, + {93 , "Afghanistan"}, + {355 , "Albania"}, + {213 , "Algeria"}, + {376 , "Andorra"}, + {244 , "Angola"}, + {1264, "Anguilla"}, /* change county code to NANP (from 101) */ + {1268, "Antigua and Barbuda"}, /* change county code to NANP (from 1021) */ +// {5902, "Antilles"}, /* removed: it is not a country, it's a group of islands from diffrent countries (all are included in the list)*/ + {54 , "Argentina"}, + {374 , "Armenia"}, + {297 , "Aruba"}, + {247 , "Ascension Island"}, + {61 , "Australia"}, + {6720 , "Australia, Antarctic Territory"}, /* added country code 672(0)*/ + {614 , "Australia, Christmas Island"}, /* rename (from Christmas Island) and change to official county code 61(4) (from 672) */ + {61891, "Australia, Cocos (Keeling) Islands"}, /* rename and change to official county code 61(891) (from 6102) */ + {6723 , "Australia, Norfolk Island"}, /* rename (from Norfolk Island) and change to official county code 672(3) (from 6722) */ + {43 , "Austria"}, + {994 , "Azerbaijan"}, + {1242, "Bahamas"}, /* change county code to NANP (from 103) */ + {973 , "Bahrain"}, + {880 , "Bangladesh"}, + {1246, "Barbados"}, /* change county code to NANP (from 103) */ +// {120 , "Barbuda"}, /* removed: it is not a country and no special island, see Antigua and Barbuda*/ + {375 , "Belarus"}, + {32 , "Belgium"}, + {501 , "Belize"}, + {229 , "Benin"}, + {1441, "Bermuda"}, /* change county code to NANP (from 105) */ + {975 , "Bhutan"}, + {591 , "Bolivia"}, + {387 , "Bosnia and Herzegovina"}, + {267 , "Botswana"}, + {55 , "Brazil"}, + {673 , "Brunei"}, + {359 , "Bulgaria"}, + {226 , "Burkina Faso"}, + {257 , "Burundi"}, + {855 , "Cambodia"}, + {237 , "Cameroon"}, + {1002, "Canada"}, /* change county code to NANP (from 107 to virtual 1(002) -> reflect NANP*/ + {238 , "Cape Verde Islands"}, + {1345, "Cayman Islands"}, /* change county code to NANP (from 108) */ + {236 , "Central African Republic"}, + {235 , "Chad"}, + {56 , "Chile, Republic of"}, + {86 , "China"}, +// {6101, "Cocos-Keeling Islands"}, /* removed (double): see Australia, Cocos (Keeling) Islands */ + {57 , "Colombia"}, + {269 , "Comoros"}, /* change county code (from 2691) */ + {243 , "Congo, Democratic Republic of (Zaire)"}, + {242 , "Congo, Republic of the"}, + {682 , "Cook Islands"}, + {506 , "Costa Rica"}, + {225 , "Cote d'Ivoire (Ivory Coast)"}, + {385 , "Croatia"}, + {53 , "Cuba"}, + {357 , "Greek, Republic of South Cyprus"}, /* rename coz Turkey, Republic of Northern Cyprus */ + {420 , "Czech Republic"}, + {45 , "Denmark"}, + {246 , "Diego Garcia"}, + {253 , "Djibouti"}, + {1767, "Dominica"}, /* change county code to NANP (from 109) */ + {1809, "Dominican Republic"}, /* change county code to NANP 809, 829, 849 (from 110) */ + {593 , "Ecuador"}, + {20 , "Egypt"}, + {503 , "El Salvador"}, + {240 , "Equatorial Guinea"}, + {291 , "Eritrea"}, + {372 , "Estonia"}, + {251 , "Ethiopia"}, + {3883, "Europe"}, /* add county code +388 3 official European Telephony Numbering Space*/ + {298 , "Faeroe Islands"}, + {500 , "Falkland Islands"}, + {679 , "Fiji"}, + {358 , "Finland"}, + {33 , "France"}, + {5901, "French Antilles"}, + {594 , "French Guiana"}, + {689 , "French Polynesia"}, + {241 , "Gabon"}, + {220 , "Gambia"}, + {995 , "Georgia"}, + {49 , "Germany"}, + {233 , "Ghana"}, + {350 , "Gibraltar"}, + {30 , "Greece"}, + {299 , "Greenland"}, + {1473, "Grenada"}, /* change county code to NANP (from 111) */ + {590 , "Guadeloupe"}, + {1671, "Guam, US Territory of"}, /* change county code to NANP (from 671) */ + {502 , "Guatemala"}, + {224 , "Guinea"}, + {245 , "Guinea-Bissau"}, + {592 , "Guyana"}, + {509 , "Haiti"}, + {504 , "Honduras"}, + {852 , "Hong Kong"}, + {36 , "Hungary"}, + {354 , "Iceland"}, + {91 , "India"}, + {62 , "Indonesia"}, + {98 , "Iran (Islamic Republic of)"}, + {964 , "Iraq"}, + {353 , "Ireland"}, + {972 , "Israel"}, + {39 , "Italy"}, + {1876, "Jamaica"}, /* change county code to NANP (from 112) */ + {81 , "Japan"}, + {962 , "Jordan"}, + {705 , "Kazakhstan"}, + {254 , "Kenya"}, + {686 , "Kiribati"}, + {850 , "Korea, North"}, + {82 , "Korea, South"}, + {965 , "Kuwait"}, + {996 , "Kyrgyzstan"}, /* change county code (from 706) */ + {856 , "Laos"}, + {371 , "Latvia"}, + {961 , "Lebanon"}, + {266 , "Lesotho"}, + {231 , "Liberia"}, + {218 , "Libyan Arab Jamahiriya"}, + {423 , "Liechtenstein"}, /* change county code (from 4101) */ + {370 , "Lithuania"}, + {352 , "Luxembourg"}, + {853 , "Macau"}, + {389 , "Macedonia, Republic of"}, /* rename coz war */ + {261 , "Madagascar"}, + {265 , "Malawi"}, + {60 , "Malaysia"}, + {960 , "Maldives"}, + {223 , "Mali"}, + {356 , "Malta"}, + {692 , "Marshall Islands"}, + {596 , "Martinique"}, + {222 , "Mauritania"}, + {230 , "Mauritius"}, + {262 , "Mayotte Island"}, /* change county code coz bug (from 269) */ + {52 , "Mexico"}, + {691 , "Micronesia, Federated States of"}, + {373 , "Moldova, Republic of"}, + {377 , "Monaco"}, + {976 , "Mongolia"}, + {1664, "Montserrat"}, /* change county code to NANP (from 113) */ + {212 , "Morocco"}, + {258 , "Mozambique"}, + {95 , "Myanmar"}, + {264 , "Namibia"}, + {674 , "Nauru"}, + {977 , "Nepal"}, + {31 , "Netherlands"}, + {599 , "Netherlands Antilles"}, /* dissolved 2010 */ + {5995 , "St. Maarten"}, /* add new country in 2010 (from Netherlands Antilles) */ + {5999 , "Curacao"}, /* add new country in 2010 (from Netherlands Antilles) */ + {5997 , "Netherlands (Bonaire Island)"}, /* add new Part of Netherlands in 2010 (from Netherlands Antilles) */ + {59946, "Netherlands (Saba Island)"}, /* add new Part of Netherlands in 2010 (from Netherlands Antilles) */ + {59938, "Netherlands (St. Eustatius Island)"}, /* add new Part of Netherlands in 2010 (from Netherlands Antilles) */ + // {114 , "Nevis"}, /* removed: it is not a country, it's part of Saint Kitts and Nevis*/ + {687 , "New Caledonia"}, + {64 , "New Zealand"}, + {505 , "Nicaragua"}, + {227 , "Niger"}, + {234 , "Nigeria"}, + {683 , "Niue"}, + {1670, "Northern Mariana Islands, US Territory of"}, /* added NANP */ + {47 , "Norway"}, + {968 , "Oman"}, + {92 , "Pakistan"}, + {680 , "Palau"}, + {507 , "Panama"}, + {675 , "Papua New Guinea"}, + {595 , "Paraguay"}, + {51 , "Peru"}, + {63 , "Philippines"}, + {48 , "Poland"}, + {351 , "Portugal"}, + {1939, "Puerto Rico"}, /* change county code to NANP 939, 787 (from 121) */ + {974 , "Qatar"}, + {262 , "Reunion Island"}, + {40 , "Romania"}, +// {6701, "Rota Island"}, /* removed: it is not a country it is part of Northern Mariana Islands, US Territory of */ + {7 , "Russia"}, + {250 , "Rwanda"}, + {1684, "Samoa (USA)"}, /* rename (from American Samoa) change county code to NANP (from 684) */ + {685 , "Samoa, Western"}, /* rename (from Western Samoa) */ + {290 , "Saint Helena"}, +// {115 , "Saint Kitts"}, /* removed: it is not a country it is part of Saint Kitts and Nevis*/ + {1869, "Saint Kitts and Nevis"}, /* change county code to NANP (from 1141) */ + {1758, "Saint Lucia"}, /* change county code to NANP (from 122) */ + {508 , "Saint Pierre and Miquelon"}, + {1784, "Saint Vincent and the Grenadines"}, /* change county code to NANP (from 116) */ +// {670 , "Saipan Island"}, /* removed: it is not a country it is part of Northern Mariana Islands, US Territory of */ + {378 , "San Marino"}, + {239 , "Sao Tome and Principe"}, + {966 , "Saudi Arabia"}, + {442 , "Scotland"}, + {221 , "Senegal"}, + {248 , "Seychelles"}, + {232 , "Sierra Leone"}, + {65 , "Singapore"}, + {421 , "Slovakia"}, + {386 , "Slovenia"}, + {677 , "Solomon Islands"}, + {252 , "Somalia"}, + {27 , "South Africa"}, + {34 , "Spain"}, + {3492, "Spain, Canary Islands"}, /*rename and change county code to 34(92) spain + canary code*/ + {94 , "Sri Lanka"}, + {249 , "Sudan"}, + {597 , "Suriname"}, + {268 , "Swaziland"}, + {46 , "Sweden"}, + {41 , "Switzerland"}, + {963 , "Syrian Arab Republic"}, + {886 , "Taiwan"}, + {992 , "Tajikistan"}, /* change county code (from 708) */ + {255 , "Tanzania"}, + {66 , "Thailand"}, +// {6702, "Tinian Island"}, /* removed: it is not a country it is part of Northern Mariana Islands, US Territory of */ + {670 , "Timor, East"}, /* added (is part off Northern Mariana Islands but not US Territory*/ + {228 , "Togo"}, + {690 , "Tokelau"}, + {676 , "Tonga"}, + {1868, "Trinidad and Tobago"}, /* change county code to NANP (from 1141) */ + {216 , "Tunisia"}, + {90 , "Turkey"}, + {90392, "Turkey, Republic of Northern Cyprus"}, /* added (is diffrent from Greek part)*/ + {993 , "Turkmenistan"}, /* change county code (from 709) */ + {1649, "Turks and Caicos Islands"}, /* change county code to NANP (from 118) */ + {688 , "Tuvalu"}, + {256 , "Uganda"}, + {380 , "Ukraine"}, + {971 , "United Arab Emirates"}, + {44 , "United Kingdom"}, + {598 , "Uruguay"}, + {1 , "USA"}, + {998 , "Uzbekistan"}, /* change county code (from 711) */ + {678 , "Vanuatu"}, + {379 , "Vatican City"}, + {58 , "Venezuela"}, + {84 , "Vietnam"}, + {1284, "Virgin Islands (UK)"}, /* change county code to NANP (from 105) - rename coz Virgin Islands (USA) */ + {1340, "Virgin Islands (USA)"}, /* change county code to NANP (from 123) */ + {441 , "Wales"}, + {681 , "Wallis and Futuna Islands"}, + {967 , "Yemen"}, + {38 , "Yugoslavia"}, /* added for old values like birth-country */ + {381 , "Serbia, Republic of"}, /* rename need (from Yugoslavia)*/ + {383 , "Kosovo, Republic of"}, /*change country code (from 3811), rename need (from Yugoslavia - Serbia) */ + {382 , "Montenegro, Republic of"}, /* rename need (from Yugoslavia - Montenegro) */ + {260 , "Zambia"}, + {263 , "Zimbabwe"}, }; static INT_PTR GetCountryByNumber(WPARAM wParam, LPARAM) @@ -306,7 +306,7 @@ static INT_PTR GetCountryByNumber(WPARAM wParam, LPARAM) return (INT_PTR)NULL; } -static INT_PTR GetCountryList(WPARAM wParam,LPARAM lParam) +static INT_PTR GetCountryList(WPARAM wParam, LPARAM lParam) { *(int*)wParam = SIZEOF(countries); *(struct CountryListEntry**)lParam=countries; @@ -322,15 +322,15 @@ static INT_PTR SaveWindowPosition(WPARAM, LPARAM lParam) char szSettingName[64]; wp.length=sizeof(wp); - GetWindowPlacement(swp->hwnd,&wp); + GetWindowPlacement(swp->hwnd, &wp); mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sx", swp->szNamePrefix); - DBWriteContactSettingDword(swp->hContact,swp->szModule,szSettingName,wp.rcNormalPosition.left); + DBWriteContactSettingDword(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.left); mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sy", swp->szNamePrefix); - DBWriteContactSettingDword(swp->hContact,swp->szModule,szSettingName,wp.rcNormalPosition.top); + DBWriteContactSettingDword(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.top); mir_snprintf(szSettingName, SIZEOF(szSettingName), "%swidth", swp->szNamePrefix); - DBWriteContactSettingDword(swp->hContact,swp->szModule,szSettingName,wp.rcNormalPosition.right-wp.rcNormalPosition.left); + DBWriteContactSettingDword(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.right-wp.rcNormalPosition.left); mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sheight", swp->szNamePrefix); - DBWriteContactSettingDword(swp->hContact,swp->szModule,szSettingName,wp.rcNormalPosition.bottom-wp.rcNormalPosition.top); + DBWriteContactSettingDword(swp->hContact, swp->szModule, szSettingName, wp.rcNormalPosition.bottom-wp.rcNormalPosition.top); return 0; } @@ -375,30 +375,30 @@ static INT_PTR AssertInsideScreen(WPARAM wParam, LPARAM lParam) } -static INT_PTR RestoreWindowPosition(WPARAM wParam,LPARAM lParam) +static INT_PTR RestoreWindowPosition(WPARAM wParam, LPARAM lParam) { SAVEWINDOWPOS *swp=(SAVEWINDOWPOS*)lParam; WINDOWPLACEMENT wp; char szSettingName[64]; - int x,y; + int x, y; wp.length=sizeof(wp); - GetWindowPlacement(swp->hwnd,&wp); + GetWindowPlacement(swp->hwnd, &wp); mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sx", swp->szNamePrefix); - x=DBGetContactSettingDword(swp->hContact,swp->szModule,szSettingName,-1); + x=DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1); mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sy", swp->szNamePrefix); - y=(int)DBGetContactSettingDword(swp->hContact,swp->szModule,szSettingName,-1); + y=(int)DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1); if (x == -1) return 1; if (wParam&RWPF_NOSIZE) { - OffsetRect(&wp.rcNormalPosition,x-wp.rcNormalPosition.left,y-wp.rcNormalPosition.top); + OffsetRect(&wp.rcNormalPosition, x-wp.rcNormalPosition.left, y-wp.rcNormalPosition.top); } else { wp.rcNormalPosition.left=x; wp.rcNormalPosition.top=y; mir_snprintf(szSettingName, SIZEOF(szSettingName), "%swidth", swp->szNamePrefix); - wp.rcNormalPosition.right=wp.rcNormalPosition.left+DBGetContactSettingDword(swp->hContact,swp->szModule,szSettingName,-1); + wp.rcNormalPosition.right=wp.rcNormalPosition.left+DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1); mir_snprintf(szSettingName, SIZEOF(szSettingName), "%sheight", swp->szNamePrefix); - wp.rcNormalPosition.bottom=wp.rcNormalPosition.top+DBGetContactSettingDword(swp->hContact,swp->szModule,szSettingName,-1); + wp.rcNormalPosition.bottom=wp.rcNormalPosition.top+DBGetContactSettingDword(swp->hContact, swp->szModule, szSettingName, -1); } wp.flags=0; if (wParam & RWPF_HIDDEN) @@ -409,7 +409,7 @@ static INT_PTR RestoreWindowPosition(WPARAM wParam,LPARAM lParam) if (!(wParam & RWPF_NOMOVE)) AssertInsideScreen((WPARAM) &wp.rcNormalPosition, 0); - SetWindowPlacement(swp->hwnd,&wp); + SetWindowPlacement(swp->hwnd, &wp); return 0; } @@ -558,16 +558,16 @@ int LoadUtilsModule(void) { bModuleInitialized = TRUE; - CreateServiceFunction(MS_UTILS_RESIZEDIALOG,ResizeDialog); - CreateServiceFunction(MS_UTILS_SAVEWINDOWPOSITION,SaveWindowPosition); - CreateServiceFunction(MS_UTILS_RESTOREWINDOWPOSITION,RestoreWindowPosition); - CreateServiceFunction(MS_UTILS_ASSERTINSIDESCREEN,AssertInsideScreen); - CreateServiceFunction(MS_UTILS_GETCOUNTRYBYNUMBER,GetCountryByNumber); - CreateServiceFunction(MS_UTILS_GETCOUNTRYLIST,GetCountryList); - CreateServiceFunction(MS_UTILS_GETRANDOM,GenerateRandom); - CreateServiceFunction(MS_SYSTEM_RESTART,RestartMiranda); - CreateServiceFunction(MS_SYSTEM_GET_MD5I,GetMD5Interface); - CreateServiceFunction(MS_SYSTEM_GET_SHA1I,GetSHA1Interface); + CreateServiceFunction(MS_UTILS_RESIZEDIALOG, ResizeDialog); + CreateServiceFunction(MS_UTILS_SAVEWINDOWPOSITION, SaveWindowPosition); + CreateServiceFunction(MS_UTILS_RESTOREWINDOWPOSITION, RestoreWindowPosition); + CreateServiceFunction(MS_UTILS_ASSERTINSIDESCREEN, AssertInsideScreen); + CreateServiceFunction(MS_UTILS_GETCOUNTRYBYNUMBER, GetCountryByNumber); + CreateServiceFunction(MS_UTILS_GETCOUNTRYLIST, GetCountryList); + CreateServiceFunction(MS_UTILS_GETRANDOM, GenerateRandom); + CreateServiceFunction(MS_SYSTEM_RESTART, RestartMiranda); + CreateServiceFunction(MS_SYSTEM_GET_MD5I, GetMD5Interface); + CreateServiceFunction(MS_SYSTEM_GET_SHA1I, GetSHA1Interface); InitOpenUrl(); InitWindowList(); InitHyperlink(); diff --git a/src/modules/utils/windowlist.cpp b/src/modules/utils/windowlist.cpp index e67f13c5e8..059d3dd1d7 100644 --- a/src/modules/utils/windowlist.cpp +++ b/src/modules/utils/windowlist.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-2009 Miranda ICQ/IM project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -33,24 +33,24 @@ static INT_PTR AllocWindowList(WPARAM, LPARAM) static INT_PTR AddToWindowList(WPARAM, LPARAM lParam) { - windowList=(WINDOWLISTENTRY*)mir_realloc(windowList,sizeof(WINDOWLISTENTRY)*(windowListCount+1)); + windowList=(WINDOWLISTENTRY*)mir_realloc(windowList, sizeof(WINDOWLISTENTRY)*(windowListCount+1)); windowList[windowListCount++]=*(WINDOWLISTENTRY*)lParam; return 0; } -static INT_PTR RemoveFromWindowList(WPARAM wParam,LPARAM lParam) +static INT_PTR RemoveFromWindowList(WPARAM wParam, LPARAM lParam) { int i; for (i=0;imessage,msg->wParam,msg->lParam); + SendMessage(windowList[i].hwnd, msg->message, msg->wParam, msg->lParam); return 0; } -static INT_PTR BroadcastToWindowListAsync(WPARAM wParam,LPARAM lParam) +static INT_PTR BroadcastToWindowListAsync(WPARAM wParam, LPARAM lParam) { int i; MSG *msg=(MSG*)lParam; for (i=0;imessage,msg->wParam,msg->lParam); + PostMessage(windowList[i].hwnd, msg->message, msg->wParam, msg->lParam); return 0; } int InitWindowList(void) { - CreateServiceFunction(MS_UTILS_ALLOCWINDOWLIST,AllocWindowList); - CreateServiceFunction(MS_UTILS_ADDTOWINDOWLIST,AddToWindowList); - CreateServiceFunction(MS_UTILS_REMOVEFROMWINDOWLIST,RemoveFromWindowList); - CreateServiceFunction(MS_UTILS_BROADCASTTOWINDOWLIST,BroadcastToWindowList); - CreateServiceFunction(MS_UTILS_BROADCASTTOWINDOWLIST_ASYNC,BroadcastToWindowListAsync); - CreateServiceFunction(MS_UTILS_FINDWINDOWINLIST,FindInWindowList); + CreateServiceFunction(MS_UTILS_ALLOCWINDOWLIST, AllocWindowList); + CreateServiceFunction(MS_UTILS_ADDTOWINDOWLIST, AddToWindowList); + CreateServiceFunction(MS_UTILS_REMOVEFROMWINDOWLIST, RemoveFromWindowList); + CreateServiceFunction(MS_UTILS_BROADCASTTOWINDOWLIST, BroadcastToWindowList); + CreateServiceFunction(MS_UTILS_BROADCASTTOWINDOWLIST_ASYNC, BroadcastToWindowListAsync); + CreateServiceFunction(MS_UTILS_FINDWINDOWINLIST, FindInWindowList); return 0; } -- cgit v1.2.3