DWORD WINAPI ThFunc(LPVOID lpdata) { LPMYDATA lpd; HWND hWnd; HDC hdc; SYSTEMTIME st; TCHAR szBuf[64]; HFONT hFont; lpd = (LPMYDATA)lpdata; hWnd = lpd->hWnd; hdc = GetDC(hWnd); hFont = MyCreateFont(TEXT("MS ゴシック"), 48); SelectObject(hdc, hFont); SetTextColor(hdc, RGB(255, 0, 0)); while (!lpd->bEnd) { Sleep(10); GetLocalTime(&st); wsprintf(szBuf, TEXT("%02d:%02d:%02d-%03d"), st.wHour, st.wMinute, st.wSecond, st.wMilliseconds); TextOut(hdc, 10, 10, szBuf, lstrlen(szBuf)); WaitForSingleObject(hEvent, INFINITE); } DeleteObject(hFont); ReleaseDC(hWnd, hdc); return 0; }
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_PAINT: { PAINTSTRUCT ps; RECT area; HDC hDC = BeginPaint(hWnd, &ps); GetClientRect(hWnd, &area); SetBkMode(hDC, TRANSPARENT); // draw caption with the fuzzed font HFONT hFont = MyCreateFont(); HFONT hOldFont = (HFONT)SelectObject(hDC, hFont); if (hOldFont) { DrawTextA(hDC, m_szTable, -1, &area, DT_CENTER | DT_VCENTER); SelectObject(hDC, hOldFont); } EndPaint(hWnd, &ps); break; } case WM_COMMAND: { switch (wParam) { case ID_CLOSE: #ifdef TEST_MSG MessageBoxA(0, __FUNCTION__, "ID_CLOSE", MB_ICONINFORMATION); #endif // window can be closed now SetEvent(m_hWndEvent); break; } break; } case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; }
// Here you can process the Npp Messages // I will make the messages accessible little by little, according to the need of plugin development. // Please let me know if you need to access to some messages : // http://sourceforge.net/forum/forum.php?forum_id=482781 // extern "C" __declspec(dllexport) LRESULT messageProc(UINT Message, WPARAM wParam, LPARAM lParam) { switch (Message){ case WM_CREATE: hInst = GetModuleHandle(NULL); //Create PopupMenu Dynamically HGLOBAL hgbl; LPDLGTEMPLATE lpdt; LPWORD lpw; hwndEdit = nppData._scintillaMainHandle; hgbl = GlobalAlloc(GMEM_ZEROINIT, 1024); lpdt = (LPDLGTEMPLATE)GlobalLock(hgbl); // Define a dialog box. lpdt->style = WS_POPUP | WS_BORDER ; lpdt->cdit = 0; // Number of controls = 0 lpdt->x = 10; lpdt->y = 10; lpdt->cx = 100; lpdt->cy = 100; lpw = (LPWORD)(lpdt + 1); *lpw++ = 0; // No menu *lpw++ = 0; // Predefined dialog box class (by default) GlobalUnlock(hgbl); hwndPopupMenu = CreateDialogIndirect(hInst, (LPDLGTEMPLATE)hgbl, nppData._nppHandle, (DLGPROC)PopupMenuProc); GlobalFree(hgbl); //End PopupMenuDialog hfontCurrent = MyCreateFont(nppData._nppHandle, 10,L"Zawgyi-One"); EditProc =(WNDPROC)GetWindowLongW(nppData._scintillaMainHandle, GWL_WNDPROC); SetWindowLong(nppData._scintillaMainHandle, GWL_WNDPROC, (long)SubEditProc); hMenu = GetMenu(nppData._nppHandle); CheckMenuItem(hMenu,funcItem[1]._cmdID,MF_BYCOMMAND|MF_CHECKED);//Check Disable Menu break; case WM_MOVE: //move menu along with the main window if(IsWindowVisible(hwndPopupMenu)) { RECT rctWinMain; GetWindowRect(hwndEdit,&rctWinMain); int height=(burmese.menuLength>MROW?10:burmese.menuLength)*MHEIGHT+MHEIGHT+10; int width=((burmese.menuLength/MROW)+1)*MWIDTH; MoveWindow (hwndPopupMenu, rctWinMain.left + pointEditCursor.x + 10, rctWinMain.top + pointEditCursor.y + 20 , width, height, TRUE) ; } break; } return true; }
LRESULT CALLBACK About( HWND hDlg, UINT uMessage, WPARAM wParam, LPARAM lParam ) { #define TIMER_ID_ABOUT (UINT) 'A' const RECT urlrect = { 90, 140, 320, 170 }; static HCURSOR hCursor[ 3 ]; static int iCursor = 0; static int iMouseDown = 0; static HWND hWnd = NULL; static HFONT hBold; static TCHAR lpszWindowText[ 1024 ]; switch ( uMessage ) { case WM_INITDIALOG: { hWnd = (HWND) lParam; HDC hDC = GetDC( hDlg ); hBold = MyCreateFont( hDC, TEXT( "Georgia" ), 14, TRUE, TRUE ); if( !hBold ) hBold = MyCreateFont( hDC, TEXT( "Times New Roman" ), 16, TRUE, TRUE ); ReleaseDC( hDlg, hDC ); SetDlgItemText( hDlg, IDC_APP_NAME , APP_NAME ); SendDlgItemMessage( hDlg, IDC_APP_NAME, WM_SETFONT, ( WPARAM ) hBold, 0L ); SendDlgItemMessage( hDlg, IDC_DESCRIPTION, WM_SETFONT, ( WPARAM ) hFont, 0L ); TCHAR str[ 1024 ]; wsprintf( str, TEXT( "Compiled on: %hs, %hs UTC" ), __TIME__, __DATE__ ); SetDlgItemText( hDlg, IDC_DATETIME , str ); SetDlgItemText( hDlg, IDC_COPYRIGHT , APP_COPYRIGHT ); SendDlgItemMessage( hDlg, IDC_EDITBOX_GPL, EM_SETMARGINS, (WPARAM) ( EC_LEFTMARGIN | EC_RIGHTMARGIN ), MAKELPARAM( 5 , 10 ) ); #ifdef _UNICODE SetDlgItemText( hDlg, IDC_DESCRIPTION2 , TEXT( "Unicode Build" ) ); #else SetDlgItemText( hDlg, IDC_DESCRIPTION2 , TEXT( "ANSI (Non-unicode) Build" ) ); #endif #ifdef _UNICODE if( IS_JAPANESE ) { lpszWindowText[ 0 ] = TEXT( '\0' ); // just in case MultiByteToWideChar( CP_UTF8, MB_CUTE, S_JPN_9000, -1, lpszWindowText, 1023 ); SetWindowText( hDlg, lpszWindowText ); str[ 0 ] = TEXT( '\0' ); MultiByteToWideChar( CP_UTF8, MB_CUTE, S_JPN_DESC, -1, str, 1023 ); SetDlgItemText( hDlg, IDC_DESCRIPTION, str ); SendDlgItemMessage( hDlg, IDC_EDITBOX_GPL, WM_SETFONT, ( WPARAM ) hFont, 0L ); str[ 0 ] = TEXT( '\0' ); MultiByteToWideChar( CP_UTF8, MB_CUTE, S_JPN_GPL, -1, str, 1023 ); SetDlgItemText( hDlg, IDC_EDITBOX_GPL, str ); } else if( IS_FINNISH ) { lpszWindowText[ 0 ] = TEXT( '\0' ); // just in case MultiByteToWideChar( CP_UTF8, MB_CUTE, S_FIN_9000, -1, lpszWindowText, 1023 ); SetWindowText( hDlg, lpszWindowText ); str[ 0 ] = TEXT( '\0' ); MultiByteToWideChar( CP_UTF8, MB_CUTE, S_FIN_DESC, -1, str, 1023 ); SetDlgItemText( hDlg, IDC_DESCRIPTION, str ); SetDlgItemText( hDlg, IDC_EDITBOX_GPL, TEXT_GPL ); } else if( IS_SPANISH ) { lpszWindowText[ 0 ] = TEXT( '\0' ); // just in case MultiByteToWideChar( CP_UTF8, MB_CUTE, S_SPA_9000, -1, lpszWindowText, 1023 ); SetWindowText( hDlg, lpszWindowText ); str[ 0 ] = TEXT( '\0' ); MultiByteToWideChar( CP_UTF8, MB_CUTE, S_SPA_DESC, -1, str, 1023 ); SetDlgItemText( hDlg, IDC_DESCRIPTION, str ); SetDlgItemText( hDlg, IDC_EDITBOX_GPL, TEXT_GPL ); } else if( IS_CHINESE_T ) { lpszWindowText[ 0 ] = TEXT( '\0' ); // just in case MultiByteToWideChar( CP_UTF8, MB_CUTE, S_CHI_9000T, -1, lpszWindowText, 1023 ); SetWindowText( hDlg, lpszWindowText ); str[ 0 ] = TEXT( '\0' ); MultiByteToWideChar( CP_UTF8, MB_CUTE, S_CHI_DESC_T, -1, str, 1023 ); SetDlgItemText( hDlg, IDC_DESCRIPTION, str ); SetDlgItemText( hDlg, IDC_EDITBOX_GPL, TEXT_GPL ); } else if( IS_CHINESE_S ) { lpszWindowText[ 0 ] = TEXT( '\0' ); // just in case MultiByteToWideChar( CP_UTF8, MB_CUTE, S_CHI_9000S, -1, lpszWindowText, 1023 ); SetWindowText( hDlg, lpszWindowText ); str[ 0 ] = TEXT( '\0' ); MultiByteToWideChar( CP_UTF8, MB_CUTE, S_CHI_DESC_S, -1, str, 1023 ); SetDlgItemText( hDlg, IDC_DESCRIPTION, str ); SetDlgItemText( hDlg, IDC_EDITBOX_GPL, TEXT_GPL ); } else if( IS_FRENCH ) { lpszWindowText[ 0 ] = TEXT( '\0' ); // just in case MultiByteToWideChar( CP_UTF8, MB_CUTE, S_FRE_9000, -1, lpszWindowText, 1023 ); SetWindowText( hDlg, lpszWindowText ); str[ 0 ] = TEXT( '\0' ); MultiByteToWideChar( CP_UTF8, MB_CUTE, S_FRE_DESC, -1, str, 1023 ); SetDlgItemText( hDlg, IDC_DESCRIPTION, str ); SetDlgItemText( hDlg, IDC_EDITBOX_GPL, TEXT_GPL ); } else #endif { SetDlgItemText( hDlg, IDC_DESCRIPTION, S_ENG_DESC ); SetDlgItemText( hDlg, IDC_EDITBOX_GPL, TEXT_GPL ); lstrcpy( lpszWindowText, TEXT( "About..." ) ); SetWindowText( hDlg, lpszWindowText ); } char hcSstpVersion[ 1024 ] = ""; #ifdef _UNICODE WideCharToMultiByte( CP_ACP, 0, APP_NAME, -1, hcSstpVersion, 1023, NULL, NULL ); #else lstrcpyA( hcSstpVersion, APP_NAME ); #endif lstrcatA( hcSstpVersion, "\\nCompiled on: " ); lstrcatA( hcSstpVersion, __TIME__ ); lstrcatA( hcSstpVersion, "+00:00, " ); lstrcatA( hcSstpVersion, __DATE__ ); #ifdef _UNICODE if( IS_JAPANESE && ( LANG_JAPANESE == PRIMARYLANGID( GetSystemDefaultLangID() ) ) ) #else if( LANG_JAPANESE == PRIMARYLANGID( GetSystemDefaultLangID() ) ) #endif { DirectSSTP( (HWND) lParam, S_ABOUT_SJIS, hcSstpVersion, "Shift_JIS" ); } else { DirectSSTP( (HWND) lParam, "About 'Battle Encoder Shirase'...", hcSstpVersion, "ASCII" ); } hCursor[ 0 ] = LoadCursor( ( HINSTANCE ) NULL, IDC_ARROW ); hCursor[ 1 ] = LoadCursor( ( HINSTANCE ) NULL, IDC_HAND ); hCursor[ 2 ] = hCursor[ 1 ]; SetCursor( hCursor[ 0 ] ); // Anti-Ukagaka SetTimer( hDlg, TIMER_ID_ABOUT, 500U, (TIMERPROC) NULL ); break; } case WM_COMMAND: { if( LOWORD( wParam ) == IDOK || LOWORD( wParam ) == IDCANCEL ) { EndDialog( hDlg, -1 ); return TRUE; } break; } case WM_TIMER: { SetWindowText( hDlg, lpszWindowText ); break; } case WM_MOUSEMOVE: { if( iMouseDown == -1 ) break; int iPrevCursor = iCursor; iCursor = AboutBoxUrlHit( lParam ); // Reset Cursor for each WM_MOUSEMOVE, silly but... SetCursor( hCursor[ iCursor ] ); if( iCursor == 1 && iMouseDown == 1 ) iCursor = 2; if( iPrevCursor != iCursor ) { /* // In theory, we have to change Cursor only when Prev!=Now, but // something is wrong here and that doesn't work. SetCursor( hCursor[ iCursor ] ); */ InvalidateRect( hDlg, &urlrect, TRUE ); } break; } case WM_LBUTTONDOWN: { SetCapture( hDlg ); if( AboutBoxUrlHit( lParam ) ) { iMouseDown = 1; SetCursor( hCursor[ 1 ] ); iCursor = 2; InvalidateRect( hDlg, &urlrect, TRUE ); } else { iMouseDown = -1; } break; } case WM_LBUTTONUP: { ReleaseCapture(); if( iMouseDown == 1 && AboutBoxUrlHit( lParam ) ) { OpenBrowser( APP_HOME_URL ); } iCursor = 0; SetCursor( hCursor[ 0 ] ); iMouseDown = 0; break; } case WM_ACTIVATE: { if( wParam == WA_INACTIVE ) { iMouseDown = -1; iCursor = 0; SetCursor( hCursor[ 0 ] ); InvalidateRect( hDlg, &urlrect, TRUE ); } else { iMouseDown = 0; } break; } case WM_PAINT: { PAINTSTRUCT ps; HDC hdc = BeginPaint( hDlg, &ps ); HFONT hMyFont = GetFontForURL( hdc ); HFONT hOldFont = (HFONT) SelectObject( hdc, hMyFont ); SetBkMode( hdc, TRANSPARENT ); SetTextColor( hdc, iCursor == 2 ? RGB( 0xff, 0x00, 0x00 ) : iCursor == 1 ? RGB( 0x00, 0x80, 0x00 ) : RGB( 0x00, 0x00, 0xff ) ); TextOut( hdc, 100, 148, APP_HOME_URL, lstrlen( APP_HOME_URL ) ); SelectObject( hdc, hOldFont ); DeleteFont( hMyFont ); EndPaint( hDlg, &ps ); break; } case WM_CTLCOLORSTATIC: { if( (HWND) lParam == GetDlgItem( hDlg, IDC_APP_NAME ) ) { HDC hDC = (HDC) wParam; SetBkMode( hDC, TRANSPARENT ); SetBkColor( hDC, GetSysColor( COLOR_3DFACE ) ); SetTextColor( hDC, RGB( 0,0,0xa0 ) ); return (BOOL) (HBRUSH) GetSysColorBrush( COLOR_3DFACE ); } else return FALSE; break; } case WM_DESTROY: { DeleteFont( hBold ); hBold = NULL; KillTimer( hDlg, TIMER_ID_ABOUT ); break; } default: { return 0L; } } return 1L; }
LRESULT CALLBACK Settings( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) { #define TIMER_ID_S (UINT) 'S' static LONG lSlider[ 3 ]; static int iPathId[ 3 ] = { IDC_EDIT_TARGET1, IDC_EDIT_TARGET2, IDC_EDIT_TARGET3 }; static int iButtonId[ 3 ] = { IDC_BUTTON_STOP1, IDC_BUTTON_STOP2, IDC_BUTTON_STOP3 }; static int iTextId[ 3 ] = { IDC_TEXT_TARGET1, IDC_TEXT_TARGET2, IDC_TEXT_TARGET3 }; static int iSliderId[ 3 ] = { IDC_SLIDER1, IDC_SLIDER2, IDC_SLIDER3 }; static HWND hWnd; static int iMyId; static LPTSTR * lpszStatus; static TCHAR lpszWindowText[ 1024 ]; static HFONT hMyFont = NULL; switch (message) { case WM_INITDIALOG: { hWnd = ( ( LPHACK_PARAMS ) lParam ) -> myHwnd; iMyId = ( ( LPHACK_PARAMS ) lParam ) -> iMyId; lpszStatus = ( ( LPHACK_PARAMS ) lParam ) -> lpszStatus; HDC hDC = GetDC( hDlg ); hMyFont = MyCreateFont( hDC, TEXT( "Verdana" ), 12, TRUE, FALSE ); ReleaseDC( hDlg, hDC ); #ifdef _UNICODE if( IS_JAPANESE ) { MultiByteToWideChar( CP_UTF8, MB_CUTE, IS_JAPANESEo ? S_JPNo_1002 : S_JPN_1002, -1, lpszWindowText, 1023 ); SetWindowText( hDlg, lpszWindowText ); } else if( IS_FRENCH ) { MultiByteToWideChar( CP_UTF8, MB_CUTE, S_FRE_1002, -1, lpszWindowText, 1023 ); SetWindowText( hDlg, lpszWindowText ); } else if( IS_SPANISH ) { MultiByteToWideChar( CP_UTF8, MB_CUTE, S_SPA_1002, -1, lpszWindowText, 1023 ); SetWindowText( hDlg, lpszWindowText ); } else #endif { lstrcpy( lpszWindowText, _T( "Limiter control" ) ); SetWindowText( hDlg, lpszWindowText ); } for( int i = 0; i < 3; i++ ) { lSlider[ i ] = (long) g_Slider[ i ]; SetDlgItemText( hDlg, iPathId[ i ], g_szTarget[ i ] ); TCHAR tmpstr[ 100 ]; wsprintf( tmpstr, TEXT( "%s #&%d" ), ( ( g_bHack[ i ] )? TEXT( "Unlimit" ) : TEXT( "Limit" ) ), i + 1 ); SetDlgItemText( hDlg, iButtonId[ i ], tmpstr ); EnableWindow( GetDlgItem( hDlg, iButtonId[ i ] ), ( g_dwTargetProcessId[ i ] != TARGET_PID_NOT_SET ) ); EnableWindow( GetDlgItem( hDlg, iSliderId[ i ] ), ( g_dwTargetProcessId[ i ] != TARGET_PID_NOT_SET ) ); EnableWindow( GetDlgItem( hDlg, iTextId[ i ] ), ( g_dwTargetProcessId[ i ] != TARGET_PID_NOT_SET ) ); SendDlgItemMessage( hDlg, iSliderId[ i ], TBM_SETRANGE, TRUE, MAKELONG( 1, 99 ) ); SendDlgItemMessage( hDlg, iSliderId[ i ], TBM_SETPOS, TRUE, lSlider[ i ] ); for( long lPos = 10L; lPos <= 90L; lPos += 10L ) { SendDlgItemMessage( hDlg, iSliderId[ i ], TBM_SETTIC, 0U, lPos ); } SendDlgItemMessage( hDlg, iTextId[ i ], WM_SETFONT, ( WPARAM ) hMyFont, 0L ); SetSliderText( hDlg, iTextId[ i ] , lSlider[ i ] ); } if( g_dwTargetProcessId[ 2 ] == (DWORD) -1 || g_bHack[ 3 ] ) { SetDlgItemText( hDlg, iButtonId[ 2 ], TEXT( "(Watching)" ) ); EnableWindow( GetDlgItem( hDlg, iButtonId[ 2 ] ), FALSE ); EnableWindow( GetDlgItem( hDlg, iTextId[ 2 ] ), TRUE ); } // Anti-Ukagaka SetTimer( hDlg, TIMER_ID_S, 500U, (TIMERPROC) NULL ); break; } case WM_CTLCOLORSTATIC: { for( int i = 0; i < 3; i++ ) { HWND hEdit = GetDlgItem( hDlg, iTextId[ i ] ); if( (HWND) lParam == hEdit ) { HDC hDC = (HDC) wParam; SetBkMode( hDC, TRANSPARENT ); SetBkColor( hDC, GetSysColor( COLOR_3DFACE ) ); SetTextColor( hDC, RGB( 0,0,0xaa ) ); return (BOOL) (HBRUSH) GetSysColorBrush( COLOR_3DFACE ); } } return 0L; } case WM_HSCROLL: { if( GetDlgItem( hDlg, IDC_SLIDER1 ) == (HWND) lParam && SliderMoved( wParam ) ) { const RECT minirect = { 20L, 20L + 90L * 0L, 479L, 40L + 90L * 0L }; lSlider[ 0 ] = SendDlgItemMessage( hDlg, IDC_SLIDER1, TBM_GETPOS, 0U, 0L ); SetSliderText( hDlg, IDC_TEXT_TARGET1, lSlider[ 0 ] ); g_Slider[ 0 ] = GetSliderParam( lSlider[ 0 ] ); if( g_bHack[ 0 ] ) { wsprintf( lpszStatus[ 0 ], TEXT( "Target #1 [ -%d%% ]" ), g_Slider[ 0 ] ); InvalidateRect( hWnd, &minirect, 0 ); } } else if( GetDlgItem( hDlg, IDC_SLIDER2 ) == (HWND) lParam && SliderMoved( wParam ) ) { const RECT minirect = { 20L, 20L + 90L * 1L, 479L, 40L + 90L * 1L }; lSlider[ 1 ] = SendDlgItemMessage( hDlg, IDC_SLIDER2, TBM_GETPOS, 0U, 0L ); SetSliderText( hDlg, IDC_TEXT_TARGET2, lSlider[ 1 ] ); g_Slider[ 1 ] = GetSliderParam( lSlider[ 1 ] ); if( g_bHack[ 1 ] ) { wsprintf( lpszStatus[ 0 + 4 * 1 ], TEXT( "Target #2 [ -%d%% ]" ), g_Slider[ 1 ] ); InvalidateRect( hWnd, &minirect, 0 ); } } else if( GetDlgItem( hDlg, IDC_SLIDER3 ) == (HWND) lParam && SliderMoved( wParam ) ) { const RECT minirect = { 20L, 20L + 90L * 2L, 479L, 40L + 90L * 2L }; lSlider[ 2 ] = SendDlgItemMessage( hDlg, IDC_SLIDER3, TBM_GETPOS, 0U, 0L ); SetSliderText( hDlg, IDC_TEXT_TARGET3, lSlider[ 2 ] ); g_Slider[ 2 ] = GetSliderParam( lSlider[ 2 ] ); if( g_bHack[ 2 ] ) { wsprintf( lpszStatus[ 0 + 4 * 2 ], TEXT( "Target #3 [ -%d%% ]" ), g_Slider[ 2 ] ); InvalidateRect( hWnd, &minirect, 0 ); } } break; } case WM_COMMAND: { switch( LOWORD( wParam ) ) { case IDOK: { TCHAR msg[ 4096 ]; int i; for( i = 0; i < 3; i++ ) { if( g_dwTargetProcessId[ i ] != 0UL ) { wsprintf( msg, TEXT( "g_Slider[ %d ] = %d : %s" ), i, (int) g_Slider[ i ], g_szTarget[ i ] ); WriteDebugLog( msg ); SetSliderIni( g_szTarget[ i ], (int) g_Slider[ i ] ); } } EndDialog( hDlg, TRUE ); break; } case IDCANCEL: { EndDialog( hDlg, FALSE ); break; } case IDC_BUTTON_STOP1: { if( g_bHack[ 0 ] ) { SendMessage( hWnd, WM_USER_STOP, 0U, 0L ); SetDlgItemText( hDlg, iButtonId[ 0 ], TEXT( "Limit #&1" ) ); } else { SendMessage( hWnd, WM_USER_RESTART, 0U, 0L ); SetDlgItemText( hDlg, iButtonId[ 0 ], TEXT( "Unlimit #&1" ) ); } break; } case IDC_BUTTON_STOP2: { if( g_bHack[ 1 ] ) { SendMessage( hWnd, WM_USER_STOP, 1U, 0L ); SetDlgItemText( hDlg, iButtonId[ 1 ], TEXT( "Limit #&2" ) ); } else { SendMessage( hWnd, WM_USER_RESTART, 1U, 0L ); SetDlgItemText( hDlg, iButtonId[ 1 ], TEXT( "Unlimit #&2" ) ); } break; } case IDC_BUTTON_STOP3: { if( g_bHack[ 2 ] ) { SendMessage( hWnd, WM_USER_STOP, 2U, 0L ); SetDlgItemText( hDlg, iButtonId[ 2 ], TEXT( "Limit #&3" ) ); } else { SendMessage( hWnd, WM_USER_RESTART, 2U, 0L ); SetDlgItemText( hDlg, iButtonId[ 2 ], TEXT( "Unlimit #&3" ) ); } break; } default: { break; } } break; // <-- fixed @ 1.1 beta3 } case WM_TIMER: { SetWindowText( hDlg, lpszWindowText ); break; } case WM_DESTROY: { DeleteFont( hMyFont ); hMyFont = NULL; KillTimer( hDlg, TIMER_ID_S ); break; } default: return 0L;//FALSE; } return 1L;//TRUE; }