Exemplo n.º 1
0
LRESULT CALLBACK MyFunc(HWND this_hwnd,UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message) 
	{
	case WM_DESTROY:
		PostQuitMessage(0);
		break;

	case WM_TIMER:
		UpdateTime(0.02f);
		InvalidateRect(hWnd, NULL, 0);
		break;

	case WM_PAINT:
		// перерисовываем только всё окно
		if(this_hwnd == hWnd)
		{
			PAINTSTRUCT ps;
			HDC ThisDC = BeginPaint(hWnd, &ps);
			PaintIt(ThisDC);
			EndPaint(hWnd, &ps);
		}

		break;
	}

	return DefWindowProc(this_hwnd, message, wParam, lParam);
}
Exemplo n.º 2
0
void ColorButton::OnPaint()
{
	CButton::OnPaint();		// call Default() to draw the button
	//int state= SendMessage(BM_GETSTATE,0,0);
//	PaintIt(state & BST_PUSHED ? 1 : 0);
	PaintIt(0);
}
Exemplo n.º 3
0
LRESULT CALLBACK MyFunc(HWND this_hwnd,UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message) 
	{
	case WM_DESTROY:
		if (RECORD)	Record(true, 1);	
		encode_stop();
		PostQuitMessage(0);
		break;
	case WM_TIMER:
		UpdateTime(0.02f);
		InvalidateRect(hWnd, NULL, 0);
		break;

	case WM_PAINT:
	{	// перерисовываем только всё окно
		if(this_hwnd == hWnd)
		{
			PAINTSTRUCT ps;
			HDC ThisDC = BeginPaint(hWnd, &ps);
			PaintIt(ThisDC);
			//encode_start();
			if (RECORD)
				Record(false, 0);
			EndPaint(hWnd, &ps);
		}		
		break;
	}
	case WM_COMMAND:
	{
		case ID_START_BUTTON:
			if (!RECORD) Record(false, 0);
			break;
		case ID_STOP_BUTTON:
			if (RECORD) Record(true, 1);
			break;
		break;
	}
	}

	return DefWindowProc(this_hwnd, message, wParam, lParam);
}