Working with another fella, I was finally able to get a working example of GetIfTable going in VB.NET. The only problem is that its only partially working. I still cant retrieve the name of the network adapters. If anyone has a working example of GetIfTable or GetIfEntry with VB.NET (not c# here folks) I would be extremely greatful!!!
andrew
Posts
-
GetIfTable and VB.NET -
VB.Net WS_EX_LAYERED Forms*headsmack* Youre absolutely right. As for your question of why... If you draw to an offscreen DC, maintain a background color (which in this case is argb(0,0,0,0)) of the DC, pass it to UpdateLayeredWindow with the right params, it will render the window for you and continue to handle the wm_paint messages that come in, until you remove the ws_ex_layered style and re-add it (in which case you need to call your fuction which draws offscreen again...). Its a great lil bit o' magic, and it allows you to have a window, for example, based on a PNG with alpha channel support. Thanks for bringing that ANDing to my attention though! UPDATE: I stumbled upon an article which stated that Integers in vb.net are Longs in vb6. I had to modify the declares for SetWindowLong and GetWindowLong so that the params used Integers and returned Integers instead of Longs. Once I changed this, and used the ORing instead of the ANDing, everything worked as it should have. Thanks again for the help guys!
-
VB.Net WS_EX_LAYERED FormsNursey, thanks for trying address the issue at hand here. My main objective is to draw to an offscreen DC and use UpdateLayeredWindow to render the form. Being VB.NET Winforms, I am not quite sure how one goes about handling the WM_CREATE, or WM_INITDIALOG messages. If this were VB6 or below I would have no problem with this. The reason why I thought it would be worthwhile to pose the question is because I had checked the winform with spy++ and the WS_EX_LAYERED exstyle was not listed for the window. If there is a setting or a way to assert the WX_EX_LAYERED exstyle to a winform without calling SetWindowLong (Which has no effect on the winform at all) please do let me know! Thanks!
-
VB.Net WS_EX_LAYERED FormsHello! Im new to these forums so please forgive me if I have posted in the wrong section for this. Using winforms under vb.net, how does one set the GWL_EXSTYLE to include WS_EX_LAYERED? I need to set this flag so that I may use UpdateLayeredWindow on the form. This is what I am using : Dim lStyle As Long = GetWindowLong(Me.Handle.ToInt32, GWL_EXSTYLE) lStyle = lStyle And WS_EX_LAYERED Dim retval As Long = SetWindowLong(Me.Handle.ToInt32, GWL_EXSTYLE, lStyle) I tried it after a .Show() call and in the _Load event as well. Someone, please enlighten me! This is holding up my project atm. Thanks! Edited by - andrew_ on 12/4/2003 8:09:57 PM
-
MSScriptControl and VB.Net Control EventsI am attempting to add a form or control as an object to my instance of the MSScriptControl, where the control or form will extend its events to the loaded script... oScripting.AddObject("Window", Me, True) oScripting.State = MSScriptControl.ScriptControlStates.Connected That is supposed to add the object and attach its members and events... but it doesnt fire the event within the script.. Sub Window_Click() Msgbox "clicked" End Sub I have also tried; Sub Window_Click(sender, e) Msgbox "clicked" End Sub Please advise! I would very much like to know what I am doing wrong!