Skip to content

Departure

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 629 total)
  • Author
    Posts
  • Departure
    Member

    It’s the same method we use to find controlls only changed a bit to identify chat room. Using the 1st code before oppening the room selector you can already have the controlls.

    yeah I see that, but logic dictates that if there is no Roomlist(dlgId) then its a pm window else it must be a room.

     

    btw I found a nice little delphi sample on streaming RTF text to other applications, it not too far off what we use now but there is some intersting flags and callbacks

    It is in Delphi but im sure you will no problems understanding it..

    implementation
    
    uses CommonMemoryUnit;
    
    {$R *.DFM}
    
    type
      PSetTextEx = ^TSetTextEx;
      tagSetTextEx = record
        flags : DWORD;
        codepage : UINT;
      end;
      TSetTextEx = tagSetTextEx;
      SETTEXTEX = tagSetTextEx;
    
    const
      EM_SETTEXTEX = WM_USER + 97;
      ST_DEFAULT   = 0;
      ST_KEEPUNDO  = 1;
      ST_SELECTION = 2;
      ST_NEWCHARS  = 4;
      ST_UNICODE   = 3;
    
    var
      FStreamRec : TEditStream;
      FStream    : TStringStream;
    
    //-------------------------------------------------- ---------------------------
    //  EM_STREAMOUT message for callback function
    //-------------------------------------------------- ---------------------------
    function EditStreamCallBack(dwCookie: Longint; pbBuff: PByte;
        cb: Longint; var pcb: Longint): Longint; stdcall;
    begin
      try
        pcb := FStream.Write(pbBuff^, cb);
        Result:= 0;
      except
        Result:= 1;
      end;
    end;
    
    //================================================== ===========================
    //  Display in TRichEdit reads the rich text file
    //================================================== ===========================
    procedure TForm1.Button1Click(Sender: TObject);
    var
      AFilePath : String;
    begin
      OpenDialog1.Filter := 'RTFファイル|*.RTF';
      if InitDir = '' then begin
        OpenDialog1.InitialDir := ExtractFileDir(Application.ExeName);
      end;
      if OpenDialog1.Execute then begin
        AFilePath := OpenDialog1.FileName;
        RichEdit1.Lines.LoadFromFile(AFilePath);
      end;
    end;
    
    //================================================== ===========================
    //  Transfer the rich text without using the clipboard to other TRichEdit
    //
    //  Use EM_SETTEXTEX message
    //  Since there is no definition in Delphi XE, defined and used with the required structure
    //
    //  The use of shared memory class CommonMemoryUnit of Halbow museum
    //================================================== ===========================
    procedure TForm1.Button2Click(Sender: TObject);
    var
      Flags      : Integer;
      hTargetApp : HWND;
      hRich      : HWND;
      SetTextRec : TSetTextEx;
      CM         : TCommMemNT;
      CMRec      : TCommMemNT;
      StrSize    : Cardinal;
      StrText    : AnsiString;
    begin
      //Get on the receiving side of the app handle
      hTargetApp := FindWindow(nil, 'TargetForm');
      if hTargetApp = 0 then exit;
    
      //Get on the receiving side of the RichEdit handle
      hRich := FindWindowEx(hTargetApp, 0, 'TRichEdit', nil);
      if hRich = 0 then exit;
    
      //Set the flag to be used in EM_STREAMOUT Create a TStringStream
      FStream := TStringStream.Create('');
      if RichEdit1.SelLength = 0 then begin
        Flags := SF_RTF or SFF_PLAINRTF;
      end else begin
        Flags := SF_RTF or SFF_PLAINRTF or SFF_SELECTION;
      end;
      //By specifying processing a callback function to be used in EM_STREAMOUT
      //When you return or callback function, rich text is stored in FStream
      FStreamRec.pfnCallback := @EditStreamCallBack;
      RichEdit1.Perform(EM_STREAMOUT, Flags, Longint(@FStreamRec));
    
      //Convert the data of the stream in the string to an AnsiString
      //Argument of EM_SETTEXTEX must be AnsiString
      StrText := AnsiString(FStream.DataString);
      StrSize := Length(StrText);
    
      //To generate a shared memory class
      CM    := TCommMemNT.Create(hTargetApp, StrSize);
      CMRec := TCommMemNT.Create(hTargetApp, 100);
      try
        //Stores transfer data to the shared memory
        CM.Write(0, Pointer(StrText), StrSize);
    
        //Set the transfer flag
        //flags Paste operation varies depending on the value of the receiving side (overwrite Toka Toka inserted)
        SetTextRec.flags    := ST_DEFAULT;
        SetTextRec.codepage := CP_ACP;
        CMRec.Write(0, @SetTextRec, SizeOf(SetTextRec));
        //Run transfer message
        SendMessage(hRich, EM_SETTEXTEX, WPARAM(CMRec.MemPtr), LPARAM(CM.MemPtr));
      finally
        CM.Free;
        CMRec.Free;
        FStream.Free;
      end;
    end;
    
    end.

     

    the only I need to check out for the shared memory part is the reference to “CommonMemoryUnit” its not a default unit in delphi

    Departure
    Member

    Nice chike, I use something similar in Delphi, but I can benefit from the snippet you posted to adjust what I am currently using…

     

    thanks

    in reply to: [Delphi]call to all delphi dev. #191039
    Departure
    Member

    The methods are posted all over this forum.. I am pretty sure he has worked this out by now

    in reply to: AntiRedDot and AntiBounce #191025
    Departure
    Member

    Intercepting the WM_QUIT message is only going to stop the window from closing, Paltalk can still disconnect you from the server…..

    in reply to: Paltalk Login/protocol #186504
    Departure
    Member

    There are a lot of packets sent for login, I suggest you take a look at smtocx.dll or what ever it use to be called, you can actually call the function the dll contains to encrypted string of all your hardware and folders ect.. this is used along with paltalks own checks, OS version, OS minor version, yahoo ID, msn ID, HD serial, and some other stuff I can’t remember right now. then you have the username and password encryption which the easy part of the login, There is some information on this forum about that part have a look around. then all this information is encrypted with a static string found in paltalk, Once again I don’t remember the exact string but it was something like “The brown fox blahh blahh blahh”. This is what I can remember from of top of my head and it was a long time ago I played around with paltalk login (4-6 years ago) so things might have changed, but I couldn’t imagine they would make it easier.

    in reply to: Paltalk Programming Tutorial Series[Video] #190225
    Departure
    Member

    Im back 🙂

    Could someone please move this to the correct category? It belongs in Programming Tutorials.

    Also I plan on finishing the series I started and will upload the next episode this week(1 year later lol), Topic will be “Receiving Text”  followed by “Sending Text”, I am not sure how many people actually still write programs for Paltalk but it might be useful for future new comers.

    in reply to: zamtalk chat #190625
    Departure
    Member

    I suggest moving to vb.net as you will get alot more help with coding than vb6 😉

    in reply to: Winamp Bot – Mega (New Version) #174794
    Departure
    Member

    excellent work, I thought winamp was discontinued recently? anyway I think you should look into your own build in sound engine like the BASS library, far superior sound and no need for installing codecs to play ogg, flac ect… as it can be built in with BASS and totally independent from windows sound manager. Limp musicbot used this library and you only need to ask the people who used how much better the sound was compared to windows sound manager, not to mention you will have more control over your musicbot. something to think about for future project 🙂

    in reply to: [Delphi]call to all delphi dev. #191041
    Departure
    Member

    As chike said, you are using an outdated method, there is much more simpler way to achieve what you want.

    in reply to: New Mass add, New toolz >> PalTool v3 #174776
    Departure
    Member

    🙂 good job, nice to see other people using Delphi

    in reply to: Paltalk Bot Source Code VB .net 2010 #186789
    Departure
    Member

    ^ agreeded about cleaning your code, you really need to give your components meaningful names instead of checkbox1, textbox1 ect.. and use variables with meaningful names where possiable

    in reply to: Paltalk Timer #186030
    Departure
    Member

    Yes there is but microsoft don’t call it that, but at the end of the day its size of memory allocated, I normally see types as the following because when i do programing I tend to spent alot of time in ollydebug

    byte = 1 byte = 8 bits aka Byte
    word = 2 bytes = 16 bit aka short Integer
    dword = 4 bytes = 32bits aka Integer,
    Fword = 6 bytes = 48bits aka ?
    QWord = 8 bytes = 64bit aka long integer

    Now for your singed Integers ect.. I am not sure how it works but I think its little endian and big endian that determines signed and unsigned, BUT the point being its still the same amount of memory allocated which is 32bit aka dword aka Integer

    in reply to: Paltalk Timer #186033
    Departure
    Member

    @Chike wrote:

    The S just make them “short” that is a 2 bytes signed integer, when converted to 4byte Integer the sign is kept and the original hex value is lost
    Mp S should have been there in the first place, if at all the all should have UI or UL.
    I think the hex constants default to integer, if they are greater than integer valu you will get an error.
    Most if not all flags in windows are DWORD, that’s an unsigned 64bit integer, that’s how they should be declared and passed to the function to avoid any complications.

    EDIT: another rule to follow” if it aint broke, don’t fix it! Particulary when you are a n00b and what may seem logical to you is a big no no.

    Never seen an S like that before, I even went back on page 4 to see the declarations of consts, btw a short integer is just a word and a integer is a dword which is 32bit not 64bit… a 64bit integer is actually int64 or dword64 which I have no idea why they named such a stupid name instead of QWord or something similar.

    I would never have picked up looking at how you have declared the consts, this is just another reason why I dislike .net and the stupid declarations, Delphi has all these types of things already defined, Its only the undocumented API’s which you can define manually..

    in reply to: Paltalk Timer #186053
    Departure
    Member
    in reply to: Paltalk Timer #186056
    Departure
    Member

    Hmm lets see…

    you get an error on this? with error code 87?

    result = VirtualFreeEx(pHandle, pStrBufferMemory, 0, MEM_RELEASE)
    result = VirtualFreeEx(pHandle, pMyItemMemory, 0, MEM_RELEASE)

    MSDN says this..

    ERROR_INVALID_PARAMETER
    87 (0x57)
    The parameter is incorrect.

    You have declared the function like this…

    Declare Function VirtualFreeEx Lib “kernel32” (ByVal hProcess As IntPtr, ByVal lpAddress As IntPtr, ByVal dwSize As Integer, ByVal dwFreeType As Integer) As Integer

    You created variables like this…

    Dim pHandle As Integer
    Dim pStrBufferMemory As Integer
    Dim pMyItemMemory As Integer

    MSDN says this about VirtualFreeEx…

    Parameters
    hProcess [in]
    A handle to a process. The function frees memory within the virtual address space of the process.
    The handle must have the PROCESS_VM_OPERATION access right. For more information, see Process Security and Access Rights.
    lpAddress [in]
    A pointer to the starting address of the region of memory to be freed.
    If the dwFreeType parameter is MEM_RELEASE, lpAddress must be the base address returned by the VirtualAllocEx function when the region is reserved.
    dwSize [in]
    The size of the region of memory to free, in bytes.

    hmm Parameter lpAddress [in] requires a pointer, pStrBufferMemory As Integer and pMyItemMemory As Integer seems you are passing an integer value and not a pointer?

    I could be completely wrong here as I haven’t personally used this code or looked through it properly.

Viewing 15 posts - 16 through 30 (of 629 total)