Since this question is really a product support type of question, I would encourage you to contact our Tech Support Team who would be better equipped to answer this type of questions.
I am guessing that you are referring to the ProcessBook's main window here. ProcessBook saves this in the Procbook.ini file under the user's profile. The file location is slightly different in different Windows version, in Windows XP it is located C:\Documents and Settings\<username>\Application Data\PISystem\PI-ProcessBook\en\PROCBOOK.INI
It is saved under the name "WindowPos", which is a series of 10 comma-separated numbers:Flags, ShowCmd, MinPosX, MinPosY,MaxPosX,MaxPosY,Left, Top,Right,Bottom
We can't disable it but we can override the setting in the file with a similar position setting in the registry. Under the registry key HKEY_LOCAL_MACHINE\SOFTWARE\PISystem\PI - ProcessBook\Security\Startup, add a string value "WindowsPos" and set the value in the same format. A quick way is to close ProcessBook in the desired position and copy the setting from the Procbook.ini.
While I agree it is a tech support type question they don't know what all the other customers are doing. I think of vcampus as a place to discuss PI with other PI customers not only about coding. There is too much experience available on this site to let go to waste.
I was hoping someone else had the same issue and came up with a work around. I'll put in a request to Tech Support to make the positioning of PB optional by editing the config file.
Matt RivettWhile I agree it is a tech support type question they don't know what all the other customers are doing. I think of vcampus as a place to discuss PI with other PI customers not only about coding. There is too much experience available on this site to let go to waste.
Matt, I foresee that with time there will be other forums available from OSI for general PI experience sharing etc In fact I swear I read somewhere about a TechSupport forum that might make an appearance.
Matt RivettWhile I agree it is a tech support type question they don't know what all the other customers are doing. I think of vcampus as a place to discuss PI with other PI customers not only about coding
Matt RivettWhile I agree it is a tech support type question they don't know what all the other customers are doing. I think of vCampus as a place to discuss PI with other PI customers not only about coding. There is too much experience available on this site to let go to waste.
I totally agree on that - we just want to make sure that this is not the place to get timely answers on tech support question. But feel free to call the community if it is not time critical.
RhysI foresee that with time there will be other forums available from OSI for general PI experience sharing
And it is on us to make this community (vCampus) as good as possible to show that this sort of community benefits all of us. So don't be afraid of the vCampus Team redirecting you to tech support and keep asking questions! And while doing this, don't forget to share your experience and participate in any discussion on the forums!
given that the place should be always the same ... some search on the internet revealed the following windows api functions:
Private Declare Function FindWindow Lib "user32" _ Alias "FindWindowA" _ (ByVal lpClassName As String, _ ByVal lpWindowName As String) _ As LongPrivate Declare Function MoveWindow Lib "user32" _ (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
putting them into VBA:
Private Sub CommandButton1_Click() hwnd = FindWindow(vbNullString, Me.Application.Caption) Call MoveWindow(hwnd, 1, 2, 600, 800, True)End Sub
allows me to move my processbook. This could be something for this upcoming webinar.
Yeah we have the code required to position PB. OSIsoft provided us code to do this at command line (I've attached the original version as well as my modified code). I needed to add in a sleep command to make sure this code positioned PB after the internal PB code positioned itself. Otherwise sometimes it would work and sometimes it would not.
Due to a newer technology we have implemented we can no longer run this code to open and position the PB displays. It is done by a 3rd party application and I do not have access to their source to edit it so I cannot add in a sleep timer. Sometimes their positioning code works and other times it does not which is why I was hoping there was a way to disable the PB application from remembering its previous position and size.
Here is the edited source.
I am curious, I run some of my (well I developed them) ProcessBook displays on a video wall although the huge screen is split in to 2 desktops. We never seem to have any trouble as access to the machine is restricted and displays are just cycled.
How are you seeing issues? Are the displays/applications being cycled (or generally manipulated) so being closed down and reopened etc? Hence the wrong screen pos is written to procbook.ini?You might be able to create an addin that resizes the application based on display name or some other criteria - if the addin links to PI MDB/AF then you can control positions without going to the machine, build some nice logic in to the addin.
When you say a 3rd party application is causing the code not to work, it must still be creating instances of ProcessBook?
I see the problem - at least I think so.
If your 3rd party application does control the position only when you open the application, you might move the control of the position to the PDI. You could attache to the DataUpdate event - positioning the window always when the data on the Display get's updated - like in the attached PDI. Would that be a workaround?
Alright there is more to this system. We have touch planel interfaces on the desks of the dispatchers that they can use to run presets for the video wall. So depending on certain circumstances they hit a button and the wall closes the existing displays and then opens a new set of displays (or repositions them). The software controls more than just ProcessBook. It can open any windows application, position and size it. There is also a video layer that overlays the windows desktop which can pipe in video feeds. So their software controls everything that is displayed on the wall.
Also there are actually 3 different video walls in the control room (one large in the front and 2 smaller ones in the back). So depending on what is happening the displays could be opened on any of the video walls so hard coding it in wouldn't work unless we had multiple copies of the displays created.
I've pasted your coding in a Processbook display, and it works (I pasted it in the Display_Open event).
But when I call this display from another pdi, the entire Processbook application resizes.
What I actually want, is that the "source" pdi remains maximized, and the "target" pdi (with your coding) opens in a different (smaller) sizing.
Is that possible?
Retrieving data ...