Article View: borland.public.cppbuilder.nativeapi
Article #10846Re: ShowWindow API function doesn't work
From: davichu
Date: Wed, 10 Mar 2004 16:12
Date: Wed, 10 Mar 2004 16:12
46 lines
2418 bytes
2418 bytes
thank, my problem, was the process handle, and I used the enumwindow
function , but I found another problem.
the SetForeGroundWindow, bring a window to the front, but if that window are
minimized, nothing happened.
I' trying with the SetActiveWindow and ShowWiondow, but doesn't work.
sorry for the lot questions.
"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> escribi๏ฟฝ en el
mensaje news:404d10b6@newsgroups.borland.com...
>
> "davichu" <dmarquezl arroba hotmail punto com> wrote in message
> news:404cfd85@newsgroups.borland.com...
>
> > if( !Process32First( snap_hand,&pe32 ) )
> > return false;
> >
> > while( Process32Next ( snap_hand,&pe32 ) )
>
> You are skipping the first process altogether. Change your code to use a
> do...while() loop instead.
>
> > if( args_NombreProceso == pe32.szExeFile )
>
> You should use a case-insensitive comparison, such as AnsiSameText().
>
> > mihandler = OpenProcess(PROCESS_ALL_ACCESS,false,(int)
> > pe32.th32ProcessID);
> > if(mihandler)
> > {
> > SetForegroundWindow(mihandler);
>
> You are trying to focus a process handle, not a window handle. They are
not
> the same thing. You have to find the window handle manually. Look at the
> EnumWindows() and GetWindowThreadProcessId() functions.
>
>
> Gambit
>
>
Technical Details
Message-ID:
<404f773e$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<404cd7ce@newsgroups.borland.com> <404cdaa0$1@newsgroups.borland.com> <404cfd85@newsgroups.borland.com> <404d10b6@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-10 12:40:53 PST From: "davichu" <dmarquezl arroba hotmail punto com> Newsgroups: borland.public.cppbuilder.nativeapi References: <404cd7ce@newsgroups.borland.com> <404cdaa0$1@newsgroups.borland.com> <404cfd85@newsgroups.borland.com> <404d10b6@newsgroups.borland.com> Subject: Re: ShowWindow API function doesn't work Date: Wed, 10 Mar 2004 17:12:02 +0100 Lines: 48 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: <404f773e$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1078949694 200.75.9.107 (10 Mar 2004 12:14:54 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail