|
-
Mar 23rd, 2004, 04:36 PM
#1
Thread Starter
Lively Member
Bring active window on the top..?
My application is calling an other process. If that process is already runnning then my application does not open a new instance, but use AppActivate.
How can i bring this activated application window to the front (from Windows toolbar)..?
thks for any help...
-
Mar 23rd, 2004, 04:44 PM
#2
Frenzied Member
Something like this? Me.WindowState = FormWindowState.Normal or .Maximized
HTH,
Mike
-
Mar 23rd, 2004, 04:47 PM
#3
Thread Starter
Lively Member
the problem is that i'm calling the application from different process..
-
Mar 23rd, 2004, 05:25 PM
#4
PowerPoster
"the problem is that i'm calling the application from different process.."
What do you mean by "process"? Project? Procedure? Solution? Another language?
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Mar 23rd, 2004, 05:30 PM
#5
Thread Starter
Lively Member
It's a different Windows Form Project (exe) running in windows as an independent process... Both in same vb.net Solution.
-
Mar 23rd, 2004, 08:58 PM
#6
PowerPoster
Hi,
"Something like this? Me.WindowState = rmWindowState.Normal or .Maximized"
instead of Me use ProjectName.FormName
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Mar 24th, 2004, 10:01 AM
#7
Frenzied Member
Wow, taxes, I didn't know one could do that. Cool.
-
Mar 24th, 2004, 03:44 PM
#8
Thread Starter
Lively Member
That's about what i supposed it to be from beginning (i'm quite new with .net), but in my Solution i can't refer to other Projects...
I must have some base thing wrong..?
-
Mar 24th, 2004, 03:57 PM
#9
Frenzied Member
taxes may know, I sure don't - you can't even reference another project unless it's a .dll.
I just tried putting Me.WindowState = FormWindowState.Normal in the Activated event - that seems to work just fine, but not sure if that's what you want.
Mike
-
Mar 24th, 2004, 04:12 PM
#10
Thread Starter
Lively Member
Me.WindowState = FormWindowState.Normal works fine....
The point and problem is that i'm not calling Me. but other Project.
Any idea how to set "normal window state" to other application (say Calculator for example) without opening a new instance of it..?
With Shell i can set the windows state, but don't know how to avoid opening always a new instance....
-
Mar 24th, 2004, 04:21 PM
#11
Frenzied Member
Oh - I see what you're saying now - I thought the form that you wanted to bring up from the taskbar was your own code.
Not sure if there's anything in .NET to do that, but maybe an API call like SetWindowPos would help http://msdn.microsoft.com/library/de...tWindowPos.asp or the BringWindowToTop function.
-
Mar 24th, 2004, 04:26 PM
#12
Frenzied Member
ok - I just re-read your posts. If the form you want to bring up from the task bar is your own code, then the Me business will work.
I have this code in WindowsApplication1 - the title of the form is "Form1"
VB Code:
Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated
Me.WindowState = FormWindowState.Normal
End Sub
This code is in WindowsApplication2
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
AppActivate("Form1")
End Sub
And that works.
-
Mar 24th, 2004, 04:35 PM
#13
Thread Starter
Lively Member
Sorry, i was not too clear in my msgs...
Thks yrs, i'll check the link...
I'm getting a bit frustrated with this problem, as AppActivate works simply and perfectly if the application is not minimized in the windows toolbar...
-
Mar 24th, 2004, 04:37 PM
#14
Thread Starter
Lively Member
i missed yr latest, that looks good... will try it.
-
Mar 24th, 2004, 04:50 PM
#15
Thread Starter
Lively Member
And that works. Thanks a lot, i knew there's an easy way out...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|