Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6117089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:16:50+00:00 2026-05-23T15:16:50+00:00

hi we are using the Delphi 5 version. We are getting problem while opening

  • 0

hi we are using the Delphi 5 version. We are getting problem while opening the notepad in delphi. We want to open notepad on a button click and pass the data to it so that notepad can display that data. I dont want to save it. please help me regarding this. thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:16:50+00:00Added an answer on May 23, 2026 at 3:16 pm

    You can use something like:

    uses
      Clipbrd;
    
    procedure LaunchNotepad(const Text: string);
    var
      SInfo: TStartupInfo;
      PInfo: TProcessInformation;
      Notepad: HWND;
      NoteEdit: HWND;
      ThreadInfo: TGUIThreadInfo;
    begin
      ZeroMemory(@SInfo, SizeOf(SInfo));
      SInfo.cb := SizeOf(SInfo);
      ZeroMemory(@PInfo, SizeOf(PInfo));
      CreateProcess(nil, PChar('Notepad'), nil, nil, False,
                    NORMAL_PRIORITY_CLASS, nil, nil, sInfo, pInfo);
      WaitForInputIdle(pInfo.hProcess, 5000);
    
      Notepad := FindWindow('Notepad', nil);
      // or be a little more strict about the instance found
    //  Notepad := FindWindow('Notepad', 'Untitled - Notepad');
    
      if Bool(Notepad) then begin
        NoteEdit := FindWindowEx(Notepad, 0, 'Edit', nil);
        if Bool(NoteEdit) then begin
          SendMessage(NoteEdit, WM_SETTEXT, 0, Longint(Text));
    
          // To force user is to be asked if changes should be saved
          // when closing the instance
          SendMessage(NoteEdit, EM_SETMODIFY, WPARAM(True), 0);
        end;
      end
      else
      begin
        ZeroMemory(@ThreadInfo, SizeOf(ThreadInfo));
        ThreadInfo.cbSize := SizeOf(ThreadInfo);
        if GetGUIThreadInfo(0, ThreadInfo) then begin
          NoteEdit := ThreadInfo.hwndFocus;
          if Bool(NoteEdit) then begin
            Clipboard.AsText := Text;
            SendMessage(NoteEdit, WM_PASTE, 0, 0);
          end;
        end;
      end;
    end;
    
    procedure TForm1.Button1Click(Sender: TObject);
    begin
      LaunchNotepad('test string');
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I`m using Delphi 2009 and want to operate some XML data. I heard that
Using Delphi 2010 and a patched version of the BDE I run into a
I'm using Delphi 6, and I want a database bound list box with multiselect.
I'm using Delphi 7 and can't predict the target version of Windows. I need
Is it possible to get installed Minecraft version using Delphi? The interesting part is
I am using Delphi 2010 with Tim Anderson's SQLite wrapper (unicode version) Have a
ADO components are present in the Delphi 2009 Professional Version? Currently I'm using delphi
Is there a FOSS batch compiling solution for Delphi that takes version as an
How can I increment version in project files for delphi projects.I am using Delphi
I am using Delphi 2010, latest version (from repository) of JEDI WinAPI and Windows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.