Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Interface and Graphics > Running two applications alongside each other


Reply
 
Thread Tools Display Modes
  #1  
Old 10-29-2003, 11:29 AM
km176351's Avatar
km176351 km176351 is offline
Regular
 
Join Date: Oct 2003
Posts: 80
Question Running two applications alongside each other


I need to develop an application that will run microsoft word at the left side of the screen and a sort of help/tutorial guide at the right side of the screen. Sort of shifting word across to make room. This is because people will work on the word file according to the tutorial guide.
How could I go about doing this. Will I need to get a window splitter control?

Any suggestions much appreciated
Reply With Quote
  #2  
Old 10-30-2003, 04:41 AM
Deadalus Deadalus is offline
Promising Talent

Retired Moderator
* Guru *
 
Join Date: May 2002
Location: Brussels
Posts: 3,601
Default

If all you want to do is position the window of Word, you can use functions like FindWindow,ShowWindow and SetWindowPos. A small example, that supposes you have a window titled "Document1 - Microsoft Word":
Code:
Option Explicit Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, _ ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Private Const SW_SHOWNORMAL = 1 Private Const SWP_SHOWWINDOW = &H40 Private Const HWND_TOPMOST = -1 Private Sub Command1_Click() Dim WinWnd As Long, sFind As String sFind = "Document1 - Microsoft Word" WinWnd = FindWindow(vbNullString, sFind) If WinWnd = 0 Then MsgBox "Couldn't find the window ..." Exit Sub Else ShowWindow WinWnd, SW_SHOWNORMAL SetWindowPos WinWnd, HWND_TOPMOST, 0, 0, ScaleX(Screen.Width / 2, ScaleMode, vbPixels), _ ScaleY(Screen.Height, ScaleMode, vbPixels), SWP_SHOWWINDOW End If End Sub
Reply With Quote
  #3  
Old 10-31-2003, 03:57 AM
km176351's Avatar
km176351 km176351 is offline
Regular
 
Join Date: Oct 2003
Posts: 80
Question

That is certainly the layout I was looking for, however, the next stage will be to have my tutorial program running alongside. If I was to resize the word document, my program would also resize and vice versa. In effect, both programs should be on top e.g.

______________________
| | |
| | |
| | |
| | |
| | |
______________________
Word Tutorial prog

Resize word

______________________
| | |
| | |

Tutorial prog contents squeeze up. Similar to the help pane in word xp
Reply With Quote
  #4  
Old 10-31-2003, 04:17 AM
Deadalus Deadalus is offline
Promising Talent

Retired Moderator
* Guru *
 
Join Date: May 2002
Location: Brussels
Posts: 3,601
Default

That's a bit trickier since you need to know when the Word app resizes. A relatively easy way could be checking its position and dimensions with something like GetWindowRect.

By the way, use [ code] tags to keep spaces in text on the forum.

Quote:
Originally Posted by km176351
That is certainly the layout I was looking for, however, the next stage will be to have my tutorial program running alongside. If I was to resize the word document, my program would also resize and vice versa. In effect, both programs should be on top e.g.

Code:
______________________
|               |                 |
|               |                 |
|               |                 |
|               |                 |
|               |                 |
______________________
Word            Tutorial prog

Resize word

______________________
|                      |          |
|                      |          |
Tutorial prog contents squeeze up. Similar to the help pane in word xp


Edit: I've left something out. I'm talking about checking position and size in a timer.

Last edited by Deadalus; 10-31-2003 at 09:05 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running and closing other applications. rpk2006 General 1 09-15-2003 12:11 PM
Running more Applications at the same time TheNaughty General 1 01-08-2003 01:56 AM
Running Applications (and services) Symetrix General 1 11-05-2002 09:32 AM
suspend other applications while Access 97 code is running strBean API 0 10-14-2002 02:34 PM
Running external applications mikek General 7 10-15-2001 12:56 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->