Click here to Skip to main content
15,902,921 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can I found which control in a dialog box is focused? [modified] Pin
Joseph Marzbani3-Oct-08 19:19
Joseph Marzbani3-Oct-08 19:19 
QuestionC++ cast operator problem with CArchive [modified] Pin
wolhar3-Oct-08 1:19
wolhar3-Oct-08 1:19 
AnswerRe: C++ cast operator problem with CArchive Pin
Matthew Faithfull3-Oct-08 2:33
Matthew Faithfull3-Oct-08 2:33 
GeneralRe: C++ cast operator problem with CArchive Pin
CPallini3-Oct-08 7:52
mveCPallini3-Oct-08 7:52 
QuestionCppSQLite in my windows program(VC++ 6) Pin
gkns3-Oct-08 0:47
gkns3-Oct-08 0:47 
AnswerRe: CppSQLite in my windows program(VC++ 6) Pin
CPallini3-Oct-08 2:24
mveCPallini3-Oct-08 2:24 
AnswerRe: CppSQLite in my windows program(VC++ 6) Pin
Garth J Lancaster3-Oct-08 12:16
professionalGarth J Lancaster3-Oct-08 12:16 
QuestionResizing Pin
Sarriss3-Oct-08 0:46
Sarriss3-Oct-08 0:46 
HI
im using HRGN stuff, i have 2 boxes that have a variable width and height, on mouse down in the corner ive coded it to change the width and the height variables and update but the two HRGN's dont update,

int nWidth = 550;
int nHeight = 400;
HRGN hRegion1 = CreateRectRgn(0, 0, nWidth, nHeight);//-----1
HRGN hRegion2 = CreateRectRgn(0, 0, nWidth, nHeight);//-----1

void ClientResize(HWND hWnd, int nWidth, int nHeight)
{

		RECT rcWnd;
		POINT pnt, pntDiff;
		GetCursorPos(&pnt);
		GetWindowRect(hWnd, &rcWnd);

		if((pnt.x >= (rcWnd.right-20))&&(pnt.y >= (rcWnd.bottom - 20)))
		{
			//put code to rezise window
			//MessageBox(NULL, TEXT("Resize should be here"), TEXT("Good"), MB_OK);
			
			pntDiff.x = pnt.x - nWidth;
			nWidth += (int)pntDiff.x;
			pntDiff.y = pnt.y - nHeight;
			nHeight += (int)pntDiff.y;
			MoveWindow(hWnd, rcWnd.left, rcWnd.top, nWidth, nHeight, TRUE);
		}
}


LRESULT CALLBACK WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
case WM_CREATE:

		g_Hwnd = hWnd;
		// Remove title bar and prevent resizing
		dwStyle &= ~(WS_CAPTION|WS_SIZEBOX);
		SetWindowLong(hWnd, GWL_STYLE, dwStyle);
		CombineRgn(hRegion1, hRegion1, hRegion2, RGN_OR);//-----1
		SetWindowRgn(hWnd, hRegion1, true);//-----1

		break;
	case WM_LBUTTONDOWN:

		ClientResize(hWnd, nWidth, nHeight); 
                break;
	case WM_LBUTTONUP:
		UpdateWindow(hWnd);

		break;
}

AnswerRe: Resizing Pin
Mark Salsbery3-Oct-08 4:59
Mark Salsbery3-Oct-08 4:59 
GeneralRe: Resizing Pin
Sarriss3-Oct-08 5:01
Sarriss3-Oct-08 5:01 
GeneralRe: Resizing Pin
Mark Salsbery3-Oct-08 5:41
Mark Salsbery3-Oct-08 5:41 
GeneralRe: Resizing Pin
Mark Salsbery3-Oct-08 5:43
Mark Salsbery3-Oct-08 5:43 
GeneralRe: Resizing Pin
Sarriss3-Oct-08 6:34
Sarriss3-Oct-08 6:34 
QuestionHow can i know if some low level windows hook running on my machine ? Pin
Yanshof2-Oct-08 23:50
Yanshof2-Oct-08 23:50 
AnswerRe: How can i know if some low level windows hook running on my machine ? Pin
JudyL_MD3-Oct-08 15:21
JudyL_MD3-Oct-08 15:21 
QuestionString Problem Pin
rdop2-Oct-08 23:26
rdop2-Oct-08 23:26 
AnswerRe: String Problem Pin
Hamid_RT2-Oct-08 23:31
Hamid_RT2-Oct-08 23:31 
AnswerRe: String Problem Pin
Roger Stoltz2-Oct-08 23:31
Roger Stoltz2-Oct-08 23:31 
GeneralRe: String Problem Pin
rdop3-Oct-08 0:01
rdop3-Oct-08 0:01 
AnswerRe: String Problem Pin
Roger Stoltz3-Oct-08 0:11
Roger Stoltz3-Oct-08 0:11 
QuestionRe: String Problem Pin
CPallini2-Oct-08 23:32
mveCPallini2-Oct-08 23:32 
AnswerRe: String Problem Pin
rdop2-Oct-08 23:37
rdop2-Oct-08 23:37 
GeneralRe: String Problem Pin
CPallini2-Oct-08 23:45
mveCPallini2-Oct-08 23:45 
GeneralRe: String Problem Pin
rdop3-Oct-08 0:12
rdop3-Oct-08 0:12 
GeneralRe: String Problem Pin
Chandrasekharan P3-Oct-08 0:24
Chandrasekharan P3-Oct-08 0:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.