how to find send a file window?

You can talk about VB programming here

how to find send a file window?

Postby Johnny5 » Sun Aug 05, 2007 12:26 am


hello all, I'm trying to make a program to send music songs over paltalk, could anyone help on finding the window for it? any help or suggestion are great !!!

Thanks Advance.
Johnny5
imFiles Junior
imFiles Junior
 
Posts: 72
Joined: Wed Dec 29, 2004 7:16 pm

Postby autopilot » Sun Aug 05, 2007 8:38 am

first you will need to read and understand THIS to learn the basics of integrating a program with paltalk.

Once you understand what is being taught in the above post, then you can start applying what you have learned and use reshack to figure out the command to send to open a Send File dialoge box.

If you understand VB and can follow code, you can use one of the following as a starting point so your program will work with multiple versions of the paltalk client:
VB 6

VB 2005 detect pal version
and
VB 2005 find subform wHnd

good luck

autopilot
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 358
Joined: Sat Sep 23, 2006 7:19 pm

Postby Johnny5 » Sun Aug 05, 2007 8:17 pm

hi autopilot, thx for fast reply, i'm able to get the window popup, however using API SPY to find the window is not work, is the another way to find that window? b/c I have to find the window handle to insert text into the filepath textbox. Thanks for your help.
Johnny5
imFiles Junior
imFiles Junior
 
Posts: 72
Joined: Wed Dec 29, 2004 7:16 pm

Postby Chike » Mon Aug 06, 2007 6:59 am

Try Winspector spy
Chike
imFiles Master
imFiles Master
 
Posts: 583
Joined: Sun May 13, 2007 6:20 pm

Postby Departure » Mon Aug 06, 2007 7:50 am

Find the window by its title and not by its handel #3030 or something like that is a very common window handel
User avatar
Departure
Global Moderator
Global Moderator
 
Posts: 996
Joined: Thu Mar 17, 2005 11:26 am
Location: Australia

Postby autopilot » Tue Aug 07, 2007 12:17 pm

Johnny5 wrote:hi autopilot, thx for fast reply, i'm able to get the window popup, however using API SPY to find the window is not work, is the another way to find that window? b/c I have to find the window handle to insert text into the filepath textbox. Thanks for your help.

johnny try using the findwindow api.
Code: Select all
    Declare Auto Function FindWindow Lib "user32.dll" Alias "FindWindow" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
    Declare Auto Function FindWindowNullClassName Lib "user32.dll" Alias "FindWindow" (ByVal lpClassName As Integer, ByVal lpWindowName As String) As Integer
    Declare Auto Function FindWindowNullWindowCaption Lib "user32.dll" Alias "FindWindow" (ByVal lpClassName As String, ByVal lpWindowName As Integer) As Integer
if you know the window caption, class name or both, then you can get the handle with one of the above api calls.

or... you can get this vb6 project or this vb2005 module and follow the examples to get the subwindow handles.

autopilot

EDIT: I like to use a spy utility that comes with autohotkey

EDIT2: the above code is for vb2005... if you are using vb6, you will have to change integer to long
Last edited by autopilot on Tue Aug 07, 2007 12:22 pm, edited 2 times in total.
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 358
Joined: Sat Sep 23, 2006 7:19 pm

Postby autopilot » Thu Aug 09, 2007 9:29 am

I added the send file functionallity to my sample vb6 send text project. I dont know how or why, but the standard approach would not work so i used sendkeys instead. you may have to play with the sleep times to get it to work on your pc.

autopilot
Attachments
SendFileAnyPalVerAutoDetect.zip
Send file by code
(14.27 KiB) Downloaded 100 times
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 358
Joined: Sat Sep 23, 2006 7:19 pm

Postby Johnny5 » Fri Aug 10, 2007 5:32 pm

thx autopilot, you know what, I used ResHack to view the dialog (#116) which is the send file window, in there I found a weirdo class {#######} I guest is the CommonDialog thingy , I'm able to find the window and all the buttons, however it require to browse for the file and open it, It used that instead of the filepath in the text box, I tested open a file then change the text path, send, the received file is what I openned, not the one in textbox. I need to somehow set the OpenFile thingy hihi, this is hard.

Any additional help greatly appreciated.
Johnny5
imFiles Junior
imFiles Junior
 
Posts: 72
Joined: Wed Dec 29, 2004 7:16 pm

Postby Johnny5 » Fri Aug 10, 2007 6:08 pm

autopilot: I think I got it, enter the full file path in the openfile dialog then press sendKeys Enter to get out of openfile then press send. :)
Johnny5
imFiles Junior
imFiles Junior
 
Posts: 72
Joined: Wed Dec 29, 2004 7:16 pm

Postby Johnny5 » Fri Aug 10, 2007 9:18 pm

Public Function SendFile2(ByVal strFPath As String) As Boolean
On Error GoTo ERRX

Dim window As Long
'For PT 9.x
window = FindWindow("dlggroupchat window class", vbNullString)

PostMessage window, WM_COMMAND, 32902, 0

Sleep (1000) 'wait 1 second to let file send box open
SendKeys "{TAB 2}" 'Get focus on Browse Button
SendKeys "{ENTER}" 'Open Browse box
Sleep (500) 'wait half second to let browse box open
SendKeys strFPath 'send file name to browse box
SendKeys "{ENTER}" 'Accept file name entry
Sleep (500) 'wait half second to let browse box close
SendKeys "{TAB}" 'Get focus on Send Button
SendKeys "{ENTER}" 'Send the file
SendFile2 = True

Exit Function
ERRX:


End Function

-----------------------------

the above code should works, with condition have the correct nick highlighted. :) thx to autopilot you are great !
Johnny5
imFiles Junior
imFiles Junior
 
Posts: 72
Joined: Wed Dec 29, 2004 7:16 pm

Postby autopilot » Sun Aug 12, 2007 4:56 pm

well... knowing that the vb sendkeys function is not supported by vista, i was not real pleased with the solution that I had come up with. so i played with the code until i came up with a solution that did not use the sendkeys function. so not only will it work with vista, but it also executes alot faster then the sendkeys function

autopilot
Attachments
SendFileAnyPalVerAutoDetect.zip
Send file by code...
(14.63 KiB) Downloaded 84 times
User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 358
Joined: Sat Sep 23, 2006 7:19 pm

Re: how to find send a file window?

Postby method » Sun Apr 05, 2009 6:33 pm

Autopilot if i got a second edit box in the same exteranl window how i can use your code to send text to that edit box too ?


Code: Select all
iHnd = getPalSubForm("#32770", "Open", "Edit", 1) 'find textbox to place file name
        iResult = SendMessageByString(iHnd, WM_SETTEXT, 0, Text2.Text) 'send file name to textbox
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Re: how to find send a file window?

Postby String » Sun Apr 05, 2009 8:02 pm

Find it's index.
How do you find its index? http://www.locohacker.net/instant-messenger/post74325.html#p74325
-= 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 find send a file window?

Postby method » Sun Apr 05, 2009 8:29 pm

string thanks but i dont see anything about index of edit boxes in this page. I want to send text to description edit box in upload video window but all i dont know how to refrence that edit box. I know how to send text to first edit box but not the second one !!! Could u tell me how to send text to that edit box ?
method
imFiles Master
imFiles Master
 
Posts: 686
Joined: Tue Oct 18, 2005 11:12 am

Re: how to find send a file window?

Postby autopilot » Tue Apr 07, 2009 2:06 pm

User avatar
autopilot
Forum Moderator
Forum Moderator
 
Posts: 358
Joined: Sat Sep 23, 2006 7:19 pm

Next

Return to Visual Basic Programming

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests