summaryrefslogtreecommitdiff
path: root/plugins/SmileyAdd/src/smltool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SmileyAdd/src/smltool.cpp')
-rw-r--r--plugins/SmileyAdd/src/smltool.cpp246
1 files changed, 115 insertions, 131 deletions
diff --git a/plugins/SmileyAdd/src/smltool.cpp b/plugins/SmileyAdd/src/smltool.cpp
index a4a2e41d22..c7eb03ff81 100644
--- a/plugins/SmileyAdd/src/smltool.cpp
+++ b/plugins/SmileyAdd/src/smltool.cpp
@@ -77,7 +77,7 @@ LRESULT CALLBACK DlgProcSmileyToolWindow(HWND hwndDlg, UINT msg, WPARAM wParam,
SmileyToolWindowType *pOD = (SmileyToolWindowType*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (pOD == NULL) {
pOD = new SmileyToolWindowType(hwndDlg);
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) pOD);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)pOD);
}
LRESULT Result = pOD->DialogProcedure(msg, wParam, lParam);
@@ -91,11 +91,11 @@ LRESULT CALLBACK DlgProcSmileyToolWindow(HWND hwndDlg, UINT msg, WPARAM wParam,
}
-SmileyToolWindowType::SmileyToolWindowType(HWND hWnd)
-{
- m_hwndDialog = hWnd;
- rowSel = -1;
- m_AniPack = NULL;
+SmileyToolWindowType::SmileyToolWindowType(HWND hWnd)
+{
+ m_hwndDialog = hWnd;
+ rowSel = -1;
+ m_AniPack = NULL;
m_NumberOfVerticalButtons = 0;
m_NumberOfHorizontalButtons = 0;
@@ -114,7 +114,7 @@ LRESULT SmileyToolWindowType::DialogProcedure(UINT msg, WPARAM wParam, LPARAM lP
switch (msg) {
case WM_ACTIVATE:
- if (wParam == WA_INACTIVE)
+ if (wParam == WA_INACTIVE)
DestroyWindow(m_hwndDialog);
break;
@@ -132,7 +132,7 @@ LRESULT SmileyToolWindowType::DialogProcedure(UINT msg, WPARAM wParam, LPARAM lP
m_AniPack = NULL;
DestroyWindow(m_hToolTip);
PostQuitMessage(0);
- if (m_Choosing)
+ if (m_Choosing)
SetFocus(m_hWndTarget);
break;
@@ -157,7 +157,7 @@ LRESULT SmileyToolWindowType::DialogProcedure(UINT msg, WPARAM wParam, LPARAM lP
break;
case WM_MOUSEWHEEL:
- ScrollV(SB_MYMOVE, ((short)HIWORD(wParam))/-120);
+ ScrollV(SB_MYMOVE, ((short)HIWORD(wParam)) / -120);
MouseMove(LOWORD(lParam), HIWORD(lParam));
break;
@@ -172,7 +172,9 @@ LRESULT SmileyToolWindowType::DialogProcedure(UINT msg, WPARAM wParam, LPARAM lP
struct smlsrvstruct
{
smlsrvstruct(SmileyType *tsml, MCONTACT thContact)
- : sml(tsml), hContact(thContact) {}
+ : sml(tsml), hContact(thContact)
+ {
+ }
SmileyType *sml;
MCONTACT hContact;
};
@@ -200,7 +202,7 @@ void SmileyToolWindowType::InsertSmiley(void)
insertText += sml->GetInsertText();
if (opt.SurroundSmileyWithSpaces) insertText += ' ';
- SendMessage(m_hWndTarget, m_TargetMessage, m_TargetWParam, (LPARAM) insertText.c_str());
+ SendMessage(m_hWndTarget, m_TargetMessage, m_TargetWParam, (LPARAM)insertText.c_str());
}
m_Choosing = true;
DestroyWindow(m_hwndDialog);
@@ -212,11 +214,11 @@ void SmileyToolWindowType::InsertSmiley(void)
void SmileyToolWindowType::SmileySel(int but)
{
if (but != m_CurrentHotTrack) {
- SCROLLINFO si;
- si.cbSize = sizeof (si);
- si.fMask = SIF_POS;
+ SCROLLINFO si;
+ si.cbSize = sizeof(si);
+ si.fMask = SIF_POS;
si.nPos = 0;
- GetScrollInfo (m_hwndDialog, SB_VERT, &si);
+ GetScrollInfo(m_hwndDialog, SB_VERT, &si);
HDC hdc = GetDC(m_hwndDialog);
if (m_CurrentHotTrack >= 0) {
@@ -227,14 +229,14 @@ void SmileyToolWindowType::SmileySel(int but)
}
m_CurrentHotTrack = but;
if (m_CurrentHotTrack >= 0) {
- TOOLINFO ti = {0};
+ TOOLINFO ti = { 0 };
ti.cbSize = sizeof(ti);
ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
ti.hwnd = m_hwndDialog;
ti.uId = (UINT_PTR)m_hwndDialog;
const CMString& toolText = m_pSmileyPack->GetSmiley(m_CurrentHotTrack)->GetToolText();
- ti.lpszText = const_cast<TCHAR*>(toolText.c_str());
+ ti.lpszText = const_cast<TCHAR*>(toolText.c_str());
SendMessage(m_hToolTip, TTM_UPDATETIPTEXT, 0, (LPARAM)&ti);
SendMessage(m_hToolTip, TTM_ACTIVATE, TRUE, 0);
@@ -248,51 +250,51 @@ void SmileyToolWindowType::SmileySel(int but)
void SmileyToolWindowType::ScrollV(int action, int dist)
-{
- SCROLLINFO si;
- si.cbSize = sizeof (si);
- si.fMask = SIF_ALL;
- GetScrollInfo (m_hwndDialog, SB_VERT, &si);
+{
+ SCROLLINFO si;
+ si.cbSize = sizeof(si);
+ si.fMask = SIF_ALL;
+ GetScrollInfo(m_hwndDialog, SB_VERT, &si);
// Save the position for comparison later on
int yPos = si.nPos;
switch (action) {
- // user clicked the HOME keyboard key
+ // user clicked the HOME keyboard key
case SB_TOP:
si.nPos = si.nMin;
break;
- // user clicked the END keyboard key
+ // user clicked the END keyboard key
case SB_BOTTOM:
si.nPos = si.nMax;
break;
- // user clicked the top arrow
+ // user clicked the top arrow
case SB_LINEUP:
si.nPos -= 1;
break;
- // user clicked the bottom arrow
+ // user clicked the bottom arrow
case SB_LINEDOWN:
si.nPos += 1;
break;
- // user clicked the scroll bar shaft above the scroll box
+ // user clicked the scroll bar shaft above the scroll box
case SB_PAGEUP:
si.nPos -= si.nPage;
break;
- // user clicked the scroll bar shaft below the scroll box
+ // user clicked the scroll bar shaft below the scroll box
case SB_PAGEDOWN:
si.nPos += si.nPage;
break;
- // user dragged the scroll box
+ // user dragged the scroll box
case SB_THUMBTRACK:
si.nPos = si.nTrackPos;
break;
- // user dragged the scroll box
+ // user dragged the scroll box
case SB_MYMOVE:
si.nPos += dist;
break;
@@ -300,19 +302,19 @@ void SmileyToolWindowType::ScrollV(int action, int dist)
// Set the position and then retrieve it. Due to adjustments
// by Windows it may not be the same as the value set.
si.fMask = SIF_POS;
- SetScrollInfo (m_hwndDialog, SB_VERT, &si, TRUE);
- GetScrollInfo (m_hwndDialog, SB_VERT, &si);
+ SetScrollInfo(m_hwndDialog, SB_VERT, &si, TRUE);
+ GetScrollInfo(m_hwndDialog, SB_VERT, &si);
// If the position has changed, scroll window and update it
- if (si.nPos != yPos) {
+ if (si.nPos != yPos) {
if (m_AniPack)
m_AniPack->SetOffset(si.nPos*GetRowSize());
- ScrollWindowEx(m_hwndDialog, 0, (yPos - si.nPos) * GetRowSize(),
+ ScrollWindowEx(m_hwndDialog, 0, (yPos - si.nPos) * GetRowSize(),
NULL, NULL, NULL, NULL, SW_INVALIDATE);
- UpdateWindow (m_hwndDialog);
+ UpdateWindow(m_hwndDialog);
}
-}
+}
void SmileyToolWindowType::MouseMove(int xposition, int yposition)
@@ -321,13 +323,13 @@ void SmileyToolWindowType::MouseMove(int xposition, int yposition)
// SetFocus(m_hwndDialog);
- SCROLLINFO si;
- si.cbSize = sizeof (si);
- si.fMask = SIF_POS;
+ SCROLLINFO si;
+ si.cbSize = sizeof(si);
+ si.fMask = SIF_POS;
si.nPos = 0;
- GetScrollInfo (m_hwndDialog, SB_VERT, &si);
+ GetScrollInfo(m_hwndDialog, SB_VERT, &si);
- POINT pt = { xposition, yposition };
+ POINT pt = { xposition, yposition };
int but = CalculateCoordinatesToButton(pt, si.nPos);
SmileySel(but);
}
@@ -339,10 +341,9 @@ void SmileyToolWindowType::KeyUp(WPARAM wParam, LPARAM lParam)
int colSel = -1, numKey = -1;
int but = m_CurrentHotTrack;
- switch(wParam)
- {
+ switch (wParam) {
case VK_END:
- but = m_NumberOfButtons-1;
+ but = m_NumberOfButtons - 1;
break;
case VK_HOME:
@@ -383,10 +384,9 @@ void SmileyToolWindowType::KeyUp(WPARAM wParam, LPARAM lParam)
case VK_NUMPAD7:
case VK_NUMPAD8:
case VK_NUMPAD9:
- if ((GetKeyState(VK_NUMLOCK) & 1) != 0)
+ if ((GetKeyState(VK_NUMLOCK) & 1) != 0)
numKey = (int)wParam - VK_NUMPAD1;
- else
- {
+ else {
rowSel = -1;
return;
}
@@ -410,7 +410,7 @@ void SmileyToolWindowType::KeyUp(WPARAM wParam, LPARAM lParam)
}
if (numKey != -1) {
- if (rowSel == -1) {
+ if (rowSel == -1) {
rowSel = numKey;
but = (opt.HorizontalSorting ? m_NumberOfHorizontalButtons : 1) * rowSel;
}
@@ -424,7 +424,7 @@ void SmileyToolWindowType::KeyUp(WPARAM wParam, LPARAM lParam)
}
if (but < 0) but = 0;
- if (but >= (int)m_NumberOfButtons) but = m_NumberOfButtons-1;
+ if (but >= (int)m_NumberOfButtons) but = m_NumberOfButtons - 1;
SmileySel(but);
if (colSel != -1)
@@ -435,7 +435,7 @@ void SmileyToolWindowType::KeyUp(WPARAM wParam, LPARAM lParam)
void SmileyToolWindowType::InitDialog(LPARAM lParam)
{
LPCREATESTRUCT createStruct = (LPCREATESTRUCT)lParam;
- SmileyToolWindowParam* stwp = (SmileyToolWindowParam*) createStruct->lpCreateParams;
+ SmileyToolWindowParam* stwp = (SmileyToolWindowParam*)createStruct->lpCreateParams;
m_pSmileyPack = stwp->pSmileyPack;
m_XPosition = stwp->xPosition;
@@ -452,41 +452,41 @@ void SmileyToolWindowType::InitDialog(LPARAM lParam)
CreateSmileyWinDim();
int width = m_BitmapWidth.cx;
- int height = m_BitmapWidth.cy;
+ int height = m_BitmapWidth.cy;
- const int colsz = GetRowSize();
+ const int colsz = GetRowSize();
const int heightn = m_WindowSizeY;
SCROLLINFO si;
- si.cbSize = sizeof(si);
- si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS;
- si.nMin = 0;
- si.nMax = height / colsz - 1;
- si.nPage = heightn / colsz;
- si.nPos = 0;
- SetScrollInfo(m_hwndDialog, SB_VERT, &si, TRUE);
+ si.cbSize = sizeof(si);
+ si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS;
+ si.nMin = 0;
+ si.nMax = height / colsz - 1;
+ si.nPage = heightn / colsz;
+ si.nPos = 0;
+ SetScrollInfo(m_hwndDialog, SB_VERT, &si, TRUE);
if (GetWindowLongPtr(m_hwndDialog, GWL_STYLE) & WS_VSCROLL)
width += GetSystemMetrics(SM_CXVSCROLL);
RECT rc = { 0, 0, width, heightn };
- AdjustWindowRectEx(&rc, GetWindowLongPtr(m_hwndDialog, GWL_STYLE),
+ AdjustWindowRectEx(&rc, GetWindowLongPtr(m_hwndDialog, GWL_STYLE),
FALSE, GetWindowLongPtr(m_hwndDialog, GWL_EXSTYLE));
width = rc.right - rc.left;
- height = rc.bottom - rc.top;
+ height = rc.bottom - rc.top;
switch (m_Direction) {
- case 1:
- m_XPosition-=width;
+ case 1:
+ m_XPosition -= width;
break;
case 2:
- m_XPosition-=width;
- m_YPosition-=height;
+ m_XPosition -= width;
+ m_YPosition -= height;
break;
case 3:
- m_YPosition-=height;
+ m_YPosition -= height;
break;
}
@@ -505,18 +505,18 @@ void SmileyToolWindowType::InitDialog(LPARAM lParam)
// Prevent window from opening off-screen
if (m_YPosition + height > yScreen) m_YPosition = yScreen - height;
- if (m_XPosition + width > xScreen) m_XPosition = xScreen - width;
+ if (m_XPosition + width > xScreen) m_XPosition = xScreen - width;
if (m_YPosition < yoScreen) m_YPosition = yoScreen;
if (m_XPosition < xoScreen) m_XPosition = xoScreen;
// Move window to desired location
- SetWindowPos(m_hwndDialog, NULL, m_XPosition, m_YPosition,
+ SetWindowPos(m_hwndDialog, NULL, m_XPosition, m_YPosition,
width, height, SWP_NOZORDER);
m_AniPack = new AnimatedPack(m_hwndDialog, height, m_ButtonSize, opt.SelWndBkgClr);
SmileyPackType::SmileyVectorType &sml = m_pSmileyPack->GetSmileyList();
- for (unsigned i=0; i<m_NumberOfButtons; i++)
+ for (unsigned i = 0; i < m_NumberOfButtons; i++)
if (!sml[i].IsHidden())
m_AniPack->Add(&sml[i], CalculateButtonToCoordinates(i, 0), opt.IEViewStyle);
@@ -525,9 +525,9 @@ void SmileyToolWindowType::InitDialog(LPARAM lParam)
if (opt.AnimateSel) SetTimer(m_hwndDialog, 1, 100, NULL);
//add tooltips
- m_hToolTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, _T(""),
+ m_hToolTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, _T(""),
TTS_NOPREFIX | WS_POPUP, 0, 0, 0, 0, m_hwndDialog, NULL, g_hInst, NULL);
- TOOLINFO ti = {0};
+ TOOLINFO ti = { 0 };
ti.cbSize = sizeof(ti);
ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
ti.hwnd = m_hwndDialog;
@@ -540,13 +540,13 @@ void SmileyToolWindowType::InitDialog(LPARAM lParam)
void SmileyToolWindowType::PaintWindow(void)
{
SCROLLINFO si;
- si.cbSize = sizeof(si);
- si.fMask = SIF_POS;
+ si.cbSize = sizeof(si);
+ si.fMask = SIF_POS;
si.nPos = 0;
GetScrollInfo(m_hwndDialog, SB_VERT, &si);
- PAINTSTRUCT ps;
- HDC hdc = BeginPaint(m_hwndDialog, &ps);
+ PAINTSTRUCT ps;
+ HDC hdc = BeginPaint(m_hwndDialog, &ps);
HBITMAP hBmp = CreateCompatibleBitmap(hdc, m_BitmapWidth.cx, m_BitmapWidth.cy);
HDC hdcMem = CreateCompatibleDC(hdc);
@@ -559,14 +559,14 @@ void SmileyToolWindowType::PaintWindow(void)
BitBlt(hdc, 0, 0, m_BitmapWidth.cx, m_WindowSizeY, hdcMem, 0, 0, SRCCOPY);
- SelectObject(hdcMem, hOld);
- DeleteObject(hBmp);
+ SelectObject(hdcMem, hOld);
+ DeleteObject(hBmp);
DeleteDC(hdcMem);
if (m_CurrentHotTrack == -2)
m_CurrentHotTrack = -1;
- EndPaint(m_hwndDialog, &ps);
+ EndPaint(m_hwndDialog, &ps);
}
@@ -577,20 +577,16 @@ void SmileyToolWindowType::CreateSmileyWinDim(void)
if (m_NumberOfButtons == 0) return;
// Find largest smiley
- if (m_pSmileyPack->selec.x == 0 || m_pSmileyPack->selec.y == 0)
- {
- if (opt.ScaleAllSmileys)
- {
+ if (m_pSmileyPack->selec.x == 0 || m_pSmileyPack->selec.y == 0) {
+ if (opt.ScaleAllSmileys) {
m_pSmileyPack->GetSmiley(0)->GetSize(m_ButtonSize);
- ++m_ButtonSize.cx; ++m_ButtonSize.cy;
+ ++m_ButtonSize.cx; ++m_ButtonSize.cy;
}
- else
- {
+ else {
m_ButtonSize.cx = 0;
m_ButtonSize.cy = 0;
SmileyPackType::SmileyVectorType &sml = m_pSmileyPack->GetSmileyList();
- for (unsigned i=0; i<m_NumberOfButtons; i++)
- {
+ for (unsigned i = 0; i < m_NumberOfButtons; i++) {
SIZE smsz;
sml[i].GetSize(smsz);
@@ -599,42 +595,37 @@ void SmileyToolWindowType::CreateSmileyWinDim(void)
}
}
}
- else
- {
+ else {
m_ButtonSize = *(SIZE*)&m_pSmileyPack->selec;
}
- if (m_pSmileyPack->win.x == 0 || m_pSmileyPack->win.y == 0)
- {
- if (opt.IEViewStyle)
- {
+ if (m_pSmileyPack->win.x == 0 || m_pSmileyPack->win.y == 0) {
+ if (opt.IEViewStyle) {
// All integer square root
unsigned i;
- for (i=1; i*i<m_NumberOfButtons; i++) ;
+ for (i = 1; i*i < m_NumberOfButtons; i++);
m_NumberOfHorizontalButtons = min(i, 350 / (m_ButtonSize.cx + m_ButtonSpace));
- m_NumberOfVerticalButtons = m_NumberOfButtons / m_NumberOfHorizontalButtons +
+ m_NumberOfVerticalButtons = m_NumberOfButtons / m_NumberOfHorizontalButtons +
(m_NumberOfButtons % m_NumberOfHorizontalButtons != 0);
}
- else
- {
+ else {
const int nh = min(10u, GetSystemMetrics(SM_CXSCREEN) / ((m_ButtonSize.cx + m_ButtonSpace) * 2));
m_NumberOfVerticalButtons = m_NumberOfButtons / nh + (m_NumberOfButtons % nh != 0);
if (m_NumberOfVerticalButtons < 5) m_NumberOfVerticalButtons = 5;
- m_NumberOfHorizontalButtons = m_NumberOfButtons / m_NumberOfVerticalButtons +
+ m_NumberOfHorizontalButtons = m_NumberOfButtons / m_NumberOfVerticalButtons +
(m_NumberOfButtons % m_NumberOfVerticalButtons != 0);
}
}
- else
- {
+ else {
m_NumberOfHorizontalButtons = m_pSmileyPack->win.x;
- m_NumberOfVerticalButtons = m_NumberOfButtons / m_NumberOfHorizontalButtons +
+ m_NumberOfVerticalButtons = m_NumberOfButtons / m_NumberOfHorizontalButtons +
(m_NumberOfButtons % m_NumberOfHorizontalButtons != 0);
}
- m_BitmapWidth.cx = m_NumberOfHorizontalButtons * (m_ButtonSize.cx + m_ButtonSpace) + m_ButtonSpace;
+ m_BitmapWidth.cx = m_NumberOfHorizontalButtons * (m_ButtonSize.cx + m_ButtonSpace) + m_ButtonSpace;
m_BitmapWidth.cy = m_NumberOfVerticalButtons * (m_ButtonSize.cy + m_ButtonSpace) + m_ButtonSpace;
const int colsz = m_ButtonSize.cy + m_ButtonSpace;
@@ -657,23 +648,20 @@ void SmileyToolWindowType::CreateSmileyBitmap(HDC hdc)
FillRect(hdc, &rc, hBkgBrush);
DeleteObject(hBkgBrush);
- if (opt.IEViewStyle)
- {
+ if (opt.IEViewStyle) {
HPEN hpen = CreatePen(PS_DOT, 1, 0);
HGDIOBJ hOldPen = SelectObject(hdc, hpen);
POINT pts[2] = { {0, 0}, {m_BitmapWidth.cx, 0} };
- for (unsigned i=0; i<=m_NumberOfVerticalButtons; i++)
- {
+ for (unsigned i = 0; i <= m_NumberOfVerticalButtons; i++) {
pts[0].y = pts[1].y = i * (m_ButtonSize.cy + m_ButtonSpace);
if (pts[0].y > m_WindowSizeY) break;
Polyline(hdc, pts, 2);
}
pts[0].y = 0; pts[1].y = m_BitmapWidth.cy;
- for (unsigned j=0; j<=m_NumberOfHorizontalButtons; j++)
- {
+ for (unsigned j = 0; j <= m_NumberOfHorizontalButtons; j++) {
pts[0].x = pts[1].x = j * (m_ButtonSize.cx + m_ButtonSpace);
Polyline(hdc, pts, 2);
}
@@ -685,23 +673,21 @@ void SmileyToolWindowType::CreateSmileyBitmap(HDC hdc)
RECT SmileyToolWindowType::CalculateButtonToCoordinates(int buttonPosition, int scroll)
-{
+{
int row, rowpos;
- if (opt.HorizontalSorting)
- {
+ if (opt.HorizontalSorting) {
row = buttonPosition / m_NumberOfHorizontalButtons;
rowpos = buttonPosition % m_NumberOfHorizontalButtons;
}
- else
- {
+ else {
row = buttonPosition % m_NumberOfVerticalButtons;
rowpos = buttonPosition / m_NumberOfVerticalButtons;
}
RECT pt;
pt.left = rowpos * (m_ButtonSize.cx + m_ButtonSpace) + m_ButtonSpace;
- pt.top = (row - scroll) * (m_ButtonSize.cy + m_ButtonSpace) + m_ButtonSpace;
+ pt.top = (row - scroll) * (m_ButtonSize.cy + m_ButtonSpace) + m_ButtonSpace;
pt.right = pt.left + m_ButtonSize.cx;
pt.bottom = pt.top + m_ButtonSize.cy;
@@ -727,34 +713,32 @@ int SmileyToolWindowType::CalculateCoordinatesToButton(POINT pt, int scroll)
void __cdecl SmileyToolThread(void *arg)
{
- SmileyToolWindowParam* stwp = (SmileyToolWindowParam*)arg;
- if (stwp->pSmileyPack && stwp->pSmileyPack->VisibleSmileyCount())
- {
+ SmileyToolWindowParam *stwp = (SmileyToolWindowParam*)arg;
+ if (stwp->pSmileyPack && stwp->pSmileyPack->VisibleSmileyCount()) {
WNDCLASSEX wndclass;
- wndclass.cbSize = sizeof(wndclass);
- wndclass.style = CS_SAVEBITS;
- wndclass.lpfnWndProc = DlgProcSmileyToolWindow;
- wndclass.cbClsExtra = 0;
- wndclass.cbWndExtra = 4;
- wndclass.hInstance = g_hInst;
- wndclass.hIcon = NULL;
- wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
+ wndclass.cbSize = sizeof(wndclass);
+ wndclass.style = CS_SAVEBITS;
+ wndclass.lpfnWndProc = DlgProcSmileyToolWindow;
+ wndclass.cbClsExtra = 0;
+ wndclass.cbWndExtra = 4;
+ wndclass.hInstance = g_hInst;
+ wndclass.hIcon = NULL;
+ wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = CreateSolidBrush(opt.SelWndBkgClr);
- wndclass.lpszMenuName = NULL;
+ wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = _T("SmileyTool");
- wndclass.hIconSm = NULL;
+ wndclass.hIconSm = NULL;
RegisterClassEx(&wndclass);
- CreateWindowEx(WS_EX_TOPMOST | WS_EX_NOPARENTNOTIFY, _T("SmileyTool"), NULL,
- WS_BORDER | WS_POPUP | WS_VISIBLE,
+ CreateWindowEx(WS_EX_TOPMOST | WS_EX_NOPARENTNOTIFY, _T("SmileyTool"), NULL,
+ WS_BORDER | WS_POPUP | WS_VISIBLE,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
((SmileyToolWindowParam*)arg)->hWndParent, NULL, g_hInst, arg);
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL);
MSG msg;
- while (GetMessage(&msg, NULL, 0, 0))
- {
+ while (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}