
micropathic
Avatar/Signature-
Posts
77 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by micropathic
-
How would I go about getting my setup project (during the uninstall) to remove registry entries created by my software?
-
Got this to work with this code: Private Declare Function GETWINDOWTEXT Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Integer, ByVal lpString As String, ByVal cch As Integer) As Integer Private Declare Function SetForegroundWindow Lib "user32.dll" (ByVal hwnd As Integer) As Integer Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer Private Declare Ansi Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Integer Private Const WM_GETTEXT As Short = &HDS Private Const WM_GETTEXTLENGTH As Short = &HES Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim hwnd As Integer = FindWindowEx(0, 0, "IEFrame", vbNullString) If Not hwnd = 0 Then SetForegroundWindow(hwnd) Dim Worker As Integer = FindWindowEx(hwnd, 0, "WorkerW", vbNullString) Dim ToolBar As Integer = FindWindowEx(Worker, 0, "ReBarWindow32", vbNullString) Dim ComboBoxEx As Integer = FindWindowEx(ToolBar, 0, "ComboBoxEx32", vbNullString) Dim txtLength As Long = SendMessage(ComboBoxEx, WM_GETTEXTLENGTH, CInt(0), CInt(0)) + 1 ' Get Length Of Text Dim txtBuff As String = Space(txtLength) Dim URL As Long = URL = SendMessage(ComboBoxEx, WM_GETTEXT, txtLength, txtBuff) 'Get URL From ComboBoxEx MsgBox(txtBuff) End If End Sub
-
Well, I have been looking into doing this with Win32 API calls. Here is the code I've been trying to make work: Private Declare Function GETWINDOWTEXT Lib "user32" Alias "GetWindowTextA"(ByVal hwnd As Integer, ByVal lpString As String, ByVal cch As Integer) As Integer Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"(ByVal lpClassName As String, ByVal lpWindowName As String) As Integer Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA"(ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, ByVal lpsz2 As String) As Integer Private Declare Function SetForegroundWindow Lib "user32.dll" (ByVal hwnd As Integer) As Integer Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim sCaption As New VB6.FixedLengthString(256) 'Dim String w/ 256 Spaces In Memory, Is There A .Net Way To Do This? Dim hwnd As Long = FindWindow("IEFrame", vbNullString) 'Finds IE Window By Container Name, "IEFrame" If Not hwnd = 0 Then 'Tests If Window Exists SetForegroundWindow(hwnd) 'Brings Window To Foreground GETWINDOWTEXT(hwnd, sCaption.Value, 256) 'Get The Text From That Window, For Testing Code... Not Functionally Needed MsgBox(sCaption.Value) 'Show The Value Of The Caption, For Testing Code... Not Functionally Needed 'The Following 5 Lines Of Code Are What Seem To Be Causing An Issue. 'I'm Trying To "Drill" Into The IE Window And Search For The URL Address 'Bar Portion Of The Window. This Doesn't Seem To Be Working Correctly. 'What Am I Doing Wrong With These FindWindowEx's? Dim Worker As Long = FindWindowEx(hwnd, 0, "WorkerW", vbNullString) 'Supposed To Find The Component W/ The Caption "WorkerW" Within The IE Window Dim ToolBar As Long = FindWindowEx(Worker, 0, "rebarwindow32", vbNullString) 'Supposed To Find The Component W/ The Caption "rebarwindow32" Within The "WorkerW" Component Dim ComboBoxEx As Long = FindWindowEx(ToolBar, 0, "comboboxex32", vbNullString) 'Supposed To Find The Component W/ The Caption "comboboxex32" Within The "rebarwindow32" Component Dim Combo As Long = FindWindowEx(ComboBoxEx, 0, "combobox", vbNullString) 'Supposed To Find The Component W/ The Caption "combobox" Within The "comboboxex32" Component Dim Edit As Long = FindWindowEx(Combo, 0, "Edit", vbNullString) 'Supposed To Find The Component W/ The Caption "Edit" (This Is Actually The URL Address Bar From Which I'm Trying To 'Pull The Text From) Within The "combobox" Component 'Here Is Where I Would Like To Pull The Text From The "Edit" 'Component (URL Address Bar Text) And Then Show The Value In 'A Message Box End If End Sub At this point I am a little lost, so any help would be super valuable to me!
-
Get Text In Between Quotes
micropathic replied to micropathic's topic in Directory / File IO / Registry
Actually though, I would not mind using a regular expression, but when I try to use the code above, I am getting the following errors: Here is the code I'm using: Dim sr As New System.IO.StreamReader(SafeFileName) Dim sentence As String = sr.ReadToEnd() Dim quotedText As StringCollection = New StringCollection Dim match As Match For Each match In Regex.Matches(sentence,"\"((^\"]*)\"") quotedText.Add(match.Result("$1")) Next Dim i As Integer For i = 1 To quotedText.Count Step i + 1 Console.WriteLine("{0}) {1}", i, quotedText(i - 1)) Next -
Get Text In Between Quotes
micropathic replied to micropathic's topic in Directory / File IO / Registry
Thanks for you help! I'd prefer to use the string.split method if I could. I have a question about that though. How can I loop through the entire string until the end while getting all the text between the quotes? For instance, here is the an example that MS gives that I am trying to modify for my own use for string.split: Dim delimStr As String = chr(34) Dim delimiter As Char() = delimStr.ToCharArray() ' Dim words As String = "one" & chr(34) & "two" & chr(34) & "three" & chr(34) & "four" Dim sr As New System.IO.StreamReader("C:\MyTextFile.txt") Dim words As String = sr.ReadToEnd() Dim split As String() = Nothing Console.WriteLine("The delimiters are -{0}-", delimStr) Dim x As Integer For x = 1 To 5 'THIS IS WHAT NEEDS TO BE MODIFIED, I NEED TO READ 'ALL INSTANCES, NOT JUST THE FIRST FIVE split = words.Split(delimiter, x) Console.WriteLine(ControlChars.Cr + "count = {0,2} ..............", x) Dim s As String For Each s In split Console.WriteLine("-{0}-", s) Next s Next x So, I guess my question is, what would X have to equal in order for me to ensure that the reading of string does not stop until it finds the final instance of text within quotes? -
Hi, I am reading a file to a string and I want to find the data between each set of quotes in the string. For instance, if my string looked something like this: randomtext randomtext randomtext "this is what i want" randomtext randomtext "this is also what i want" randomtext How could I get "this is what i want" and "this is also what i want" from the string? Thanks for any help!
-
Does anyone know how to go about making ad supported software to help alleviate the development costs of freeware? I'm not talking about spyware... I hate spyware, so the last thing I want to do is put that on someone else's machine. I just want to set up a rotating banner ad or something... Does anyone know of any good companies to hook up with for something like this? I've done a google search for things like "ad supported software" or "partner marketing ads software", but the results that come back seem to be irrevelant to what I am looking for. Thanks! Marc
-
Sorry, I think I should have been more specific. When I said I wanted to "programatically get the names of all the files/folders in a directory", I should have stated that I meant on an http site. Something like this: Dir http://www.yahoo.com/*.* and that would give me all the files and folders in the root dir of yahoo.com... Would the directory class you suggested be able to do something like that? Thanks for your help.
-
That should get me started. Maybe I'll just save the string to a file and search it for things like, .gif,.jpg,.png,.swf, etc. and then pull those down that way. I was just thinking also, if anyone knows how to programatically get the names of all the files/folders in a directory, that may be helpfull to me as well. Thanks for you help!
-
Hi, I was wondering if there where a way to programatically download a webpage the way that the IE "Save As" command does. Any help would be greatly appreciated!
-
Remove all currently selected listbox items
micropathic replied to micropathic's topic in Windows Forms
Just noticed something with that code though, if you have the same item in a row above the one you are removing, it will remove that as well. For instance if this is how my listbox looked: 4 7 2 2 2 2 2 2 <--if removed this, it would also remove the five rows above it 2 So, I would end up with: 4 7 2 So here's what I got to work just in case anyone ends up searching for something like this in the future, which is a bit of what I tried to begin with, mixed with the code posted by ozie: Do While ListBox1.SelectedItems.Count > 0 ListBox1.Items.RemoveAt(ListBox1.SelectedIndex) Loop -
Remove all currently selected listbox items
micropathic replied to micropathic's topic in Windows Forms
That worked great, Thanks for your help! -
Hi, I am trying to remove multiple selected items from a listbox and I came up with this code which I thought would would work correctly, but doesn't: Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click Dim j As Integer For Each j In ListBox1.SelectedIndices ListBox1.Items.RemoveAt(j) Next End Sub Any help would be very appreciated
-
That worked great. I think what I was doing wrong was that I was going into Project>Add Reference instead of right clicking on the toolbox and choosing add/remove items. Thanks so much for your help!
-
Is there any way to show html on a vb .Net form using some type of control or something(the way you could using the MS WebBrowser Control in vb 6)? TIA for any help!
-
Actually, what I was really looking for was how to make a single form(non MDI) that could dock to the side, top or bottom of your screen..... kind of like what happens when you drag a folder from your desktop to the side of your screen or the way that the microsoft office toolbar can dock to your screen. Sorry if I wasn't precise enough in explaining that in my original post. Any help with this would be greatly appreciated. Thanks!
-
Lol... alrighty then ;)
-
Is there a way to make a dockable forms in .Net? Thanks for any help!
-
Hi, I have an installer project created in Visual Studio .Net. I set all the .dll's in the project with the "vsdraCOM" and copy local options and am still having problems with the registration of the components. Here is a list of the files that need to be registered upon installation: Am I supposed to be registering all these files this way? I can't figure out what I'm doing wrong, so any help would be super greatly appreciated! Thanks!
-
Hi, I am trying to clear 24 listbox on my form. They are all named like this: listbox1, listbox2, listbox3, etc. My question is, how can I loop through all of them and clear them. Here's what I had come up with that didn't seem to work: Dim dirlistbox As string Dim i As Integer For i = 1 To 24 dirlistbox = dirlistbox(i) dirlistbox.items.clear Next
-
Recurse through directory and subdirectories
micropathic replied to micropathic's topic in Directory / File IO / Registry
I think I may have discovered the answer to my question here: http://www.vb2themax.com/Item.asp?ID=807&PageID=CodeBank -
Recurse through directory and subdirectories
micropathic replied to micropathic's topic in Directory / File IO / Registry
Oops... I just noticed that this code only recurses through 1 level of subdirecories (it doesn't get the subdirectories of the subdirectories). I've been playing around with the code a little bit more, but cannot seem to get it work. Do you know of anything I can do? Thanks! -
Recurse through directory and subdirectories
micropathic replied to micropathic's topic in Directory / File IO / Registry
That was exactly what I needed. Thank You! -
Hi, I need to figure out how to get a list of all of the contents (fiiles and folders) of a given directory including what's in its subdirectories. I plan on populating a listbox with this info. I've searched the forum for some type of solution, but it seems most of what I had found had to do with using a recursive function to populate a treeview and I can't really figure out how to use that code the way I need it. So, any help would be super appreciated! Thanks for any help!