Click here to Skip to main content
16,012,352 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: string tables Pin
Joaquín M López Muñoz6-Feb-02 3:36
Joaquín M López Muñoz6-Feb-02 3:36 
GeneralTable Pin
6-Feb-02 3:07
suss6-Feb-02 3:07 
GeneralRe: Table Pin
Mazdak6-Feb-02 3:11
Mazdak6-Feb-02 3:11 
GeneralRe: Table Pin
Carlos Antollini6-Feb-02 3:29
Carlos Antollini6-Feb-02 3:29 
GeneralUsing FindWindow() Pin
Chris Meech6-Feb-02 2:45
Chris Meech6-Feb-02 2:45 
GeneralRe: Using FindWindow() Pin
Mazdak6-Feb-02 3:31
Mazdak6-Feb-02 3:31 
GeneralRe: Using FindWindow() Pin
Nish Nishant6-Feb-02 4:47
sitebuilderNish Nishant6-Feb-02 4:47 
GeneralRe: Using FindWindow() Pin
Chris Meech6-Feb-02 5:10
Chris Meech6-Feb-02 5:10 
Thanks Nish and Mazdak for your suggestions.

I ended up doing the following and it has tested out fine.
HWND    hWnd        =   ::GetDesktopWindow();
HWND    hSessionA   =   NULL;

do
{
    if ( hSessionA == NULL )
        hSessionA   =   ::GetWindow(hWnd, GW_CHILD);

    if ( IsWindowVisible(hSessionA) )
    {
        CString         strWindowText;
        char*           pWindowText     =   strWindowText.GetBufferSetLength(sizeof(szSessionA));

        GetWindowText(hSessionA, pWindowText, sizeof(szSessionA));
        strWindowText.ReleaseBuffer();
        strWindowText.MakeUpper();
        if ( strWindowText.Compare(szSessionA) == 0 )
            break;
    }
    hSessionA = GetWindow(hSessionA, GW_HWNDNEXT);
}
while ( (hSessionA) || AfxMessageBox("Please start your SESSIONA and then click OK to search for this session again or you may click Cancel in order to quit.", MB_ICONQUESTION|MB_OKCANCEL) == IDOK );


When I drop out of the while loop, hSessionA is either NULL or contains a value that is the HWND for the window I'm looking for.

Thanks again.

Chris Meech
Generaldirectly changing the exponent of a type double Pin
Filip Govaerts6-Feb-02 2:36
Filip Govaerts6-Feb-02 2:36 
GeneralRe: directly changing the exponent of a type double Pin
Joaquín M López Muñoz6-Feb-02 3:21
Joaquín M López Muñoz6-Feb-02 3:21 
GeneralRe: directly changing the exponent of a type double Pin
Filip Govaerts6-Feb-02 3:25
Filip Govaerts6-Feb-02 3:25 
Generalloading icon Pin
6-Feb-02 2:01
suss6-Feb-02 2:01 
GeneralRe: loading icon Pin
Mazdak6-Feb-02 2:12
Mazdak6-Feb-02 2:12 
GeneralRe: loading icon Pin
6-Feb-02 2:57
suss6-Feb-02 2:57 
GeneralRe: loading icon Pin
Mazdak6-Feb-02 3:04
Mazdak6-Feb-02 3:04 
GeneralRe: loading icon Pin
6-Feb-02 4:28
suss6-Feb-02 4:28 
GeneralRe: loading icon Pin
Mazdak6-Feb-02 20:42
Mazdak6-Feb-02 20:42 
GeneralSearch for a file... Pin
Rickard Andersson206-Feb-02 1:54
Rickard Andersson206-Feb-02 1:54 
GeneralRe: Search for a file... Pin
Mazdak6-Feb-02 2:34
Mazdak6-Feb-02 2:34 
GeneralRe: Search for a file... Pin
Derek Waters6-Feb-02 11:31
Derek Waters6-Feb-02 11:31 
Generalbool if dependant statement change Pin
Kuniva6-Feb-02 1:35
Kuniva6-Feb-02 1:35 
GeneralRe: bool if dependant statement change Pin
Magnus Westin6-Feb-02 2:04
Magnus Westin6-Feb-02 2:04 
GeneralCF_HTML clipboard format Pin
ed welch6-Feb-02 1:26
ed welch6-Feb-02 1:26 
GeneralRe: CF_HTML clipboard format Pin
Jon Hulatt6-Feb-02 2:54
Jon Hulatt6-Feb-02 2:54 
GeneralFTP connection problems like 12003, what's this?! Pin
EdgarBM6-Feb-02 1:24
EdgarBM6-Feb-02 1: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.