Opening a Shell to a set .windowstate?


Is there any way to control the window.state of a program that I am opening with the Shell function For Example:

sAppName = "TestProg" sAppPath = "C:\Document and Settings\TestProg.exe" If IsTaskRunning(sAppName) = False Then Shell sAppPath, vbNormalFocus

Can I add other parameters to adjust the TestProg to a certain window state and screen location using types such as

TestProg.WindowState = vbNormalFocus TestProg.Top = 6 TestProg.Left = 189 TestProg.Height = 569 TestProg.Width = 770

I can't find any information on this.
Posted On: Monday 24th of December 2012 01:06:22 AM Total Views:  1086
View Complete with Replies

RELATED TOPICS OF Visual Basic PROGRAMMING LANGUAGE




Re: Custom file format icon + opening

Hi all, Hope is fine. I'm creating a small application using an activex that i've bought at www.hi-components.com. Its kind of an advanced picture box where you can load images in it and then save them in different formats. JPG, PNG etc.... are very common formats but this activex also allow a custom file format *.iev to be saved. Unfortunately windows does not recognise that format and thus it has the white default icon. How i can code my software to make this file have the same icon as my executable. Second question. From my software i can load this iev file by going to to file > open...... etc.... But i want for e.g. if this file is on my desktop, i double click on it and it opens up in my software automatically. How do i do that Kind of associate it with my software.
VIEWS ON THIS POST

280

Posted on:

Thursday 18th October 2012
View Replies!

Re: vb6 Webbrowser not opening popup

Here's the problem I'm having: I've built an automated browser to access our company database. It works quite well, except for a single function on the search pages. On those particular pages, there's an icon to bring up a datepicker (which is written in javascript). When you click on the datepicker icon, it's supposed to popup a new window, then close it automatically after you select a date. It appears to try to open it, but you never actually see it open. I don't have any control over the website I'm trying to access, so I have to either make their datepicker work, or possibly to intercept the click on the icon and substitute my own. I'm thinking it's probably some simple but obscure parameter setting that I'm overlooking (at least I hope that's all it is). I've done a lot of searching, and have found code to disable popups, but that's about all. I've tried trapping the newwindow event and telling it cancel=false (which in theory should let the window open) but it's still not functioning properly.
VIEWS ON THIS POST

315

Posted on:

Wednesday 24th October 2012
View Replies!

Function return jagged array

Can we make function which return jagged array If so, could u give example of it
VIEWS ON THIS POST

60

Posted on:

Friday 2nd November 2012
View Replies!

Trying to send command to USB printer

- I am having problems sending commands to a new USB printer I am trying to send commands to the magnetic encoder of my card printer. The original card printer was parallel and a typical command was as ...
VIEWS ON THIS POST

199

Posted on:

Tuesday 20th November 2012
View Replies!

Reading only the last line of a multi-line text box before writing.

Ok, so i just managed to get a code setup that would write the text from my textbox to a text file. This was great BUT now i have a problem. Each time it writes the data to the text file it writes the entire contents of the multi line text box...which can be around 100+ lines on a bad day and i end up with the log looking like this Connection received: IPADDRESS Connection received: IPADDRESS User1: Connection received: IPADDRESS User1: User2: Um i dont think this is working. Connection received: IPADDRESS User1: User2: Um i dont think this is working. User1: Yeah, i see that. when it should look like this Connection received: IPADDRESS User1: User2: Um i dont think this is working. User1: Yeah, i see that. So i need to find a way to read only the last line of the textbox. I am currently using FSO to create and write the file data. I tried modifying a code to read a text file till its last line, but it gave me error after error so i deleted it in frustration. here is my current code. Option Explicit Private intSockCnt As Integer Dim myFSO As New FileSystemObject Dim myTextStream As TextStream Private Sub cmdListen_Click() sockMain(0).Close sockMain(0).LocalPort = txtPort.Text sockMain(0).Listen End Sub Private Sub cmdSend_Click() Dim intCnt As Integer 'This sends the data back to the other clients For intCnt = 1 To intSockCnt If sockMain(intCnt).State = sckConnected Then sockMain(intCnt).SendData txtSend.Text End If Next intCnt End Sub Private Sub Form_Load() 'txtStatus.Text = "Start" Set myTextStream = myFSO.CreateTextFile("C:\serverlog.txt") End Sub Private Sub sockMain_ConnectionRequest(Index As Integer, ByVal requestID As Long) intSockCnt = intSockCnt + 1 Load sockMain(intSockCnt) sockMain(intSockCnt).Accept requestID txtStatus.Text = txtStatus.Text & _ "Connected to: " & _ sockMain(intSockCnt).RemoteHostIP & vbCrLf End Sub Private Sub sockMain_DataArrival(Index As Integer, ByVal bytesTotal As Long) Dim strData As String Dim intCnt As Integer sockMain(Index).GetData strData, vbString txtStatus.Text = txtStatus.Text & _ strData & vbCrLf 'This sends the data back to the other clients For intCnt = 1 To intSockCnt If sockMain(intCnt).State = sckConnected Then sockMain(intCnt).SendData strData End If Next intCnt End Sub Private Sub txtStatus_Change() myTextStream.Write txtStatus.Text End Sub the txtstatus is written to file way down at the bottom Private Sub txtStatus_Change() myTextStream.Write txtStatus.Text End Sub [/code] i was thinking of a code that would read the lines till end of line then save that line as either text in a hidden text box or a variable i could use to then to replace the "txtstatus.text" in the above code. i apologize if im confusing, i am still learning this stuff and just don't know what direction to look for answers. Thank you ahead of time.
VIEWS ON THIS POST

214

Posted on:

Wednesday 28th November 2012
View Replies!

Excel Data to MS Word using VB

I am trying to find away to pull address information from a table in Excel into MS Word, using Word as the fron end application. Currently my only work around would be to create 200 letter templates and hard code the path to the specific letter, but if I need to change the letter in the future I'll have to change all of them. Is there a way to pull a certain column/row data into each Bookmark within Word. Much appreciated. Noel.
VIEWS ON THIS POST

109

Posted on:

Wednesday 28th November 2012
View Replies!

How to set ODBC connection programitically

Hi , I have progarm in VB6 with MS SQL Server 2000 as database. I connect my database by ODBC. Now I want to manually set the ODBC setting on each computer to connect my program. Is there any way to set ODBC settings programitically in VB6 With regards, Nasreen
VIEWS ON THIS POST

176

Posted on:

Thursday 29th November 2012
View Replies!

Run-Time Error "Too many client task"

with the use of timer, the system calls "showresultpres" , "showresultvice" and "showresultsen" every 5 seconds.all at the same time.... and that error appears...any other way i could call those 3 at the same time with out any errors Attached image(s)
VIEWS ON THIS POST

122

Posted on:

Friday 30th November 2012
View Replies!

set label name as flexible

i interface this kind of problem which is i try to put 10 labels and declare the name as l1 to l10. what i want is that, using a loop, i will set the caption of the label. example for i=1 to 10 l&i.caption = "label"& i next loop its sounds like that. can you tell me whats the best thing to do it
VIEWS ON THIS POST

162

Posted on:

Friday 30th November 2012
View Replies!