- This topic has 59 replies, 5 voices, and was last updated 11 years ago by Chike.
-
AuthorPosts
-
February 23, 2013 at 6:08 pm #186620ChikeMember
Well GetPMWindows need to be declared as i first posed it. either as a method of the form class or a public function in a module.
You cannot declare oldPMs inside Away_Click, it must be a member of the form class.February 23, 2013 at 7:23 pm #186619ChiNaAdministratorAbout Well GetPMWindows need to be declared as i first posed it.
Thanks for fast response.
Ups, Edited again.. The GetPMWindows, is already declared. But I did it totally wrong.. I posted it just like your first post and then changed it.. My BAD.. Thanks that is fixed.
You cannot declare oldPMs inside Away_Click, it must be a member of the form class.
Yeh and that was what I did first time put it as a form class, but then i changed my mind.
Thanks Chike. Let me try again then if i am blocked i will ofcourse ask.February 23, 2013 at 8:37 pm #186618ChiNaAdministratorHi, Back.. And guess what Chike.. It worked finally… Just an error I got on this line here, but can be fixed! I came to let you know! But will tell a bit about the error also:
And the error I get is on this line:
if Not oldPms.Contains(pm) Then
So this is the line for the timer you sent me:
Dim pms As List(Of IntPtr) = GetPMWindows() For Each pm As IntPtr in pms if Not oldPms.Contains(pm) Then respone(pm) End If Next oldPms = pms
And instead of line “Response(pm)” I added my TEXT SENDER options.
And the error that I get is only when my the PM gets open. But it does send the message first to the pm.and then I get the yello error and the application closes, Still on debug. I think I can fix that.You and String have done an amazing job, and specially now on this last part! Worked the first time!
Now back to fix the problem! I will let you know Chike…. Thanks ChikeFebruary 23, 2013 at 9:58 pm #186617ChikeMemberMy codes is flawless, and have no errors.
Post the whole code I’ll tell you what you did wrongFebruary 23, 2013 at 11:22 pm #186616ChikeMemberThe folloeing code check the away status in paltalk, as I said before it require the menu bar to be visible.
external declerations' menus Structure RECT Dim left As Int32 Dim top As Int32 Dim right As Int32 Dim bottom As Int32 End Structure Structure MENUBARINFO Dim cbSize As Int64 Dim rcBar As RECT Dim hMenu As IntPtr Dim hwndMenu As IntPtr Dim fBarFocused As Boolean Dim fFocused As Boolean End Structure Declare Auto Function GetMenuBarInfo Lib "user32.dll" _ (hwnd As IntPtr, idObject As Long, idItem As Long, ByRef pmbi As MENUBARINFO) As Boolean Private Declare Auto Function GetMenu Lib "User32.dll" _ (hWnd As IntPtr) As IntPtr Private Declare Auto Function GetSubMenu Lib "User32.dll" _ (hMenu As IntPtr, nPos As Integer) As IntPtr Private Declare Auto Function GetMenuState Lib "User32.dll" _ (hMenu As IntPtr, uId As UInteger, uFlags As UInteger) As UInteger Private Declare Auto Function GetMenuItemID Lib "User32.dll" _ (hMenu As UInteger, nPos As Integer) As UInteger Public Const MF_BYPOSITION As UInteger = &H400 Public Const MF_BYCOMMAND As UInteger = &H0 Public Const MF_CHECKED = &H8 Public Const MF_DISABLED = &H2 Public Const MF_GRAYED = &H1 Public Const MF_HILITE = &H80 Public Const MF_MENUBARBREAK = &H20 Public Const MF_MENUBREAK = &H40 Public Const MF_OWNERDRAW = &H100 Public Const MF_POPUP = &H10 Public Const FAILED As UInteger = &HFFFFFFFFUI ' -1 Public Const WM_ENTERMENULOOP As UInteger = &H211 Public Const WM_INITMENU As UInteger = &H116 Public Const WM_INITMENUPOPUP As UInteger = &H117
The function
Public Function IsAway(pal_wnd As IntPtr)
Dim hmenu As IntPtr = GetMenu(pal_wnd)
If hmenu IntPtr.Zero Then
' this is trick to fool paltalk to think menus are about to show
' and update checkmark
Call SendMessage(pal_wnd, WM_INITMENUPOPUP, hmenu, 1)
hmenu = GetSubMenu(hmenu, 1) ' get Actions sub menu
Call SendMessage(pal_wnd, WM_INITMENUPOPUP, hmenu, 0)
hmenu = GetSubMenu(hmenu, 0) ' get status sub menu
Dim status As UInteger = GetMenuState(hmenu, 1, MF_BYPOSITION) ' get Away item status
Return (status And MF_CHECKED) 0
End If
Return False
End Functioncall the function
Dim pal_wnd As IntPtr = FindWindow("SEINFELD_SUPERMAN", vbNullString)
if IsAway(pal_wnd) Then
' do something
End IfFebruary 24, 2013 at 12:38 am #186615ChiNaAdministratorI am positive your codes doesnt have errors.. It was my fault! I was trying to fit my TEXT SENDER into the timer, and didnt realise that I also added a “RichTextBox.Text” as a Text to be sent, inside the same time! So 2 Text Sending options in 1 Timer.. My bad..
About the last code, the menu bars visibility, I will have to read a bit more about last the codes you sent me.. Still newbie, but have learned a lot!
And_______Some thing I appreciate the last couple of days:I experienced like 2 weeks ago I asked for help in one of the biggest vB forums about some help that had to do with Paltalk! I got an answer, and the answer was not only from 1 person! I got the same answer from all the top Posters with the highest Reputations in that forum. All of them had more than 4.000 post counts.
They said Paltalk has thausands of Menus, Bars and Windows. Plus you will have to create the API yourself.
So basicly their answer was a NO, because they were not going for something that hard.
I have now realised that I am learning from the BEST. Which is you guys on here! I appreciate every single line! And I am getting it to myself with a broken english 😀 .. Thank you Chikeeeeeeeeee. Hats off for all the hard work you put in for us New runners.
February 24, 2013 at 1:32 am #186614ChikeMemberThe menu tricks are mostly windows programming which I did up to 10 years ago, you cannot expoect just any programmer to know them, and I myself had to do some re-reading to find what I knew is there.
Paltalk is making more use of custom classes which make it more difficult to create add-ons.
Read tyhe about menus. lots of entries there but they are all dundonental to undestand how can you do things, and you don’t have to fo it all in one day, take your time.
And BTW I’m quite sauced, so bear with any typos I have made.February 24, 2013 at 1:52 am #186613ChiNaAdministrator@Chike wrote:
The menu tricks are mostly windows programming which I did up to 10 years ago, you cannot expoect just any programmer to know them, and I myself had to do some re-reading to find what I knew is there.
Paltalk is making more use of custom classes which make it more difficult to create add-ons.
Read tyhe about menus. lots of entries there but they are all dundonental to undestand how can you do things, and you don’t have to fo it all in one day, take your time.
And BTW I’m quite sauced, so bear with any typos I have made.I am just amazed… Actually while reading your reply am sitting and looking at it trying to make it fit with my old work! And as you said I am also taking my time on it.. Appreciate your time Chike for doing this. Soon when I finish the Auto-Responder will def post a few details about it, and I think I will use some color faders and some other special addons too instead of just text-messaging…. 8)
February 24, 2013 at 10:50 am #186612ChikeMemberFixed an error I had there
Public Const FAILED As UInteger = &HFFFFFFFFUI ' -1
February 24, 2013 at 4:11 pm #186611ChiNaAdministratorhi Chike, Great job. Works awesome!… I was trying to put the “call” below in my timer to executer my Text-Sender to send a text! But dont know how to make it RESPOND one time! As it starts flooding. I have had the same problem when I was creating my txt-sending products! I think this will help me a lot to figure out how to send text only once using the timer!
February 24, 2013 at 6:38 pm #186610ChikeMemberWhat “call”? The code I posted in does not flood
February 24, 2013 at 7:52 pm #186609ChiNaAdministratororhh no, The other code is working awesome, and I think I am going to use that for the release Chike.. Thanks a lot bro.I was talking about the Last part…. The last code you pasted! I tried to create a clean application without using any timer..
This is the Call I was talking about:
I added the Send.Keys(TextBox1.Text) Just for testing, because i was at work and had none of my Text-Sending apps or codes with me. So I went for a simlpe SendKeys Method.
And I think its because I used the SendKeys Method instead of using my own Sender… I dont know didnt try again!I will try with my own simple Text-Sending method! And ofcourse no timer was used..I dont know what I am doing wrong..
February 24, 2013 at 8:28 pm #186608ChikeMember“do something” must be at least the code I have posted in
The function does nothing but checking the away status therefore it will flood while in away if you don’t send to new pm only.
You now have all the code needed to implement what I have posted inFebruary 24, 2013 at 10:24 pm #186607ChiNaAdministratorAwesome, I forgot about the previouse explanations .. Now i can see the total meaning.. I will take a look again and again as I always do. I def let you guys know about the updates. And so far so good Chike. Below is an Image of how far I have come.
I dont wanna crowd this more than the 8 buttons I have implemented! It still only has to be an auto-responder :D! I also created a fully functional inbuilt Text-Sender as well! It can send Text in the room and in PM-Chat, and ofcourse without any Room Selector or any dll…
Thanks to you and String I managed do the last part without any dll. Hats off for you guys! Incl. Admin a lovely person who helped me with the Away Status..etc.. as he always does.
February 25, 2013 at 1:45 am #186606ChiNaAdministratorA few hours Later, I released a BETA 1.0…
Here is the Link:
-
AuthorPosts
Related
- You must be logged in to reply to this topic.