Click here to Skip to main content
15,924,507 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Parity !!! Pin
Tim Deveaux15-Jun-01 3:37
Tim Deveaux15-Jun-01 3:37 
GeneralMultiple different dialogs in an MDI. Pin
David Fleming14-Jun-01 16:51
David Fleming14-Jun-01 16:51 
GeneralRe: Multiple different dialogs -- answered it myself Pin
David Fleming15-Jun-01 15:08
David Fleming15-Jun-01 15:08 
GeneralRe: Multiple different dialogs -- answered it myself Pin
20-Jun-01 11:08
suss20-Jun-01 11:08 
Generalhelp in mfc Pin
Julio14-Jun-01 12:16
Julio14-Jun-01 12:16 
GeneralRe: help in mfc Pin
Carlos Antollini14-Jun-01 12:25
Carlos Antollini14-Jun-01 12:25 
Generalgetting hwnd from process id Pin
14-Jun-01 12:02
suss14-Jun-01 12:02 
GeneralRe: getting hwnd from process id Pin
Oliver Daniel14-Jun-01 14:15
Oliver Daniel14-Jun-01 14:15 
The thing is that the process can have any number of windows open.

The only thing that comes to mind is that you could walk the window list and compare the process id's of all parent windows to the process id that you have.

It's a bit rough but here's an idea. Note, the I haven't tried it myself.


void GetProcessWindows(DWORD dwProcID)
{
DWORD dwWndProcId;
HWND hwndDesktop, hwndParent;

// start with the desktop
// all parent windows will be a child of the dekstop

hwndDesktop = GetDesktopWindow();

// get first parent window

hwndParent = GetWindow(hwndDesktop, GW_CHILD);

// go through this and all subsequent parent windows comparing their
// process id's with the one we are seeking info on

while(hwndParent) {

GetWindowThreadProcessId(hwndParent, &dwWndProcId);

// does window handle belong to the process we are checking?

if(dwWndProcId == dwProcID) {

// report the handle (or do something meaningful)
TRACE("Process window handle = %08x\n", dwWndProcId);
}

hwndParent = GetWindow(hwndDesktop, GW_HWNDNEXT);
}
}


GeneralRe: getting hwnd from process id Pin
Tim Deveaux14-Jun-01 14:31
Tim Deveaux14-Jun-01 14:31 
GeneralRe: getting hwnd from process id Pin
#realJSOP15-Jun-01 1:22
professional#realJSOP15-Jun-01 1:22 
GeneralCListCtrl Scrolling Question Pin
14-Jun-01 10:30
suss14-Jun-01 10:30 
GeneralAgain...Win9X and NT compatibility problem Pin
14-Jun-01 10:27
suss14-Jun-01 10:27 
GeneralRe: Again...Win9X and NT compatibility problem Pin
Tomasz Sowinski15-Jun-01 0:21
Tomasz Sowinski15-Jun-01 0:21 
GeneralUsing STL map<...> Pin
Rostrox14-Jun-01 10:11
Rostrox14-Jun-01 10:11 
GeneralRe: Using STL map<...> Pin
Ben Burnett14-Jun-01 15:15
Ben Burnett14-Jun-01 15:15 
GeneralRe: Using STL map<...> Pin
14-Jun-01 17:02
suss14-Jun-01 17:02 
GeneralRe: Using STL map<...> Pin
markkuk14-Jun-01 20:35
markkuk14-Jun-01 20:35 
GeneralReading and Writing files in Win32 Pin
14-Jun-01 9:11
suss14-Jun-01 9:11 
GeneralRe: Reading and Writing files in Win32 Pin
14-Jun-01 9:54
suss14-Jun-01 9:54 
GeneralGetting data from MSCOMM !!! Pin
Hadi Rezaee14-Jun-01 8:59
Hadi Rezaee14-Jun-01 8:59 
GeneralLoading small, built-in icons Pin
14-Jun-01 7:17
suss14-Jun-01 7:17 
GeneralRe: Loading small, built-in icons Pin
Ben Burnett14-Jun-01 7:41
Ben Burnett14-Jun-01 7:41 
GeneralRe: Loading small, built-in icons Pin
14-Jun-01 7:57
suss14-Jun-01 7:57 
GeneralRe: Loading small, built-in icons Pin
14-Jun-01 8:03
suss14-Jun-01 8:03 
GeneralRe: Loading small, built-in icons Pin
Ben Burnett14-Jun-01 9:19
Ben Burnett14-Jun-01 9:19 

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.