Using VBA to resize main app window in RSVIEW

brdwater

Member
Join Date
Mar 2008
Location
Montana
Posts
4
In RsView, I have a "configuration" button which aborts all graphic displays and re-loads(displays) them at particular locations in the main RSView 32 window.
The amount of screen real estate varies depending on which graphics are loaded and where they are displayed. It usually necessitates the operator manually resizing the main RSView32 application window to optimum size.

I would like to automate this process entirely by tying a command in to that same button which will resize the main window. I assume VBA can accomplish this, and I can program a little in VBA, but I'm at a loss as to how to get this done.

If anyone has some code that can do this, or tell me a better way, please let me know.
Thank you.
 
I figured it out

Here is what I came up with.

Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long

Private Declare Function MoveWindow Lib "user32.dll" ( _
ByVal hwnd As Long, _
ByVal x As Long, _
ByVal y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, _
ByVal bRepaint As Long) As Long


Public Sub moveRSV32Window()
Dim lpCaption As String
Dim winHandle As Long
Dim mwind As Long

lpCaption = "My Window Caption"
winHandle = FindWindow(vbNullString, lpCaption)
mwind = MoveWindow(winHandle, 0, 0, 500, 500, 1) 'put the origin of the window in the 0,0 place
'put the dimensions of the window in the 500,500 place.

End Sub
 

Similar Topics

Hi, Can someone guide me through how to use FactoryTalk SE VB script to open communication with SQL Server? which command I can use? Are there...
Replies
2
Views
2,301
Hello Every one, I need a help on vba code for getting data from MSSQL server 2014 to display in FTview SE client version 12 . Thanks. Please...
Replies
4
Views
1,815
Hi, how can i use a defined Tag in HMI Tags (for exampele dintTag ) in VBA code by a display. i am using FactoryTalk SE thanx
Replies
1
Views
2,230
I am trying to open a single display for multiple messages. I understand that I can use parameters to load different messages etc but would like...
Replies
0
Views
1,227
Hello, I am looking for help writing to PLC tags from Excel. I am using Factory Talk Gateway as an OPC server and Excel VBA to write out to an...
Replies
5
Views
3,104
Back
Top Bottom