Click here to Skip to main content
15,914,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Change Window Color [modified] Pin
Mark Salsbery10-Aug-07 6:32
Mark Salsbery10-Aug-07 6:32 
GeneralRe: Change Window Color Pin
WayneK10010-Aug-07 8:44
WayneK10010-Aug-07 8:44 
GeneralRe: Change Window Color Pin
Mark Salsbery10-Aug-07 9:50
Mark Salsbery10-Aug-07 9:50 
AnswerRe: Change Window Color Pin
Nishad S8-Aug-07 18:40
Nishad S8-Aug-07 18:40 
AnswerRe: Change Window Color Pin
Hamid_RT8-Aug-07 19:19
Hamid_RT8-Aug-07 19:19 
QuestionWhy I can't bring focus to IE browser created thru createprocess Pin
sdittmer8-Aug-07 12:54
sdittmer8-Aug-07 12:54 
AnswerRe: Why I can't bring focus to IE browser created thru createprocess Pin
Mark Salsbery8-Aug-07 13:05
Mark Salsbery8-Aug-07 13:05 
GeneralRe: Why I can't bring focus to IE browser created thru createprocess Pin
sdittmer8-Aug-07 14:37
sdittmer8-Aug-07 14:37 
Thanks for the reply. That didn't work either (same result) but I found out how to make it work. Apparently multiple windows (within IE) had the same processId and I needed to find the main window for IE in order to get the right handle. So it works no with the code below.

Stephen
//Function to enumerate all windows.
int CALLBACK EnumWindowsProc(HWND hwnd, LPARAM param)
{
DWORD pID;
DWORD TpID = GetWindowThreadProcessId(hwnd, &pID);//get process id
if (pID == (DWORD)param)
{

TCHAR windowClass[256];
CString windowText, msg, aclass ;
CWnd* window = CWnd::FromHandle(
hwnd);
if (window != NULL )
{
window->GetWindowText( windowText);
GetClassName(hwnd, windowClass, sizeof(windowClass));
msg.Format(_T("processId %d: windowclass %s: windowtext %s \n"),pID,windowClass, windowText);

TRACE(msg);
}
aclass = windowClass ;
if (apphwnd == NULL && aclass.CompareNoCase("IEFrame") == 0)
{
apphwnd=hwnd;//hwnd is the window handle
apID = pID ;
}
}
return true;
}

Stephen Da-Terminator
SCI Solutions

QuestionThread function parameter Pin
alberthyc8-Aug-07 10:31
alberthyc8-Aug-07 10:31 
AnswerRe: Thread function parameter Pin
koumodaki8-Aug-07 10:41
koumodaki8-Aug-07 10:41 
GeneralRe: Thread function parameter Pin
alberthyc8-Aug-07 11:08
alberthyc8-Aug-07 11:08 
GeneralRe: Thread function parameter [modified] Pin
alberthyc8-Aug-07 11:21
alberthyc8-Aug-07 11:21 
GeneralRe: Thread function parameter Pin
Nishad S8-Aug-07 18:45
Nishad S8-Aug-07 18:45 
QuestionSetting multile line text in a document Pin
koumodaki8-Aug-07 10:23
koumodaki8-Aug-07 10:23 
AnswerRe: Setting multile line text in a document Pin
Reagan Conservative8-Aug-07 11:18
Reagan Conservative8-Aug-07 11:18 
AnswerRe: Setting multile line text in a document Pin
fefe.wyx8-Aug-07 14:58
fefe.wyx8-Aug-07 14:58 
QuestionWhy my MDI application closes when I close a dialog box inside? Pin
saravana0018-Aug-07 7:51
saravana0018-Aug-07 7:51 
AnswerRe: Why my MDI application closes when I close a dialog box inside? Pin
Russell'8-Aug-07 8:10
Russell'8-Aug-07 8:10 
AnswerRe: Why my MDI application closes when I close a dialog box inside? Pin
jk chan8-Aug-07 17:41
jk chan8-Aug-07 17:41 
QuestionHelp With Arrays Pin
simoncoul8-Aug-07 7:46
simoncoul8-Aug-07 7:46 
AnswerRe: Help With Arrays [modified] Pin
Russell'8-Aug-07 7:59
Russell'8-Aug-07 7:59 
GeneralRe: Help With Arrays Pin
simoncoul8-Aug-07 8:16
simoncoul8-Aug-07 8:16 
GeneralRe: Help With Arrays Pin
jhwurmbach8-Aug-07 8:28
jhwurmbach8-Aug-07 8:28 
GeneralRe: Help With Arrays Pin
simoncoul8-Aug-07 8:33
simoncoul8-Aug-07 8:33 
GeneralRe: Help With Arrays Pin
jhwurmbach8-Aug-07 8:35
jhwurmbach8-Aug-07 8:35 

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.