Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Crashing problem in Report control Pin
_AnsHUMAN_ 16-Oct-11 20:51
_AnsHUMAN_ 16-Oct-11 20:51 
QuestionHow to send a click message to an listctrl ? Pin
_Flaviu15-Oct-11 7:30
_Flaviu15-Oct-11 7:30 
AnswerRe: How to send a click message to an listctrl ? Pin
MartyTPS15-Oct-11 16:25
MartyTPS15-Oct-11 16:25 
GeneralRe: How to send a click message to an listctrl ? Pin
_Flaviu15-Oct-11 22:01
_Flaviu15-Oct-11 22:01 
GeneralRe: How to send a click message to an listctrl ? Pin
_Flaviu16-Oct-11 19:56
_Flaviu16-Oct-11 19:56 
AnswerRe: How to send a click message to an listctrl ? Pin
«_Superman_»15-Oct-11 21:08
professional«_Superman_»15-Oct-11 21:08 
GeneralRe: How to send a click message to an listctrl ? Pin
_Flaviu15-Oct-11 22:00
_Flaviu15-Oct-11 22:00 
GeneralRe: How to send a click message to an listctrl ? Pin
Stephen Hewitt16-Oct-11 2:36
Stephen Hewitt16-Oct-11 2:36 
GeneralRe: How to send a click message to an listctrl ? Pin
_Flaviu16-Oct-11 19:56
_Flaviu16-Oct-11 19:56 
Questionsetting form element values using ie TCppWebBrowser control Pin
Andrew J. Burke15-Oct-11 3:32
Andrew J. Burke15-Oct-11 3:32 
AnswerRe: setting form element values using ie TCppWebBrowser control Pin
App_15-Oct-11 8:37
App_15-Oct-11 8:37 
GeneralRe: setting form element values using ie TCppWebBrowser control Pin
Andrew J. Burke15-Oct-11 14:50
Andrew J. Burke15-Oct-11 14:50 
GeneralRe: setting form element values using ie TCppWebBrowser control Pin
App_15-Oct-11 20:58
App_15-Oct-11 20:58 
GeneralRe: setting form element values using ie TCppWebBrowser control Pin
Andrew J. Burke16-Oct-11 6:38
Andrew J. Burke16-Oct-11 6:38 
GeneralRe: setting form element values using ie TCppWebBrowser control Pin
App_16-Oct-11 7:44
App_16-Oct-11 7:44 
GeneralRe: setting form element values using ie TCppWebBrowser control Pin
Andrew J. Burke18-Oct-11 5:16
Andrew J. Burke18-Oct-11 5:16 
QuestionClarification regarding Boolean variable Pin
pix_programmer15-Oct-11 1:01
pix_programmer15-Oct-11 1:01 
AnswerRe: Clarification regarding Boolean variable Pin
André Kraak15-Oct-11 1:18
André Kraak15-Oct-11 1:18 
GeneralRe: i would like to elaborate further Pin
Software_Developer15-Oct-11 1:47
Software_Developer15-Oct-11 1:47 
GeneralRe: Clarification regarding Boolean variable Pin
Albert Holguin15-Oct-11 7:24
professionalAlbert Holguin15-Oct-11 7:24 
AnswerRe: Clarification regarding Boolean variable Pin
MartyTPS15-Oct-11 16:48
MartyTPS15-Oct-11 16:48 
AnswerRe: Clarification regarding Boolean variable Pin
Pranit Kothari16-Oct-11 20:38
Pranit Kothari16-Oct-11 20:38 
AnswerRe: Clarification regarding Boolean variable Pin
Chuck O'Toole17-Oct-11 5:01
Chuck O'Toole17-Oct-11 5:01 
QuestionProgress Window, where to attach Pin
jkirkerx14-Oct-11 9:42
professionaljkirkerx14-Oct-11 9:42 
I'm making a progress window for my Program, that is MDI. The progress window will show progress when a windows service is starting or stopping.

I wanted to make the progress window sort of universal, in which the Master Window owns it, and not the MDIChild Window,

I sort of confused here. I need the HWND from the master window to use in CreateWindowEx, but quite sure how to get it, Because I'm loading the Progress Windows from an MDIChild Window, and my create window fails. Actually I'm modeling the window first to make sure it works and looks right before I fully implement it.

BOOL ProgressBar_Popup::_show_ProgressWindow( HINSTANCE hInstance, HWND cWnd ) 
{

	LPWSTR					windowTitle						= L"Progress";

	// Font Variables
	HDC						hdc;

	// Get the Parent HWND
	gProgressBar_Popup_GAC = cWnd;

	// Get the current HDC
	hdc = GetDC(cWnd);
	hProgressBar_Popup_Instance = hInstance;
	
	LoadString(hProgressBar_Popup_Instance, IDC_PROGRESSBAR_POPUP, sz_ProgressBar_Popup_Class, MAX_LOADSTRING);

	// Create and Register the Popup Window
	_register_ProgressBar_Popup_Class(hInstance);
	hProgressBar_Popup = _create_ProgressBar_Popup(hInstance, windowTitle);
	_progressbar_Popup_Center( gProgressBar_Popup_GAC, hProgressBar_Popup );


	return TRUE;
}

ATOM ProgressBar_Popup::_register_ProgressBar_Popup_Class(HINSTANCE hInstance)
{
    WNDCLASSEX wcex;
	wcex.cbSize        = sizeof(WNDCLASSEX);

    wcex.style         = CS_HREDRAW | CS_VREDRAW;
    wcex.lpfnWndProc   = (WNDPROC) _progressbar_Popup_WndProc;
    wcex.cbClsExtra    = 0;
    wcex.cbWndExtra    = 0;
    wcex.hInstance     = hInstance;
    wcex.hIcon         = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_NASE2012_SUWIZARD));
    wcex.hCursor       = LoadCursor(NULL, IDC_ARROW);
    wcex.hbrBackground = (HBRUSH)GetStockObject( WHITE_BRUSH );
	wcex.lpszMenuName  = NULL; 
    wcex.lpszClassName = sz_ProgressBar_Popup_Class;
    wcex.hIconSm       = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));

	if (!RegisterClassEx(&wcex))
    {
        MessageBox(NULL,
            _T("Call to RegisterClassEx failed!"),
            _T("Win32 Guided Tour"),
            NULL);        
    }

    return RegisterClassEx(&wcex);
}

HWND ProgressBar_Popup::_create_ProgressBar_Popup(HINSTANCE hInstance, LPWSTR windowTitle)
{ 
	HWND hWnd = CreateWindowEx(
		WS_EX_TOPMOST,
        sz_ProgressBar_Popup_Class,         
        windowTitle,
		WS_POPUPWINDOW,    
        10, 10,                 
        200, 200,               
        gProgressBar_Popup_GAC,
		NULL,             
        hInstance,
		NULL
	);	

	if ( !hWnd ) 
	{
		// Create Window has failed
		MessageBox(hWnd,
			L"Progress Bar Popup has failed",
            L"Progress Bar Popup",
			MB_ICONEXCLAMATION | MB_OK);
	}
	else
	{
		ShowWindow(hWnd, SW_SHOW );
		UpdateWindow(hWnd);

	}

	return hWnd;
    
}

QuestionRe: Progress Window, where to attach Pin
David Crow14-Oct-11 10:06
David Crow14-Oct-11 10:06 

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.