471,617 Members | 1,112 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,617 software developers and data experts.

switch between external application

Hi,

I am creating a sort of desktop application. My problem is that word and
excel (and other external applications) are not responding to the
SetFocus method (or setforegroundwindow or bringwindowtotop or other
methods from user32.dll). Is there a posibility to do this handy in c#
or do i need to call a certain sequence of methods to give an
application the focus?

Best regards,

Bart
Feb 9 '06 #1
1 2925
Bart ,

There is no managed solution of doing this. You need to use PInvoke and
Windows API.

Both methods that you mentioned should do the truck for word and excel. I
guess you pass a wrong HWND
--

Stoitcho Goutsev (100)

"Bart van der Heijden" <ba**@lekkerknagen.nl> wrote in message
news:69**************************@news2.tudelft.nl ...
Hi,

I am creating a sort of desktop application. My problem is that word and
excel (and other external applications) are not responding to the SetFocus
method (or setforegroundwindow or bringwindowtotop or other methods from
user32.dll). Is there a posibility to do this handy in c# or do i need to
call a certain sequence of methods to give an application the focus?

Best regards,

Bart

Feb 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Andrew | last post: by
7 posts views Thread by =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post: by
1 post views Thread by XIAOLAOHU | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.