/* Starts main loop */
while (GetMessage(&msg, NULL, 0, 0))
{
- if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
+ if (!TranslateAccelerator(main_win, hAccelTable, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
hInst = hInstance;
- hWnd = CreateWindow(TEXT("sndrec32_wave"),
- TEXT(""),
- WS_DLGFRAME | WS_VISIBLE | WS_CHILD,
- WAVEBAR_X,
- WAVEBAR_Y,
- WAVEBAR_CX,
- WAVEBAR_CY,
- f,
- (HMENU)8,
- hInstance,
- 0);
+ hWnd = CreateWindowEx(WS_EX_STATICEDGE,
+ TEXT("sndrec32_wave"),
+ TEXT(""),
+ WS_VISIBLE | WS_CHILD,
+ WAVEBAR_X,
+ WAVEBAR_Y,
+ WAVEBAR_CX,
+ WAVEBAR_CY,
+ f,
+ (HMENU)8,
+ hInstance,
+ 0);
if (!hWnd )
{
PAINTSTRUCT ps;
HDC hdc;
HPEN pen;
+ HPEN oldpen;
unsigned int max_h = (cli.bottom / 2);
unsigned int samples;
case WM_CREATE:
GetClientRect(hWnd, &cli);
break;
+
case WM_PAINT:
/* Initialize hdc objects */
hdc = BeginPaint(hWnd, &ps);
pen = (HPEN)CreatePen(PS_SOLID, 1, WAVEBAR_COLOR);
- SelectObject(hdc, (HBRUSH)pen);
+ oldpen = (HPEN) SelectObject(hdc, (HBRUSH)pen);
if (AUD_OUT->current_status() == snd::WAVEOUT_PLAYING)
{
samples = AUD_OUT->tot_samples_buf();
LineTo(hdc, WAVEBAR_CX, cli.bottom / 2);
}
+ SelectObject(hdc, oldpen);
DeleteObject( pen );
EndPaint( hWnd, &ps );
break;
case WM_USER:
break;
+
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
PAINTSTRUCT ps;
HDC hdc;
HFONT font;
+ HFONT oldfont;
long long slid_samp = 0;
/* Checking for global pointers to buffer and io audio devices */
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
font = CreateFontIndirect(&s_info.lfMenuFont);
- SelectObject(hdc, font);
+ oldfont = (HFONT) SelectObject(hdc, font);
SetBkMode(hdc, TRANSPARENT);
if (AUD_IN->current_status() == snd::WAVEIN_RECORDING)
_tcslen(str_tmp),
0);
+ SelectObject(hdc, oldfont);
DeleteObject(font);
EndPaint(hWnd, &ps);
break;