
mooman_fl
Avatar/Signature-
Posts
194 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Events
Articles
Resources
Downloads
Gallery
Everything posted by mooman_fl
-
Does anyone know of a way to hook DirectInput8 or 9 keyboard events from VB.NET? I need to send a keystroke to a DX app but SendKeys won't work. I know it can be done but have seen no tutorials explaining how.
-
Anyone? Still having trouble with the button-down effect not showing if using a event handler for the onclick event. Even with a return set for true. Another side-effect: right-clicking on the page no longer gets the context menu. On a side note... and it may be related... if I load the page in IE the look like XP style buttons. If I load them in the browser control they don't. Even with a manifest in the program directory. Any idea why? This is the code I am using for the event handler for the onclick event: Private Function onclickproc(ByVal obj As mshtml.IHTMLEventObj) As Boolean ' an object on the page has been clicked - you can learn more about ' type and position of this object by querying the obj's properties ' ... Select Case obj.srcElement.id Case "btn_StartNewProject" obj.srcElement.style.color = "#ff0000" Case "btn_StartOpenProject" obj.srcElement.style.color = "#ff0000" Case Else Return True End Select MessageBox.Show(obj.srcElement.id) Return True End Function
-
WooHOO.... once again divil I have to offer you most humble thanks. This sounds like it is just what I was looking for.
-
Ok... I have the need now to finally dip into the world of databases and have no experience what-so-ever in them. In the app I am working on I need to have a control that works like the Properties window in the VS IDE. On the surface this looks like a simple DataGrid but in operation it seems to work alot different. Anyone know what control they are using or one that works like that one? To be specific I need one that will let me have the drop-down list for some properties and the buttons (a la Collections) in some. I also need the collapsable properties with the plus/minus sign... but without the sub items looking like hyperlinks. I have looked over the DataGrid control because that seems closest to what I need but it just doesn't seem to have any settings for these things so I would assume that I am barking up the wrong tree. Can someone point me in the right direction?
-
Hmmmm... not sure if that will suit my needs. Is there another way to do it that doesn't focus specifically on the app itself and just adds the keystrokes to a general message queue? So that any program recieves it as long as it is focused?
-
I got a little side-tracked today by another project idea. A minor one this time. What I want to do is create a program that monitors the most recent line added to a text file then perform a specific action based on what it found. All well and good so far. Easy as pie. What I am not sure of since I have never had to do it is how to fire a keyboard event so that what even program is active at time assumes the buttons have been pressed on the keyboard itself. Just for any curious people out there this is going to be used to automate another program I use frequently. This program will be minimized at time and only the program I want to automate will be in focus. What would be the best way to go about this in .NET? I know this is probably a newbie question but I have never had to deal with anything like this before.
-
Sorry about that... forgot they were there. Here is the zip sans executables and dlls:tvss(c).zip
-
D'OH!!!!! That is what I get for not sleeping in 24 hours. LOL Thanks divil... once again you have been a big help. I have noticed though that after commenting out all code adding an event handler for the onmouseover and onmouseout the buttons still don't have the normal button effects for those event... and it doesn't show the button going down on a click. For comparison try opening the StartPage.htm in IE and notice the effects I am talking about. Setting the Return to True doesn't change this. Any idea if this can be fixed? Or is it something that I am doing wrong with the browser settings?
-
Ok... I have attached a copy of my basic project so far. No fuctionality has been attached to anything other than if you click on button in the browser the program will display a messagebox telling you what button you clicked. This should be enough to show you how to intercept a onclick event from a webpage and handle it within the program. I have a major question on it though. As it works now, the process of intercepting the onclick event seems to stop the browser from handling ANY events hence the added onmouseover and onmouseout event handlers I added. Is there a way that this can be fixed so that it simply recognizes an onclick event but if the control id doesn't match one in the Select Case statement then it passes control back to the browser. Also would still like the browser to handle all other events... only want it to intercept the onclick event. This on the surface seems similar to subclassing in VB6 but it doesn't work quite the same. In VB6 you could return control back to the default message handler. How would you do this in this case for VB.Net?
-
Just to clarify a bit for you so there is no misunderstanding.... SharpDevelop is a wonderful opensource program that is primarily targeted at C#. It can handle VB.Net but there isn't full support for it yet. For example there is no Design window for making a GUI for your program... you would have to add all controls programmatically. A design window for VB.NET will be added at a later time as it is still in the Beta stages and it is constantly being updated. To use SharpDevelop you will have to download and install the .Net Framework SDK. This will provide the necessary compilers needed to compile your program from either C# or VB.NET code. I would recommend reading over as much material as you can on the .NET Framework and the differences between VB6 and VB.Net before you jump in and start coding. If you don't you can get lost rather easily. I made the switch recently myself though and have found it to be great once you get past the learning curve. I might have missed something in my explaination here... but if I did I am sure someone will correct me or add on what I missed. Good luck :-)
-
Found the answer on how to do this. For anyone else that wants to know how to make their own event handler for a click event on a webbrowser control check out this tutorial: http://www.vb2themax.com/Item.asp?PageID=TipBank&ID=561 Just add your code to the onclickproc method. divil: as promised I will post my code shortly showing how I did this to make a VS.Net style startpage. wooHOO!!! ;-)
-
Well had to take a week off from this problem due to RL stuff... came back and redid it and got a working VB example of divil's C# code first time through. Thanks for the help. Don't know exactly why it wouldn't let me add a webbrowser control at design time before... but it does now flawlessly. Well the next step is figuring out how to adapt this to capturing a click event. I just need to know if something has been clicked and if so then what has been clicked. It would be as simple as setting up a case select then for the items I want it to handle. Any ideas how this can be done?
-
Thanks for all the help divil... still working on a VB solution to your C# example. Don't think I am quite getting it right though. First of all I have had to add the webbrowser control to the form programmatically. For some reason I wind up with errors if I try to add it at design time. It will let me add it but it will give me errors. If I do it at run time then it works fine. This is what I have so far. For posting the code I have removed the Form Designer Generated Code. The app is just a form (Form1) and a label docked to the bottom (Label1). The webbrowser control (webbrowser) is added at runtime: Public Class Form1 Inherits System.Windows.Forms.Form 'took this out for the sake of a short example #Region " Windows Form Designer generated code " Private doc As mshtml.HTMLDocument Private webbrowser As AxSHDocVw.AxWebBrowser Protected Overrides Sub OnLoad(ByVal e As EventArgs) webbrowser = New AxSHDocVw.AxWebBrowser() Me.Controls.Add(webbrowser) webbrowser.Dock = DockStyle.Fill webbrowser.Navigate2("http://www.xtremedotnettalk.com") End Sub Private Sub onmouseover() Dim HTML As String HTML = doc.parentWindow.event.srcElement.innerText Label1.Text = HTML End Sub Private Sub webbrowser_DownloadBegin(ByVal sender As Object, ByVal e As System.EventArgs) doc = DirectCast(webbrowser.Document, mshtml.HTMLDocument) AddHandler DirectCast(doc, mshtml.HTMLDocumentEvents_Event).onmouseover, AddressOf onmouseover End Sub End Class The it doesn't seem to reach the last two subs at all. It just loads the webpage. Can you spot what I am doing wrong? Sorry if it is something simple. I am still just starting out with .NET. Anyone else that can help is welcome to speak up too. LOL
-
divil (or anyone else that can answer): I looked over the source that you provided in your project at the above link. I ran it and it worked fine for grabbing the text of whatever fired the onmouseover event on the webpage. I tried to change this to indicate an onclick even being fired but really don't know enough about C# to pull this off. I then began the process of trying to at least translate what that application does over to VB.Net. Most of it is pretty straightforward I think but one section stumps me: private void wb_DownloadBegin(object sender, System.EventArgs e) { doc = (mshtml.HTMLDocument)wb.Document; ((mshtml.HTMLDocumentEvents_Event)doc).onmouseover += new mshtml.HTMLDocumentEvents_onmouseoverEventHandler(onmouseover); } I was able to get part of this since you had done an example of something similar a few post before you posted your project. The first line is almost a direct copy of the Directcast that you did in that post. The second line eludes translation by me though. I fear this is just a lack of understanding on exactly what it is doing and how C# works in this instance. Any help and explaination of the principles in that example would be helpful. Thanks.
-
Thanks for the post everyone. The why isn't all that important. For a short answer... it allows the layout and design of these windows to be tweaked outside the development enviroment. It also allows you to do other things in the same window like visit related websites and and view the HTML help files. Ease of use for the user... not the programmer. divil: Thanks for posting. I will check out your link and will be happy to show you the results when I have them. :-)
-
Ok... I had to reread your post a couple of times to get the sense of what you were saying and I think I finally got it. Still not sure how to implement this in my own program though. I am trying to make an IDE for making skins for another program and I wanted to use a similar design to the VS.NET IDE. Any suggestions on what I would need to do to get this part working the same (or equivalent) way?
-
Sorry if I am posting this in the wrong place but I didn't really think it clearly fit in any of the other sections. I am trying to make an application that has a section that would be control via an HTML page. As an example of what I am talking about look at the Start page that opens by default in .NET IDE. I need to be able to place controls on the HTML page and have them control the program but really not sure how to go about this. Any pointers to tutorials or examples would be welcome.