Click here to Skip to main content
16,005,734 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralHWND_BOTTOM and SetWindowPos Pin
Blaster10-Sep-02 5:44
Blaster10-Sep-02 5:44 
GeneralRe: HWND_BOTTOM and SetWindowPos Pin
Joaquín M López Muñoz10-Sep-02 6:44
Joaquín M López Muñoz10-Sep-02 6:44 
GeneralRe: HWND_BOTTOM and SetWindowPos Pin
Blaster10-Sep-02 6:49
Blaster10-Sep-02 6:49 
GeneralRe: HWND_BOTTOM and SetWindowPos Pin
Joaquín M López Muñoz10-Sep-02 7:12
Joaquín M López Muñoz10-Sep-02 7:12 
GeneralRe: HWND_BOTTOM and SetWindowPos Pin
Blaster10-Sep-02 7:39
Blaster10-Sep-02 7:39 
GeneralRe: HWND_BOTTOM and SetWindowPos Pin
Joaquín M López Muñoz10-Sep-02 7:43
Joaquín M López Muñoz10-Sep-02 7:43 
GeneralMFC CRecordset ODBC Access Rights Pin
Alberto Zanetti10-Sep-02 5:39
Alberto Zanetti10-Sep-02 5:39 
GeneralDialog CStatic update problem Pin
simbakid10-Sep-02 5:11
simbakid10-Sep-02 5:11 
Greetings all (first post on CodeProject),

Have a fairly simple Dialog based application (modal) which
calls another class (Worker) to perform a list of tasks. Dialog box
class has a simple method for setting the window text of a
CStatic, all works fine (window text is updated correctly
by Worker class until Worker class makes a ShellExecuteEx call
to run another exe. Upon return from the ShellExecuteEx call
the CStatic window text can't be updated, the calls are there
to change the text, it just doesn't work, I've tried a few combinations
of SetForeGroundWindow(), ShowWindow (SW_HIDE/SW_SHOW), Invalidate()
and so on... all to no avail.

Read around various sites and forums with no real success.

Code snipper follows:
if (ShellExecuteEx(&stShellInfo)) {<br />
<br />
		int nResult = (int)stShellInfo.hInstApp;<br />
		if (nResult >= 32) {<br />
			theApp.SetSubProgressMessage("SHELLINFO hInstApp = process successful");<br />
		}<br />
		else {<br />
			theApp.SetSubProgressMessage("Process failed");<br />
		}<br />
<br />
		// wait for runjob to finish<br />
		WaitForSingleObject(stShellInfo.hProcess, INFINITE);<br />
<br />
		// Close process and thread handles. <br />
		CloseHandle(stShellInfo.hProcess);<br />
<br />
		// bring progress dialog back to front<br />
		CWnd *pWndPrev, *pWndChild;<br />
		if (pWndPrev = CWnd::FindWindow(NULL, _T("Progress"))) {<br />
			pWndChild = pWndPrev->GetLastActivePopup();<br />
			// If iconic, restore the main window<br />
			if (pWndPrev->IsIconic()) {<br />
				pWndPrev->ShowWindow(SW_RESTORE);<br />
			}<br />
<br />
			// Bring the main window or its popup to the foreground<br />
			//pWndChild->SetForegroundWindow();<br />
			//pWndChild->ShowWindow(SW_RESTORE);<br />
			//pWndChild->SetFocus();<br />
<br />
			//pWndChild->Invalidate();<br />
			//pWndChild->SetForegroundWindow();<br />
			pWndChild->ShowWindow(SW_HIDE);<br />
			pWndChild->ShowWindow(SW_SHOW);<br />
		}<br />
...


No message after the "process successful" message are displayed.

Any suggestion/help/info would be greatly appreciated.

BTW, it's probably obvious that I'm new to MFC.

MTIA.

Chris Confused | :confused:
GeneralRe: Dialog CStatic update problem Pin
Pavel Klocek10-Sep-02 5:33
Pavel Klocek10-Sep-02 5:33 
GeneralRe: Dialog CStatic update problem Pin
simbakid10-Sep-02 22:29
simbakid10-Sep-02 22:29 
GeneralRe: Dialog CStatic update problem Pin
simbakid11-Sep-02 0:55
simbakid11-Sep-02 0:55 
GeneralRe: Dialog CStatic update problem Pin
Pavel Klocek11-Sep-02 1:31
Pavel Klocek11-Sep-02 1:31 
GeneralTo make a Round Shape window in MFC Pin
Inam10-Sep-02 5:06
Inam10-Sep-02 5:06 
GeneralRe: To make a Round Shape window in MFC Pin
Paul M Watt10-Sep-02 5:11
mentorPaul M Watt10-Sep-02 5:11 
GeneralUsing GDI Pin
Zayax10-Sep-02 4:46
Zayax10-Sep-02 4:46 
GeneralRe: Using GDI Pin
Pavel Klocek10-Sep-02 4:57
Pavel Klocek10-Sep-02 4:57 
GeneralRe: Using GDI Pin
Paul M Watt10-Sep-02 5:07
mentorPaul M Watt10-Sep-02 5:07 
GeneralRe: Using GDI Pin
Zayax10-Sep-02 5:16
Zayax10-Sep-02 5:16 
GeneralRe: Using GDI Pin
Paul M Watt10-Sep-02 5:17
mentorPaul M Watt10-Sep-02 5:17 
GeneralRe: Using GDI Pin
Zayax10-Sep-02 5:30
Zayax10-Sep-02 5:30 
GeneralRe: Using GDI Pin
Paul M Watt10-Sep-02 5:53
mentorPaul M Watt10-Sep-02 5:53 
GeneralWarning: skipping non-radio button in group. Pin
jimNLX10-Sep-02 3:53
jimNLX10-Sep-02 3:53 
GeneralRe: Warning: skipping non-radio button in group. Pin
Pavel Klocek10-Sep-02 4:00
Pavel Klocek10-Sep-02 4:00 
GeneralRe: Warning: skipping non-radio button in group. Pin
jimNLX10-Sep-02 4:13
jimNLX10-Sep-02 4:13 
GeneralRe: Warning: skipping non-radio button in group. Pin
Gary R. Wheeler11-Sep-02 14:49
Gary R. Wheeler11-Sep-02 14:49 

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.