Re: Windows 2003 server SetForegroundWindow|BringWindowToTop|SetWi
- From: "Lolo" <Lolo@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 13 Feb 2006 00:04:27 -0800
Hello,
Thank you for you answer, but just to give you more information, I'm using
Visual .Net C# and into my code I'm using this code:
[DllImport("user32.dll")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
try
{
SetForegroundWindow(stTempRunningApplication.ProcessInfo.MainWindowHandle);
}
catch(Exception err)
{
MessageBox.Show(err.Message);
}
And I see the exception with any Window form not only with mine, for example
notepad.exe, calc.exe
I hope that I give you more information to help me.
BR
Laurent
"Joseph M. Newcomer" wrote:
An exception sounds surprising; none of those APIs are specified as throwing an exception..
You would have to show some code to explain what is going on here.
The discussion of SetForegroundWindow does suggest that there are certain limitations. For
example, a process can only set the foreground window if it is already the foreground
process (e.g., it can cause one of its own windows to yield foregroundness), or it is a
process started by the foreground process, or if there is no current foreground process.
There are a few other conditions. You have not stated the entire problem; for example,
is it one of your windows for which you are trying to set the foreground property?
Perhaps privileges affect this, but without a complete specification of the problem, it is
hard for anyone to test what your situation is.
joe
On Thu, 9 Feb 2006 01:07:27 -0800, "Lolo" <Lolo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Hi all,Joseph M. Newcomer [MVP]
I'm trying to use this functions
(SetForegroundWindow|BringWindowToTop|SetWindowPos) on Windows 2003 server,
but it is working when I have a Administrator level and when I try the
sameprogam with the operator level I have an exception like <Impossible to
run this information from the remote pc>.
I tryed the same program on Window XP with the operator level and it is
working.
Somebody knows why ?
I'm looking forward to receiving an answer soon possible.
BR
lolo
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
- References:
- Re: Windows 2003 server SetForegroundWindow|BringWindowToTop|SetWindow
- From: Joseph M . Newcomer
- Re: Windows 2003 server SetForegroundWindow|BringWindowToTop|SetWindow
- Prev by Date: winsock: fail to register to receive broad cast messages
- Next by Date: Re: Windows XP x64 MFC application problem
- Previous by thread: Re: Windows 2003 server SetForegroundWindow|BringWindowToTop|SetWindow
- Next by thread: Re: CSV / text Files Comparasions
- Index(es):
Relevant Pages
|