 |

10-29-2003, 11:29 AM
|
 |
Regular
|
|
Join Date: Oct 2003
Posts: 80
|
|
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
|
|

10-30-2003, 04:41 AM
|
|
Promising Talent
Retired Moderator * Guru *
|
|
Join Date: May 2002
Location: Brussels
Posts: 3,601
|
|
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
|
|

10-31-2003, 03:57 AM
|
 |
Regular
|
|
Join Date: Oct 2003
Posts: 80
|
|
|
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
|
|

10-31-2003, 04:17 AM
|
|
Promising Talent
Retired Moderator * Guru *
|
|
Join Date: May 2002
Location: Brussels
Posts: 3,601
|
|
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.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|