![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#1 |
Member
|
Start RSLinx Minimized/Verify RSLinx Running
Hi Everyone. I am buidling a VB application which uses DDE via RSLinx to communicate to a processor. I would like to start RSLinx minimized and verify that it is running at my splash screen when my application starts. I was able to start RSLinx using the shell statement in VB with the argument vbMinimized, but RSLinx still started maximized. I would also like to verify that RSLinx is running before leaving my splash screen. I have been unable to find much info on web searches. Hope someone can help.
|
![]() |
![]() |
#2 |
Lifetime Supporting Member
|
I am probably speeking too quickly and outside of my knowledge comfort zone but. ..... I was wondering if you couldn't run a shortcut to RSLinx and set the properties on the shortcut to run RSLinx minimized. I tried it only by double clicking on the shortcut, and that worked, or am I missing the point.
|
![]() |
![]() |
#3 |
Member
![]() ![]() Join Date: May 2002
Posts: 2
|
You should have RSlinx set to run as a Service, this will enable it to run in the Systray. Sorry but I do not know of any command line switches will will set this to run minimized.
To check to see if RSlinx is running you can use the following code in VB. Place this in the General Declartions of a .bas file Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long Declare Function EnumWindows Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long) As Boolean Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long :::::: Then add these Functions to the .bas file :::::::: Public Function EnumWindowsProcCallBack(ByVal hwnd As Long, ByVal lParam As Long) As Boolean Dim RetVal As Long Dim WinClassBuf As String * 255 Dim WinTitleBuf As String * 255 Dim WinClass As String Dim WinTitle As String On Error Resume Next RetVal = GetClassName(hwnd, WinClassBuf, 255) WinClass = StripNulls(WinClassBuf) ' remove extra Nulls & spaces RetVal = GetWindowText(hwnd, WinTitleBuf, 255) WinTitle = StripNulls(WinTitleBuf) ' see the Windows Class and Title for each top level Window 'Debug.Print WinClass, "::::", WinTitle 'the Following line will check for a specific program If InStr(WinTitle, sProgram) > 0 Then bProgramFound = True 'Put code here for info if found End If EnumWindowsProcCallBack = True End Function Public Function EnumTopLevelWindows() On Error Resume Next EnumTopLevelWindows = EnumWindows(AddressOf EnumWindowsProcCallBack, 0) End Function Public Function StripNulls(OriginalStr As String) As String On Error Resume Next ' This removes the extra Nulls so String comparisons will work If (InStr(OriginalStr, Chr(0)) > 0) Then OriginalStr = Left(OriginalStr, InStr(OriginalStr, Chr(0)) - 1) End If StripNulls = OriginalStr End Function ::::: in you splash form you can then do the following :::: bProgramFound = False sProgram = "RSLinx" Call EnumTopLevelWindows If bProgramFound = False Then Call RSlinx End If |
![]() |
![]() |
Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
RsLinx on Bootup | jthornton | LIVE PLC Questions And Answers | 10 | April 5th, 2005 11:53 AM |
Rslinx Start As Windows Service | Elias | LIVE PLC Questions And Answers | 5 | September 27th, 2004 05:30 AM |
enable/disable nodes of RsLinx using RsView32 tags | PLC Freak | LIVE PLC Questions And Answers | 3 | June 9th, 2004 06:48 PM |
Excel connection to RSLinx Gateway | poiuy | LIVE PLC Questions And Answers | 8 | October 14th, 2003 09:00 AM |
Rslinx & Excel | viki2000 | LIVE PLC Questions And Answers | 1 | June 26th, 2002 10:23 AM |