How to send click to open make name window

You can talk about VB programming here

How to send click to open make name window

Postby method » Wed Apr 01, 2009 5:22 am


Hi all . I wonder how i can send a click to paltallk login page so it opens the make name window. could any one show me how this can be done? Thanks
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Re: How to send click to open make name window

Postby String » Wed Apr 01, 2009 2:52 pm

Here is some simple code to open the registration page. But that window is only open when you first load pal.
Code: Select all
Dim lngWin As Long
Dim lngStatic As Long
    lngWin  = FindWindow("#32770", "Welcome to PaltalkScene")
   
    lngStatic = FindWindowEx(lngWin, 0&, "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic , "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic , "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic , "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic , "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic , "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic , "static", vbNullString)
   
    Call SendMessageLong(lngStatic , WM_LBUTTONDOWN, 0&, 0&)
    Call SendMessageLong(lngStatic , WM_LBUTTONUP, 0&, 0&)

I didn't thoroughly test this code, but it should work.
-= Please ask your questions in the forum, not in pm.
String
imFiles Senior
imFiles Senior
 
Posts: 313
Joined: Mon Mar 10, 2008 7:06 am
Location: IDE

Re: How to send click to open make name window

Postby method » Wed Apr 01, 2009 6:37 pm

Thanks string for your help. I loaded paltalk and pressed the button nothing happend!! No error and the registeration window didn't open. All i want this link cliced "New user/Get a Nickname" so the registeration window pops up! Hope you help me fix this code.Thanks

Code: Select all
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
                ByVal lpClassName As String, _
                ByVal lpWindowName As String) As Long
Private Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
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
Private Sub Command1_Click()
Dim lngWin As Long
Dim lngStatic As Long
    lngWin = FindWindow("#32770", "Welcome to PaltalkScene")
   
    lngStatic = FindWindowEx(lngWin, 0&, "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic, "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic, "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic, "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic, "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic, "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic, "static", vbNullString)
   
    Call SendMessageLong(lngStatic, WM_LBUTTONDOWN, 0&, 0&)
    Call SendMessageLong(lngStatic, WM_LBUTTONUP, 0&, 0&)
End Sub
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Re: How to send click to open make name window

Postby String » Wed Apr 01, 2009 9:31 pm

add this to your declarations
Code: Select all
    Private Const WM_LBUTTONDOWN = &H201
    Private Const WM_LBUTTONUP = &H202
-= Please ask your questions in the forum, not in pm.
String
imFiles Senior
imFiles Senior
 
Posts: 313
Joined: Mon Mar 10, 2008 7:06 am
Location: IDE

Re: How to send click to open make name window

Postby method » Wed Apr 01, 2009 10:09 pm

Thanks for your replyI already tried that but didn't work!!
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Re: How to send click to open make name window

Postby String » Wed Apr 01, 2009 10:25 pm

I don't know why you are having trouble. I tested the code below and it works fine.
Note that in my first post, I mentioned that the login window is closed after login. If you are logged into pal, it wont work. Open a new project, paste in only the code below.
Code: Select all
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
                ByVal lpClassName As String, _
                ByVal lpWindowName As String) As Long
Private Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
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
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_LBUTTONUP = &H202
Private Sub Command1_Click()
Dim lngWin As Long
Dim lngStatic As Long
    lngWin = FindWindow("#32770", "Welcome to PaltalkScene")
   
    lngStatic = FindWindowEx(lngWin, 0&, "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic, "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic, "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic, "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic, "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic, "static", vbNullString)
    lngStatic = FindWindowEx(lngWin, lngStatic, "static", vbNullString)
   
    Call SendMessageLong(lngStatic, WM_LBUTTONDOWN, 0&, 0&)
    Call SendMessageLong(lngStatic, WM_LBUTTONUP, 0&, 0&)
End Sub
-= Please ask your questions in the forum, not in pm.
String
imFiles Senior
imFiles Senior
 
Posts: 313
Joined: Mon Mar 10, 2008 7:06 am
Location: IDE

Re: How to send click to open make name window

Postby Departure » Thu Apr 02, 2009 12:47 am

What version of paltalk are you using? this might have something to do with it as the static control might be in a diffrent order
User avatar
Departure
Global Moderator
Global Moderator
 
Posts: 996
Joined: Thu Mar 17, 2005 11:26 am
Location: Australia

Re: How to send click to open make name window

Postby method » Thu Apr 02, 2009 1:07 am

Thanks string it worked well .
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am


Return to Visual Basic Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests