Click here to Skip to main content
16,008,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow can Get Total Size of ListCtrl? Pin
Le@rner8-Oct-08 21:43
Le@rner8-Oct-08 21:43 
AnswerRe: How can Get Total Size of ListCtrl? Pin
Naveen8-Oct-08 21:58
Naveen8-Oct-08 21:58 
GeneralRe: How can Get Total Size of ListCtrl? Pin
Nishad S8-Oct-08 22:13
Nishad S8-Oct-08 22:13 
QuestionBlack Border around Dialog Box. Pin
gothic_coder8-Oct-08 21:09
gothic_coder8-Oct-08 21:09 
AnswerRe: Black Border around Dialog Box. Pin
Nishad S8-Oct-08 22:11
Nishad S8-Oct-08 22:11 
GeneralRe: Black Border around Dialog Box. Pin
gothic_coder8-Oct-08 23:07
gothic_coder8-Oct-08 23:07 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S8-Oct-08 23:22
Nishad S8-Oct-08 23:22 
GeneralRe: Black Border around Dialog Box. [modified] Pin
gothic_coder8-Oct-08 23:29
gothic_coder8-Oct-08 23:29 
Sure.

Calling this function on WM_ERASEBKGND:

case WM_ERASEBKGND:
{
	GetClientRect(hWnd, &thisWindowRect);
	COLORREF startCol = RGB(174, 255, 194), endCol = RGB(230, 255, 236);
	GradientFillRect(HDC (wParam), &thisWindowRect, startCol, endCol, TRUE);

}


thisWindowRect is Dialog Box Coordinates...

and here is my animate window code.

BOOL bLoadLib = FALSE;
HMODULE _user32 = GetModuleHandle("user32.dll");
if(_user32 ==  INVALID_HANDLE_VALUE || _user32 == NULL)
{
	_user32 = LoadLibrary("User32.dll");
	if(_user32)
	bLoadLib = TRUE;
}

typedef BOOL (WINAPI *_AnimateWindowDT) (HWND,DWORD,DWORD);
_AnimateWindowDT _AnimateWindow;
			    
if(_user32)
{
	// For Win98,Win2000 and above. 
	if((_AnimateWindow = (_AnimateWindowDT) GetProcAddress(_user32,"AnimateWindow")))
	{
        	RECT windozeRect, thisWindowRect, SlideDialog;
		int DialogLeft, DialogRight;
		SystemParametersInfo(SPI_GETWORKAREA, 0, &windozeRect, 0);
		GetWindowRect(hWnd,&thisWindowRect);
		DialogLeft = thisWindowRect.right;
		DialogRight = thisWindowRect.bottom;

		thisWindowRect.left = windozeRect.right - DialogLeft - 8;
		thisWindowRect.top = windozeRect.bottom - DialogRight- 5;

		SetWindowPos(hWnd, NULL,thisWindowRect.left, thisWindowRect.top, 0, 0, SWP_NOSIZE);
					
		_AnimateWindow(hWnd, 300, AW_SLIDE |  AW_VER_NEGATIVE);
		bBack = TRUE;
	}
	else
	{
	        //If in any case AnimateWindow crash or don't respond.
		//For Win95,Win NT which doesn't support AnimateWindow(). 

		RECT windozeRect, thisWindowRect, SlideDialog;
		int DialogLeft, DialogRight;
		SystemParametersInfo(SPI_GETWORKAREA, 0, &windozeRect, 0);
		GetWindowRect(hWnd,&thisWindowRect);
		DialogLeft = thisWindowRect.right;
		DialogRight = thisWindowRect.bottom;

		thisWindowRect.left = windozeRect.right - DialogLeft - 8;
		thisWindowRect.top = windozeRect.bottom + 5;
		SlideDialog.top = thisWindowRect.top;


		SetWindowPos(hWnd, NULL,thisWindowRect.left, thisWindowRect.top, 0, 0, SWP_NOSIZE );
							
		for(;thisWindowRect.top > SlideDialog.top - 131; thisWindowRect.top--)
		{
			UpdateWindow(hWnd);
			SetWindowPos(hWnd, NULL,thisWindowRect.left, thisWindowRect.top, 0, 0, SWP_NOSIZE);
			ShowWindow(hWnd, SW_SHOW);
			Sleep(2);
		}
		bBack = TRUE;
	}				
}


And this whole code comes under WM_INITDIALOG:

modified on Thursday, October 9, 2008 5:36 AM

GeneralRe: Black Border around Dialog Box. Pin
Nishad S9-Oct-08 0:13
Nishad S9-Oct-08 0:13 
GeneralRe: Black Border around Dialog Box. Pin
gothic_coder9-Oct-08 0:29
gothic_coder9-Oct-08 0:29 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S9-Oct-08 0:48
Nishad S9-Oct-08 0:48 
GeneralRe: Black Border around Dialog Box. Pin
gothic_coder9-Oct-08 0:56
gothic_coder9-Oct-08 0:56 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S9-Oct-08 1:05
Nishad S9-Oct-08 1:05 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S9-Oct-08 0:52
Nishad S9-Oct-08 0:52 
GeneralRe: Black Border around Dialog Box. Pin
gothic_coder9-Oct-08 0:59
gothic_coder9-Oct-08 0:59 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S9-Oct-08 1:20
Nishad S9-Oct-08 1:20 
GeneralRe: Black Border around Dialog Box. Pin
gothic_coder9-Oct-08 1:47
gothic_coder9-Oct-08 1:47 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S9-Oct-08 2:54
Nishad S9-Oct-08 2:54 
GeneralRe: Black Border around Dialog Box. Pin
gothic_coder9-Oct-08 3:01
gothic_coder9-Oct-08 3:01 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S9-Oct-08 17:34
Nishad S9-Oct-08 17:34 
GeneralRe: Black Border around Dialog Box. Pin
gothic_coder9-Oct-08 21:29
gothic_coder9-Oct-08 21:29 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S9-Oct-08 23:36
Nishad S9-Oct-08 23:36 
GeneralRe: Black Border around Dialog Box. Pin
gothic_coder10-Oct-08 0:32
gothic_coder10-Oct-08 0:32 
GeneralRe: Black Border around Dialog Box. Pin
Nishad S10-Oct-08 1:13
Nishad S10-Oct-08 1:13 
Questiondifferent result on x86 and x64 Pin
George_George8-Oct-08 20:43
George_George8-Oct-08 20:43 

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.