Article View: borland.public.cppbuilder.nativeapi
Article #10973Re: ShowWindow API function doesn't work
From: davichu
Date: Mon, 08 Mar 2004 19:08
Date: Mon, 08 Mar 2004 19:08
82 lines
3125 bytes
3125 bytes
Hi Remy,
I found information about SetForegroundWindow at MSDN site. They gave me
aditional information about this function such as FlashWindowEx fuction, but
when run the follow code I suppose that windows must be fhashing, but
nothing happenened.
It could be the handler badly defined?
I didn't get correctly the application handler ?
bool TRunningProcessManager::TraerAlFrenteProcesoEnEjecucion( AnsiString
args_NombreProceso)
{
//local variables
tagPROCESSENTRY32 pe32;
HWND snap_hand ;
HWND mihandler;
//initial assignment
snap_hand = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
pe32.dwSize = sizeof(pe32);
//getting system proccess
if ( (int) snap_hand == -1 )
return false;
if( !Process32First( snap_hand,&pe32 ) )
return false;
while( Process32Next ( snap_hand,&pe32 ) )
{
if( args_NombreProceso == pe32.szExeFile )
{
mihandler = OpenProcess(PROCESS_ALL_ACCESS,false,(int)
pe32.th32ProcessID);
if(mihandler)
{
SetForegroundWindow(mihandler);
FLASHWINFO x = {sizeof(FLASHWINFO),mihandler, FLASHW_ALL ,10000,
50};
FlashWindowEx(&x); <================================== this line
doen't work
return true;
} // en if ps is not zero
} // end if both names are equal
} //end while
}
"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> escribi๏ฟฝ en el
mensaje news:404cdaa0$1@newsgroups.borland.com...
>
> "davichu" <dmarquezl arroba hotmail punto com> wrote in message
> news:404cd7ce@newsgroups.borland.com...
>
> > I need to bring to front a specific window using
> > the ShowWindow API function, but doesn't work.
>
> ShowWindow() merely ensures that the window is visible onscreen, but it
does
> not always guarantee that the window is brought to the front. You should
> use SetForegroundWindow() for that instead. However, there are
restrictions
> on how SetForegroundWindow() can be used. Refer to MSDN for more details.
>
>
> Gambit
>
>
Technical Details
Message-ID:
<404cfd85@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.ash.giganews.com!nntp.giganews.com!newshosting.com!nx01.iad01.newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<404cd7ce@newsgroups.borland.com> <404cdaa0$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10cc67,ca16847a53213adb X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-03-08 15:21:15 PST From: "davichu" <dmarquezl arroba hotmail punto com> Newsgroups: borland.public.cppbuilder.nativeapi References: <404cd7ce@newsgroups.borland.com> <404cdaa0$1@newsgroups.borland.com> Subject: Re: ShowWindow API function doesn't work Date: Mon, 8 Mar 2004 20:08:10 +0100 Lines: 84 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 200.75.9.107 Message-ID: <404cfd85@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1078787461 200.75.9.107 (8 Mar 2004 15:11:01 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!border1.nntp.ash.giganews.com!nntp.giganews.com!newshosting.com!nx01.iad01.newshosting.com!203.109.252.33.MISMATCH!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail