|
I found this information howto get from Interent Exlorer_server
<br />
Option Explicit<br />
'A demonstration on how to get the Yahoo Chat or PM HTML or Text<br />
'Based on Get YM! Chat Text & HTML from "Internet Explorer_Server" object By: James Johnston<br />
'I cleaned up his method for ease of use, and also reduced the amount of code by 1/10th<br />
'I added the last line and got rid of the extra scroll bar in the HTML version<br />
'Now, I can go back to makin chat bots >:)<br />
'c0ldfyr3 www.EliteProdigy.com<br />
<br />
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long<br />
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long<br />
Private Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long<br />
Private Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long<br />
Private Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String) As Long<br />
Private Declare Function SendMessageTimeout Lib "user32" Alias "SendMessageTimeoutA" (ByVal hWnd As Long, ByVal msg As Long, ByVal wParam As Long, lParam As Any, ByVal fuFlags As Long, ByVal uTimeout As Long, lpdwResult As Long) As Long<br />
Private Declare Function ObjectFromLresult Lib "oleacc" (ByVal lResult As Long, riid As UUID, ByVal wParam As Long, ppvObject As Any) As Long<br />
Private Const SMTO_ABORTIFHUNG As Long = &H2<br />
Private Const GW_HWNDFIRST As Long = 0<br />
Private Const GW_HWNDNEXT As Long = 2<br />
Private Const GW_CHILD As Long = 5<br />
Private Type UUID<br />
Data1 As Long<br />
Data2 As Integer<br />
Data3 As Integer<br />
Data4(0 To 7) As Byte<br />
End Type<br />
Private Type typWindows<br />
ClassName As String<br />
hWnd As Long<br />
End Type<br />
Private Type typWinFinal<br />
ChildWindows() As typWindows<br />
Count As Integer<br />
End Type<br />
Public Type YIMType<br />
Text As String<br />
HTML As String<br />
End Type<br />
Public Const c_ChatStyle As String = "<style>" & vbCrLf & _<br />
".sendername { font-size:10pt;font-family:Arial;font-weight:bold;color:#000000;text-decoration:none };" & vbCrLf & _<br />
".recvername { font-size:10pt;font-family:Arial;font-weight:bold;color:#0000FF;text-decoration:none };" & vbCrLf & _<br />
".ymsgrname { font-size:10pt;font-family:Arial;font-weight:bold;color:#FF0000;text-decoration:none };" & vbCrLf & _<br />
".chatusername { font-size:10pt;font-family:Arial;color:#FF0000;text-decoration:none };" & vbCrLf & _<br />
".usertext { font-size:10pt;font-family:Arial; };" & vbCrLf & _<br />
".redstatus { font-size:10pt;font-family:Arial;font-weight:bold;color:#FF0000;text-decoration:none };" & vbCrLf & _<br />
".greenstatus { font-size:10pt;font-family:Arial;font-weight:bold;color:#008800;text-decoration:none };" & vbCrLf & _<br />
".graystatus { font-size:10pt;font-family:Arial;font-weight:bold;color:#888888;text-decoration:none };" & vbCrLf & _<br />
".chatrecver { font-size:10pt;font-family:Arial;font-weight:bold;color:#880000;text-decoration:none };" & vbCrLf & _<br />
".chatsender { font-size:10pt;font-family:Arial;font-weight:bold;color:#0000FF;text-decoration:none };" & vbCrLf & _<br />
".chataction { font-size:10pt;font-family;Arial;color:#880088;text-decoration:none };" & vbCrLf & _<br />
"a { color:#0000FF; };" & vbCrLf & _<br />
"p { text-indent:-7;margin-left:10;margin-top:0;margin-bottom:0 };" & vbCrLf & _<br />
"</style>"<br />
Public Const c_PMStyle As String = "<style>" & vbCrLf & _<br />
".sendername { font-size:10pt;font-family:Arial;font-weight:bold;color:#000000; }" & vbCrLf & _<br />
".recvername { font-size:10pt;font-family:Arial;font-weight:bold;color:#0000FF; }" & vbCrLf & _<br />
".ymsgrname { font-size:10pt;font-family:Arial;font-weight:bold;color:#FF0000; }" & vbCrLf & _<br />
".usertext { font-size:10pt;font-family:Arial; }" & vbCrLf & _<br />
".redstatus { font-size:10pt;font-family:Arial;font-weight:bold;color:#FF0000; }" & vbCrLf & _<br />
".greenstatus { font-size:10pt;font-family:Arial;font-weight:bold;color:#008800; }" & vbCrLf & _<br />
".graystatus { font-size:10pt;font-family:Arial;font-weight:bold;color:#888888; }" & vbCrLf & _<br />
".imvnotify { font-size:10pt;font-family:Arial;font-weight:bold;color:#000088; }" & vbCrLf & _<br />
"a { color:#0000FF; }" & vbCrLf & _<br />
"p { text-indent:-7;margin-left:10;margin-top:0;margin-bottom:0 }" & vbCrLf & _<br />
"</style>"<br />
<br />
Public Function GetClassN(ByVal hWnd As Long) As String<br />
Dim ParentClassName As String<br />
Dim Z As Long<br />
ParentClassName = String(100, Chr(0))<br />
Z = GetClassName(hWnd, ParentClassName, 100)<br />
GetClassN = Left(ParentClassName, Z)<br />
End Function<br />
Private Function GetChildWindows(hWnd As Long) As typWinFinal<br />
Dim ChildP As Long<br />
Dim LastChild As String<br />
Dim MainP As Long<br />
Dim WinDetails As String<br />
Dim First As Boolean<br />
Dim AdWin As Long<br />
<br />
GetChildWindows.Count = -1<br />
MainP = GetWindow(hWnd, GW_CHILD)<br />
ChildP = GetWindow(MainP, GW_HWNDFIRST)<br />
Do While ChildP <> 0<br />
ChildP = GetWindow(ChildP, GW_HWNDNEXT)<br />
If ChildP = 0 Then Exit Do<br />
WinDetails = GetClassN(ChildP)<br />
<br />
GetChildWindows.Count = GetChildWindows.Count + 1<br />
ReDim Preserve GetChildWindows.ChildWindows(GetChildWindows.Count)<br />
<br />
With GetChildWindows.ChildWindows(GetChildWindows.Count)<br />
.ClassName = WinDetails<br />
.hWnd = ChildP<br />
End With<br />
DoEvents<br />
Loop<br />
End Function<br />
Public Function GetIMText() As YIMType<br />
Dim IMClass As Long<br />
Dim MidWin As Long<br />
Dim InternetExplorerServer As Long<br />
Dim Something As typWinFinal<br />
Dim X As Integer<br />
Dim sTmp As String<br />
Dim yTmp As YIMType<br />
<br />
'Loop through all the windows finding their handles from predefined classnames.<br />
IMClass = FindWindow("imclass", vbNullString)<br />
Something = GetChildWindows(IMClass)<br />
For X = 0 To Something.Count<br />
sTmp = Something.ChildWindows(X).ClassName<br />
If Len(sTmp) > 4 Then<br />
If StrComp(Left(sTmp, 3), "atl", vbTextCompare) = 0 Then<br />
InternetExplorerServer = FindWindowEx(Something.ChildWindows(X).hWnd, 0&, "internet explorer_server", vbNullString)<br />
yTmp = GetIEText(InternetExplorerServer)<br />
If InStr(1, yTmp.HTML, "function RestoreStyles()") > 0 Then<br />
GetIMText = yTmp<br />
End If<br />
End If<br />
End If<br />
Next<br />
End Function<br />
Private Function GetIEText(ByVal hWnd As Long) As YIMType<br />
Dim doc As IHTMLDocument2<br />
Dim col As IHTMLElementCollection2<br />
Dim EL As IHTMLElement<br />
Dim l As Long<br />
Dim v1 As Variant<br />
Dim v2 As Variant<br />
Set doc = IEDOMFromhWnd(hWnd)<br />
'Pass the data back through the function<br />
On Error GoTo Ender:<br />
GetIEText.Text = doc.body.innerText<br />
GetIEText.HTML = doc.body.innerHTML<br />
Exit Function<br />
Ender:<br />
GetIEText.Text = "No Chat Or Pm Open ?"<br />
Err.Clear<br />
End Function<br />
Private Function IEDOMFromhWnd(ByVal hWnd As Long) As IHTMLDocument<br />
Dim IID_IHTMLDocument As UUID<br />
Dim hWndChild As Long<br />
Dim spDoc As IUnknown<br />
Dim lRes As Long<br />
Dim lMsg As Long<br />
Dim hr As Long<br />
If hWnd <> 0 Then<br />
'If the Handle is not 0, that means if the window is open .........<br />
'We tell windows we are going in for the kill, and grabbing the data<br />
lMsg = RegisterWindowMessage("WM_HTML_GETOBJECT")<br />
Call SendMessageTimeout(hWnd, lMsg, 0, 0, SMTO_ABORTIFHUNG, 1000, lRes)<br />
If lRes Then<br />
With IID_IHTMLDocument<br />
.Data1 = &H626FC520<br />
.Data2 = &HA41E<br />
.Data3 = &H11CF<br />
.Data4(0) = &HA7<br />
.Data4(1) = &H31<br />
.Data4(2) = &H0<br />
.Data4(3) = &HA0<br />
.Data4(4) = &HC9<br />
.Data4(5) = &H8<br />
.Data4(6) = &H26<br />
.Data4(7) = &H37<br />
End With<br />
hr = ObjectFromLresult(lRes, IID_IHTMLDocument, 0, IEDOMFromhWnd)<br />
'We pass the data back from the function.<br />
End If<br />
End If<br />
End Function<br />
<br />
<br />
Public Function GetIMWindowText(lWindow As Long) As YIMType<br />
Dim IMClass As Long<br />
Dim MidWin As Long<br />
Dim InternetExplorerServer As Long<br />
Dim Something As typWinFinal<br />
Dim X As Integer<br />
Dim sTmp As String<br />
Dim yTmp As YIMType<br />
<br />
'Loop through all the windows finding their handles from predefined classnames.<br />
'IMClass = FindWindow("imclass", vbNullString)<br />
Something = GetChildWindows(lWindow)<br />
For X = 0 To Something.Count<br />
sTmp = Something.ChildWindows(X).ClassName<br />
If Len(sTmp) > 4 Then<br />
If StrComp(Left(sTmp, 3), "atl", vbTextCompare) = 0 Then<br />
InternetExplorerServer = FindWindowEx(Something.ChildWindows(X).hWnd, 0&, "internet explorer_server", vbNullString)<br />
yTmp = GetIEText(InternetExplorerServer)<br />
If InStr(1, yTmp.HTML, "function RestoreStyles()") > 0 Then<br />
GetIMWindowText = yTmp<br />
End If<br />
End If<br />
End If<br />
Next<br />
End Function<br />
does anyone have example how to set some html tag into interent Explorer_server?
thank you much
|
|
|
|
|
VB_Crazy wrote: interent Explorer_server
What's an "interent Explorer_server"??
You might want to be a bit more specific about what you want to do. Put a tag into what??
|
|
|
|
|
Internet Explorer_Server is what yahoo messenger use for
chat text class name
i'm trying to add some html tag and information into that
notice myself only.
|
|
|
|
|
No one have idea how to work this?
|
|
|
|
|
i want to encrypt my database which is in access. I linked access with vb6...help with the encrption
|
|
|
|
|
OK. Open Access, go to the Tools menu, click on Security, then click on Encrypt/Decrypt database. Pick the database you want to encrypt, then give the encrypted copy a filename.
|
|
|
|
|
Hello,
I am writting a samll editor for my application using RichTextbox in VB 2005.
When i am clicking on RightToLeft button all the font style is dissapearing.
Could someone help?
Please try the following:
1) Add richtextbox1 and two buttons
2) Run the program
3) Write in the RichTextBox "HEllo" for example
4) Select the Hello world
5) Click on Button1
6)Click on button2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
RichTextBox1.SelectionFont = New Font("Arial", 14, FontStyle.Bold Or FontStyle.Italic)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
RichTextBox1.RightToLeft = Windows.Forms.RightToLeft.Yes
End Sub
Thank you
Shay Noy
|
|
|
|
|
This is a known issue. You can read about it here[^]. There is no fix yet.
The workaround is to copy the contents of the RTB to the clipboard, change the RightToLeft property, then paste the contents back into the RTB.
An alternative, that I did NOT try, is to grab the contents of the RTF property instead of copying to the clipboard, then put it back after you change the property.
|
|
|
|
|
Thank you, but if I have more that one line in my richtextbox it doesn't work well.
Have you got any idea how to surmount this problem?
Thank you
Shay Noy
|
|
|
|
|
I already gave you the only known workaround.
Anything else would require using a 3rd party RichTextBox control, not Microsoft's.
|
|
|
|
|
|
Thanks to Chris for his answer about the delegation but I new to it.
My aim is to check a check box on Form1 when the other check box on Form2 to gets clicked in runtime. Would you please show me how to do that with delegation.
Thank You.
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
|
In .net 2005,pass the parameter fields to Crystal Report through vb.net
is successfully running.
But in .net 2003,i don't know How to pass the parameter fields to Crystal Report through vb.net.so can any body teach me how to pass the parameter fields to Crystal Report through vb.net in .net 2003.i want in windows application.
|
|
|
|
|
Hi,
In regard to your query I would suggest you to take a look at the following code snippet in the following code snippet I have explained how to pass Date parameter to Crystal report.
first you have to import thease name spaces:
-------------------------------------------------------------------------------------
BEGIN CODE
Imports CrystalDecisions.Shared
Imports CrystalDecisions.CrystalReports.Engine
Dim myReport as new CrystalReport1()
myReport.Load()
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldDefinition As ParameterFieldDefinition
'ParameterValues and ParameterDiscreteValue are off the CrystalDecisions.Shared
'namespace
Dim crParameterValues As New ParameterValues()
Dim crParameterDiscreteValue As New ParameterDiscreteValue()
crParameterDiscreteValue.Value = "09/14/2005"
crParameterFieldDefinitions = myreport.DataDefinition.ParameterFields
crParameterFieldDefinition = crParameterFieldDefinitions.Item("Your Crystal Report Parameter name")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
CrystalReportViewer1.ReportSource = myreport
END CODE
-------------------------------------------------------------------------------------
I hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
hi,
can u help for me..
how to pass more then one paramter field at run time?
thanks n advanc..
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
|
|
|
|
|
Hello every one,
I am having a VB.net application with postgresSQL as the Database
I want to store images in the database. Following is the code I am using
Dim inputFileStream As New FileStream("C:\test.gif", FileMode.Open, FileAccess.Read)
Dim reader As New BinaryReader(inputFileStream)
Dim bytes() As Byte
'Dim par As NpgsqlParameter
bytes = reader.ReadBytes(CInt(inputFileStream.Length))
inputFileStream.Close()
Dim Sql As String = "INSERT INTO im_prescription_image VALUES (@st_image_name, @im_image)"
Dim Cmd As New Npgsql.NpgsqlCommand(Sql, cnn)
Cmd.Parameters.Add("@st_image_name", NpgsqlTypes.NpgsqlDbType.Varchar).Value = "as10000000000000"
Cmd.Parameters.Add("@im_image", bytes)
Cmd.ExecuteNonQuery()
cnn.Close()
I am getting this error
Npgsql.NpgsqlException was unhandled
BaseMessage="invalid input syntax for type oid: "\107\111\106\070\071\141\363\002\140\004\367\000\000\000\000\000\200\000\000\000\200\000\200\200\000\000\000\200\200\000\200\270\233\273\272\273\273\274\333\273\276\373\273\300\033\274\302\073\274\304\133\274\306\173\274\135\033\020\000\073""
Code="22P02"
Detail=""
ErrorSql="INSERT INTO im_prescription_image VALUES ('as10000000000000', '\\107\\111\\106\\070\\071\\141\\363\\002\\140\\004\\367\\000\\000\\000\\000\\000\\200\\000\\000\\000\\200\\000\\200\\200\\000\\133\\274\\306\\173\\274\\135\\033\\020\\000\\073')"
File="oid.c"
Hint=""
Line="64"
Message="ERROR: 22P02: invalid input syntax for type oid: "\107\111\106\070\071\141\363\002\140\004\367\000\000\000\000\000\200\000\000\000\200\000\200\200\000\000\000\200\200\000\200\302\073\274\304\133\274\306\173\274\135\033\020\000\073""
Position=""
Routine="oidin_subr"
Severity="ERROR"
Source="Npgsql"
Where=""
Can any one please help me with it.
|
|
|
|
|
nishkarsh_k wrote: Cmd.Parameters.Add("@st_image_name", NpgsqlTypes.NpgsqlDbType.Varchar).Value = "as10000000000000"
Cmd.Parameters.Add("@im_image", bytes)
I would venture to guess that you didn't specify a database type for the second parameter. So the parameter is guessing at the type bytes is supposed to be and getting it wrong. You specified it for the first parameter, but you left that out when you created the second parameter. Why?
|
|
|
|
|
Well, that's at least a different error to the one he was getting yesterday
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 )
|
|
|
|
|
True. I get the feeling this is cut'n'paste code though. Probably modified without knowing what's really going on. Stay tuned for scenes from next week's episode!
|
|
|
|
|
Hello
Dave & Christian
For the new week's episode
Yes this was a majority copy and past code, but i understood it before trying to implement.
As you had pointed out that i had not defined the type of second parameter, i was not able to figure out which type to use. I used
Cmd.Parameters.Add("@im_image", NpgsqlTypes.NpgsqlDbType.Bytea).Value = bytes
It gave me the same error
"Invalid input syntax for type oid"
So I tried the different available syntax
Any idea of what to be done?
Regards
Nishkarsh
|
|
|
|
|
I have no idea since I've never used Postgres, and don't plan on it ever either, but a Binary type should work. Better yet, check the docs on it here[^].
|
|
|
|
|
Hi
I have developed an application which is using a MS ACCESS 2007 database, while the app is only retrieving data so i added that database in My.Resources (I also want to hide the database from other Power Users) so that it wud be compiled into the app itself but then how to resolve it into working access file n start processing data.
Please help me in this regard asap.
Thanks
MAP Tiger
Tiger Softwares
Software Designer and Developer
VB.NET, ASP.NET, VFP
|
|
|
|
|
That won't work. An Access database has to be in file form in order to be of any use. An alternative would be to use an XML file, if the dataset isn't too large.
|
|
|
|
|
Thanks buddy, i m using XML alternative n it is working absolutely fine.
Thanks again.
MAP Tiger
Tiger Softwares
Software Designer and Developer
VB.NET, ASP.NET, VFP
|
|
|
|
|