here is a code snippet I found on this site a few weeks ago. I think the title of the article is something like "Dialog box tips & tricks". I haven't tried it yet, but I thought it may come in handy, so I put it in my Code Librarian:
//Attach foreground window thread
//to our thread
AttachThreadInput(
GetWindowThreadProcessId(
::GetForegroundWindow(),NULL),
GetCurrentThreadId(),TRUE);
//Do our stuff here ;-)
SetForegroundWindow();
SetFocus(); //Just playing safe
//Detach the attached thread
AttachThreadInput(
GetWindowThreadProcessId(
::GetForegroundWindow(),NULL),
GetCurrentThreadId(),FALSE);
Who are all these people and what are they doing in my house?...Me in 30 years, inside a grocery store bdiamond :zzz: