|
Thanks Dave,
I've been using the Process class and the GetProcess method. This works well but doesn't list a separate process if I have windows explorer open on a certain directory/folder. I'm trying to list all running applications including any instances of windows explorer and the folder/directory that it is pointing to.
I've read somewhere that the listing of windows explorer is a top-level listing and that is why it doesn't appear in running process.
Thanks
Graeme Guildford
I am always greteful for any help!
|
|
|
|
|
GuildfordG wrote: I'm trying to list all running applications including any instances of windows explorer and the folder/directory that it is pointing to.
Those are not seperate processes. Each is a window belonging to a single instance of explorer.exe. You have to enumerate the windows using the Shell.Application COM object and it's Windows[^] property.
|
|
|
|
|
Thanks Dave, I'll give it a go and let you know.
I am always greteful for any help!
|
|
|
|
|
Sorry Dave but I've looked everywhere for the Shell.Application COM object in Visual Basic 2005. Can you please help me to locate and use this object?
Thanks again
Graeme
I am always greteful for any help!
|
|
|
|
|
You need to be adding a reference to "Microsoft Shell Controls and Automation". Or just add it to the .DLL directly, C:\Windows\system32\shell32.dll .
|
|
|
|
|
Sorry Dave, I've added Microsoft Shell Controls and Automation, then Imported shell32 namespace.
I wrote a test code to view the application windows that are currently running as follows:
Dim shlApplications As Shell
Dim obj As Object
shlApplications = New Shell
For Each obj In shlApplications.Windows
MsgBox(obj.GetHashCode.ToString)
Next
The only problem is that it is not returning the name of the application(s) that are running.
Can you help please?
Thanks
Graeme
I am always greteful for any help!
|
|
|
|
|
Hai!
I need to transfer data from sql server 2005 to foxpro database(dbf source type). But i am unable to do this. Kindly help me in this regard.
Thanks in advance
Y Kesava Rao
|
|
|
|
|
There are lot of free or trial database converters available on line..
If u are not getting a direct one then at least u can convert it to something other DB and then from there convert it to foxpro..
Good luck
|
|
|
|
|
I was on the MSDN web site and found a function that is useful to me. Here is the function.
Public Function SelectRows(ByVal dataSet As DataSet, ByVal connectionString As String, ByVal queryString As String) As DataSet<br />
Using connection As New SqlConnection(connectionString)<br />
Dim adapter As New SqlDataAdapter()<br />
adapter.SelectCommand = New SqlCommand(queryString, connection)<br />
adapter.Fill(dataSet)<br />
Return dataSet<br />
End Using<br />
End Function
Is the SqlConnection function a function that is in VB.NET or is this something I have t6o write?
When I was on the MSDN site I saw a Sql Connection Class, but am not sure if it is a class that the VB.NET program will write for me. Is it possible that it did write the function for me but it is called something different or is it in a namespace?
Here is the url where I got the code. I am getting the blue line under the SqlConnection function call. How do I fix this?
|
|
|
|
|
IIRC, it is in the System.Data.SQL namespace or something like that.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
It is System.Data.SqlClient
|
|
|
|
|
Yep. That's it
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I need to re-select the current record after a user clicks a column header to do a sort. This needs to be done after the sort. All of the references I have found say to add a handler for the DefaultView.ListChanged. I have done this, but I don't get the ListChanged event they say I should get when the user clicks the column header and the sort is performed. I have tried using the mouse up/down events but the sort is not performed until after the mouse button is released. I need to do something after the sort. Am I doing something wrong? This is the code I use for the handler.
AddHandler dsInvoice.Tables("Invoice").DefaultView.ListChanged, AddressOf onListChanged
|
|
|
|
|
I'm trying to validate a textbox with only a...z and spaces. I can validate a...z with Keypress but how do I validate a space?
Nosiller
|
|
|
|
|
The SPACE character has an ASCII code of 32. Cast the KeyChar property of your KeyPressEventArgs object to an int and check whether its value is 32.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thank you very much. I will give it a try.
Nosiller
|
|
|
|
|
how about e.KeyChar.CompareTo(" "c) ?
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I would always use Keys.Space, and not a space or ASCII code. I would use char.isalpha to test against a-z, also.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
another technique:
Private Sub Txt_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Txt.KeyPress
If Char.IsLetter(e.KeyChar) OrElse Asc(e.KeyChar) = Keys.Space Then
'allow
Else
e.Handled = True
End If
End Sub
|
|
|
|
|
I am using VS 2005 .NET 2.0
I have added a application config file, which contains 2 keys for my application. The config file named appTextSearch.config is created in my application's folder.
Now, the problem is I am not able to read these 2 values from the config file.
serverDetails (see below) returns nothing
ConfigurationManager.AppSettings.HasKeys also returns false
DO I need to specify anywhere in my application to read this application config file ?
</configuration>
<appSettings>
<add key="servername" value="http://a2tmon963:9080/gisgazetteerhttp/addressformatted.do?freeText=" />
<add key="recno" value="30" />
</appSettings>
</configuration>
Dim serverDetails As String = ConfigurationManager.AppSettings("servername")
Dim NoToReturn As String = ConfigurationManager.AppSettings("recno")
|
|
|
|
|
There shouldn't be a "/" in the first <configuration>
|
|
|
|
|
Sorry this was a typo. There is no "/" in the first configuration
|
|
|
|
|
It works fine for me then. Do you have a reference to System.Configuration in your Project?
|
|
|
|
|
I do have a reference to System.Configuration
To clarify, I am working with a class library DLL. I realise this is probably why I cannot read the app.config. Does anyone know any way around this problem ??
|
|
|
|
|
Use the following XML:
</configuration>
<appSettings>
<key>"servername"</key>
<value>"http://a2tmon963:9080/gisgazetteerhttp/addressformatted.do?freeText=" </value>
</appSettings>
<appSettings>
<key>"recno"</key>
<value>"30"</value>
</appSettings>
</configuration>
|
|
|
|