f



How to run Notepad and Paste from clipboard to it

Hello All,

How to RUN Notepad from my app and paste the Clipboard content from
it?

I tried:

RUN NOTEPAD.EXE
KEYBOARD K_CTRL_V

But this doesn't work.

Thanks in advance.

With best regards.

Sudip
0
Sudip
1/21/2010 9:35:42 AM
comp.lang.xharbour 5470 articles. 0 followers. Post Follow

15 Replies
2785 Views

Similar Articles

[PageSpeed] 38

Dear Sudip,

How are you brother?

Write the clipboard content to a text file. and than RUN NOTEPAD.EXE 
FILENAME.TXT

Regards
Bapu.

"Sudip" <sudipb001@gmail.com> wrote in message 
news:c1eb8bad-0347-46ca-a8b2-3b147fa52b06@l30g2000yqb.googlegroups.com...
> Hello All,
>
> How to RUN Notepad from my app and paste the Clipboard content from
> it?
>
> I tried:
>
> RUN NOTEPAD.EXE
> KEYBOARD K_CTRL_V
>
> But this doesn't work.
>
> Thanks in advance.
>
> With best regards.
>
> Sudip 

0
Bapu
1/21/2010 11:27:12 AM
On 21 jan, 07:35, Sudip <sudipb...@gmail.com> wrote:
> Hello All,
>
> How to RUN Notepad from my app and paste the Clipboard content from
> it?
>
> I tried:
>
> RUN NOTEPAD.EXE
> KEYBOARD K_CTRL_V
>
> But this doesn't work.
>
> Thanks in advance.
>
> With best regards.
>
> Sudip


Hi Sudip,
If you don=B4t have to use NOTEPAD, it will work with WinWord.
Take a look at \xharbour-1.2.1.src.tests\xharbour-1.2.1\tests
\testOle.prg.
This allow you to work with Word itself and anything that works in
Macro you can use within XHarbour !
If you are newbie to VBScript you should "play" a while with VBScript
code until you can translate it to XHarbour.

Good luck,
HU





0
Hu
1/21/2010 11:40:02 AM
Sudip,

You should use Windows API, like SendMessge(), or SendInput(). Please search 
this NG as samples were posted in the past.

Ron

"Sudip" <sudipb001@gmail.com> wrote in message 
news:c1eb8bad-0347-46ca-a8b2-3b147fa52b06@l30g2000yqb.googlegroups.com...
> Hello All,
>
> How to RUN Notepad from my app and paste the Clipboard content from
> it?
>
> I tried:
>
> RUN NOTEPAD.EXE
> KEYBOARD K_CTRL_V
>
> But this doesn't work.
>
> Thanks in advance.
>
> With best regards.
>
> Sudip 

0
Ron
1/21/2010 12:15:03 PM
Hello,

Thanks a lot to all of you for your help :-)

Bapu, I don't why your tip doesn't work for me with gtwvw app :-( (but
it works with sample gtwvw app). There must be some error in my app (I
guess) :-)

HU, I worked with Excel from xHarbour, but never worked with Word. It
will be a good choice for me :-)

Ron, I searched for SendMessage() and SendInput() in this group, but
couldn't find. I shall again search for Windows API :-)

For the time being I am giving my client a facility to copy the text
file (which will be browsed as Preview report using TBrowse) to
Clipboard and then s/he will be able to paste it into anything s/he
will like :-) (very primitive way, but it works for me)

Thank you again for your help.

With best regards.

Sudip

0
Sudip
1/22/2010 6:36:16 AM
On Thu, 21 Jan 2010 01:35:42 -0800 (PST), Sudip <sudipb001@gmail.com> wrote:

Hello Sudip.

I'm also looking for something similar to have a better MemoEdit function. I like to have the possibility to edit a MEMO field with Notepad.
I'm using GTWVW to use some possibility from Windows, but didn't find a good solutions to replace or to extend the MemoEdit function.

Good luck and if you find a solution for your NOTEPAD problem, let me now!

Regards
Otto



>Hello All,
>
>How to RUN Notepad from my app and paste the Clipboard content from
>it?
>
>I tried:
>
>RUN NOTEPAD.EXE
>KEYBOARD K_CTRL_V
>
>But this doesn't work.
>
>Thanks in advance.
>
>With best regards.
>
>Sudip
0
Otto
1/22/2010 7:21:26 AM
Hello Otto,

For preview purpose I am doing:

1) SET PRINTER TO a temporary file, whose name I got by using
HB_FTempCreate() function (4th parameter).
2) Now I close the printer.
3) I opened the temporary file with TBrowse() (FileBrws() function,
again created by Clipper Guru, Rick Spence and modified by myself). I
also added mouse features with this :-) There is also another object,
TEditor, which has more features than, MemoEdit, but I found opening
time for FileBrws() function is better (at least in my case) for large
reports. Now, choice is yours :-)
4) With FieBrws() F2 is used to Search forward, F3 for Search backward
and I added F4 to copy contents of the file to Clipboard.

I want to add another feature to copy the contents of a file to
Nopepad directly, so that my user (who are sometimes not very much
computer knowledgeable) to save it to .txt file directly. Now, from
HU's tip, I think it will be better for them to open in MS Word
directly (I am assuming they have Win Word installed in their
computer).

Please send your valuable comments about preview report solution.

Thanks in advance.

With best regards.

Sudip
0
Sudip
1/22/2010 12:41:23 PM
Dear Sudip,

While googling for your query I found one sample for vb...

  [DllImport("user32.dll", EntryPoint = "FindWindowEx")]
    public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr 
hwndChildAfter, string lpszClass, string lpszWindow);
    [DllImport("User32.dll")]
    public static extern int SendMessage(IntPtr hWnd, int uMsg, int wParam, 
string lParam);
    private void button1_Click(object sender, EventArgs e)
    {
        Process [] notepads=Process.GetProcessesByName("notepad");
        if(notepads.Length==0)return;
        if (notepads[0] != null)
        {
            IntPtr child= FindWindowEx(notepads[0].MainWindowHandle, new 
IntPtr(0), "Edit", null);
            SendMessage(child, 0x000C, 0, textBox1.Text);
        }
    }

WM_SETTEXT=0x000c

***************** From this website ***************
http://stackoverflow.com/questions/523405/how-to-send-text-to-notepad-in-c-win32
*******************

Now, Guru's of xharbour can translate it for xharbour..!!! :-)



"Sudip" <sudipb001@gmail.com> wrote in message 
news:c1eb8bad-0347-46ca-a8b2-3b147fa52b06@l30g2000yqb.googlegroups.com...
> Hello All,
>
> How to RUN Notepad from my app and paste the Clipboard content from
> it?
>
> I tried:
>
> RUN NOTEPAD.EXE
> KEYBOARD K_CTRL_V
>
> But this doesn't work.
>
> Thanks in advance.
>
> With best regards.
>
> Sudip 

0
Bapu
1/22/2010 3:02:39 PM
Dear Sudip:

On Jan 21, 11:36=A0pm, Sudip <sudipb...@gmail.com> wrote:
....
> Ron, I searched for SendMessage() and SendInput()
> in this group, but couldn't find. I shall again search
> for Windows API :-)

I find 9 pertinent hits, using Advanced search in Google Groups:
http://groups.google.com/groups/search?safe=3Doff&q=3D%22sendmessage%22+gro=
up%3Acomp.lang.xharbour&btnG=3DSearch&sitesearch=3D

They should be in what32...

> For the time being I am giving my client a facility
> to copy the text file (which will be browsed as
> Preview report using TBrowse) to Clipboard and then
> s/he will be able to paste it into anything s/he
> will like :-) (very primitive way, but it works for me)

copyclip()

Driving Word or Excel (or any OLE capable program) is a good way.  But
leaving it on the clipboard is, in my opinion, superior... since the
user can move the contents to any (non-DOS) application.  Just need
the capability to refresh the clipboard, since it can get used by
other applications, and the user does not always go from step K (copy
from your application) to step L (paste into destintation) in one
motion.  Sometimes they check emails in between...

David A. Smith
0
dlzc
1/22/2010 5:02:20 PM
Hello David,

I am completely agree with you. :) And thanks a lot for the tip :)

Now I am using hb_gtInfo( HB_GTI_CLIPBOARDDATA, cText) for copying cText to clipboard, but CopyClip() function will be a better choice. BTW, I found What32's ShellExecute() command can open Notepad (but I am not using Notepad for following reason ;) ).

Regarding copy to clip board, yes, it is more usable than using MS Excel, Word or Notepad directly. I am completely agree with you. :)

With best regards.

Sudip
0
sudip (209)
1/23/2010 7:59:04 AM
Hello Friend Bapu,
Thanks a lot for your help. :)
With best regards.
Sudip
0
sudip (209)
1/23/2010 8:08:53 AM
On 23 jan, 05:59, sudip <u...@compgroups.net/> wrote:
> Hello David,
>
> I am completely agree with you. :) And thanks a lot for the tip :)
>
> Now I am using hb_gtInfo( HB_GTI_CLIPBOARDDATA, cText) for copying cText to clipboard, but CopyClip() function will be a better choice. BTW, I found What32's ShellExecute() command can open Notepad (but I am not using Notepad for following reason ;) ).
>
> Regarding copy to clip board, yes, it is more usable than using MS Excel, Word or Notepad directly. I am completely agree with you. :)
>
> With best regards.
>
> Sudip
>
> ---
> frmsrcurl:http://compgroups.net/comp.lang.xharbour/How-to-run-Notepad-and-Paste...


Hi Sudip,

Is CopyClip() from XHarbour ?
When I Google all result refer to AutoCad !!??

Regards,
Hu





0
Hu
1/26/2010 11:15:23 AM
Dear Hu:

On Jan 26, 4:15=A0am, Hu <h...@ig.com.br> wrote:
....
> Is CopyClip() from XHarbour ?
> When I Google all result refer to AutoCad !!??

Just use the online reference guide, and search for clipboard:
CloseClipboard() (winapi function reference guide)
EmptyClipboard() (winapi function reference guide)
GetClipBoardData() (winapi function reference guide)
GetOpenClipboardWindow() (winapi function reference guide)
IsclipBoardFormatAvailable() (winapi function reference guide)
OpenClipboard() (winapi function reference guide)
SetClipBoardData() (winapi function reference guide)

CopyClip could be Open + Empty + Set + Close

David A. Smith
0
dlzc
1/26/2010 2:21:34 PM
On 26 jan, 12:21, dlzc <dl...@cox.net> wrote:
> Dear Hu:
>
> On Jan 26, 4:15=A0am, Hu <h...@ig.com.br> wrote:
> ...
>
> > Is CopyClip() from XHarbour ?
> > When I Google all result refer to AutoCad !!??
>
> Just use the online reference guide, and search for clipboard:
> CloseClipboard() (winapi function reference guide)
> EmptyClipboard() (winapi function reference guide)
> GetClipBoardData() (winapi function reference guide)
> GetOpenClipboardWindow() (winapi function reference guide)
> IsclipBoardFormatAvailable() (winapi function reference guide)
> OpenClipboard() (winapi function reference guide)
> SetClipBoardData() (winapi function reference guide)
>
> CopyClip could be Open + Empty + Set + Close
>
> David A. Smith

Thanks David !
You know XHarbour always fullfilled my needs so never have to worry
about WinAPI. Even knowing soon or later I have to !
Sorry but I still can=B4t find any reference to CopyClip() ! Could you
give more details ?

Best Regards,
Hu


0
Hu
1/27/2010 10:46:03 AM
Dear Hu:

On Jan 27, 3:46=A0am, Hu <h...@ig.com.br> wrote:
> On 26 jan, 12:21, dlzc <dl...@cox.net> wrote:
> > On Jan 26, 4:15=A0am, Hu <h...@ig.com.br> wrote:
> > ...
>
> > > Is CopyClip() from XHarbour ?
> > > When I Google all result refer to AutoCad !!??
>
> > Just use the online reference guide, and search for clipboard:
> > CloseClipboard() (winapi function reference guide)
> > EmptyClipboard() (winapi function reference guide)
> > GetClipBoardData() (winapi function reference guide)
> > GetOpenClipboardWindow() (winapi function reference guide)
> > IsclipBoardFormatAvailable() (winapi function reference guide)
> > OpenClipboard() (winapi function reference guide)
> > SetClipBoardData() (winapi function reference guide)
>
> > CopyClip could be Open + Empty + Set + Close
>
> Thanks David !
> You know XHarbour always fullfilled my needs so
> never have to worry about WinAPI. Even knowing
> soon or later I have to !
> Sorry but I still can=B4t find any reference to
> CopyClip() ! Could you give more details ?

#include winuser.ch
function CopyClip
parameters cContents
local lSuccess :=3D .F.
   if valtype( cContents ) =3D "C"
      If OpenClipboard( ) <> 0
         if EmptyClipboard( ) <> 0
            lSuccess :=3D (SetClipBoardData( CF_TEXT, GlobalString
( cContents ) ) <> 0)
            endif
         CloseClipboard()
         endif
      endif
   return lSuccess

Might want to name the function "WriteClip" instead... So that you can
write its inverse "ReadClip".

David A. Smith
0
dlzc
1/27/2010 5:39:59 PM
On 27 jan, 15:39, dlzc <dl...@cox.net> wrote:
> Dear Hu:
>
> On Jan 27, 3:46=A0am, Hu <h...@ig.com.br> wrote:
>
>
>
>
>
> > On 26 jan, 12:21, dlzc <dl...@cox.net> wrote:
> > > On Jan 26, 4:15=A0am, Hu <h...@ig.com.br> wrote:
> > > ...
>
> > > > Is CopyClip() from XHarbour ?
> > > > When I Google all result refer to AutoCad !!??
>
> > > Just use the online reference guide, and search for clipboard:
> > > CloseClipboard() (winapi function reference guide)
> > > EmptyClipboard() (winapi function reference guide)
> > > GetClipBoardData() (winapi function reference guide)
> > > GetOpenClipboardWindow() (winapi function reference guide)
> > > IsclipBoardFormatAvailable() (winapi function reference guide)
> > > OpenClipboard() (winapi function reference guide)
> > > SetClipBoardData() (winapi function reference guide)
>
> > > CopyClip could be Open + Empty + Set + Close
>
> > Thanks David !
> > You know XHarbour always fullfilled my needs so
> > never have to worry about WinAPI. Even knowing
> > soon or later I have to !
> > Sorry but I still can=B4t find any reference to
> > CopyClip() ! Could you give more details ?
>
> #include winuser.ch
> function CopyClip
> parameters cContents
> local lSuccess :=3D .F.
> =A0 =A0if valtype( cContents ) =3D "C"
> =A0 =A0 =A0 If OpenClipboard( ) <> 0
> =A0 =A0 =A0 =A0 =A0if EmptyClipboard( ) <> 0
> =A0 =A0 =A0 =A0 =A0 =A0 lSuccess :=3D (SetClipBoardData( CF_TEXT, GlobalS=
tring
> ( cContents ) ) <> 0)
> =A0 =A0 =A0 =A0 =A0 =A0 endif
> =A0 =A0 =A0 =A0 =A0CloseClipboard()
> =A0 =A0 =A0 =A0 =A0endif
> =A0 =A0 =A0 endif
> =A0 =A0return lSuccess
>
> Might want to name the function "WriteClip" instead... So that you can
> write its inverse "ReadClip".
>
> David A. Smith- Ocultar texto das mensagens anteriores -
>
> - Mostrar texto das mensagens anteriores -

Thanks a lot David !

Hu

0
Hu
1/28/2010 9:28:25 AM
Reply:

Similar Artilces:

Paste from clipboard when clipboard changes mid script
In the middle of my script the clipboard contents change (I'm opening a site which immediately copies a variable to the clipboard). How do I use this variable in my script? If I declare: var p = window.clipboardData.getData('text'); at the beginning, then: p = clipboard at start of script and does not take note of changes. <melvynm@gmail.com> wrote > In the middle of my script the clipboard contents change (I'm opening a > site which immediately copies a variable to the clipboard). That is not going to be a popular site then. The clipboard is generally seen as a...

AS400 runs, and runs, and runs
A friend went to a conference last week. One of the speakers said they went to a location as a consultant to review their systems and suggest possible upgrades. The consultants found the file servers but they couldn't find any physical device that was actually performing the daily business task. After a day of searching and tracing cables they had maintenance rip the drywall from an interior wall. Behind the drywall was a closet door, in the closet was an AS400. None of the current employees knew the AS400 existed. It had been buried inside a closet for at least 5 years, but it was stil...

Pasting from Clipboard
Hi Guys, Just a stupid question perhaps. Why is it that sometimes copying elements and pasting them works but sometimes it does a funny thing... pasting the elements as a bitmap instead. And no matter how i repeat it still gives me the bitmap image. Please advise. Thanks a lot. Ronnie I suppose it depends on what you're copying to the clipboard -- Regards Dave Preston "ronniebaga" <ronniebaga@hotmail.com> wrote in message news:e0d3d449.0312012233.1ef7339a@posting.google.com... > Hi Guys, > > Just a stupid question perhaps. Why is it ...

paste to the clipboard
The "Paste to the clipboard" option don't work well as some the paragraphs result not in order. Why this happens. Is there an other way to to copy text in a word processor? Thank and regards. Sandro Sandrobi wrote: > The "Paste to the clipboard" option don't work well as some the paragraphs > result not in order. Why this happens. > Is there an other way to to copy text in a word processor? > Thank and regards. > Sandro > > Sandro- Are you using Reader, or Acrobat? And what version? Copying and pasting text from entire PDF pages or docu...

Where does Paste Paste?
In building a new layout one often needs to copy or cut a field or a text box and paste it somewhere else. Is there any logic as to where the pasted item will appear? In some grapfics packages the new paste will be on top of the copied object and can then be moved to the desired place, others seem to paste at the current mouse point. But Filemaker (10) where oh! where. John G. On 2009-09-21 02:41:54 -0700, "John G." <greentest@ozemail.com.au> said: > In building a new layout one often needs to copy or cut a field or a text > box and paste it somewhere else. >...

copy/paste from clipboard and (setq x-select-enable-clipboard t)
Dear all, I'm using Debian Linux and GNU Emacs 21.4.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2005-10-03 on trouble, modified by Debian I cannot use copy and paste to insert text from other applications (xterm, acroread) into emacs - it simply does not copy anything. This problem has been described in other posts, where I found the suggestion to use (setq x-select-enable-clipboard t). Initially, this solution works fine. I seem to be able to copy and paste an arbitrary number of text blocks into emacs. But after the first copy/paste operation inside emacs (i.e., after mar...

Need to locate jobs running past their next scheduled run time SQL 2005
SQL Server 2005 SP2 (Standard Edition 32 bit) I need some help trying to figure out the right way to query the job information. The issue is we every now and a then a job that normally runs in a couple of seconds does not complete. It will still show in the job activity page as running but the data which is being fetched from a remote Oracle database will not be updated on the local server. If I can get the job to kill then it will run at its next scheduled time in a couple of seconds and we have data. I need a query that will detect when this (or any other) job has =91hung=92 and is stil...

run of thread, why codes of run(), only run once ?????
Hi, All, For MIDLET, Runnable, there is a thread, but, why my run(), only run once only? not a loop? Best regards, Boki. Boki a �crit : > Hi, All, > For MIDLET, Runnable, there is a thread, but, why my run(), > only run once only? not a loop? > > > Best regards, > Boki. > > when you have a thread, this is normal that it runs only once . You have the init() run and end method that are call, you must include your while(true or test) in head of run() if you do not that, how does the thread know to end the method !? Best regard...

xHarbour apps that run in Windows XP using Advantage Databse Engine do not run in Windows 7 64 bit environment while using Advantage Database Engine
I finally go my Windows XP computer to connect to ADS and it works fine now= just by creating an ADS.INI file and placing the file in the directory of = the client that contains the xHarbour executable. Before I did that the cli= ent computer could not connect to the ADS files. However, when I try to run the same application from a Windows 7 (64 bit) c= omputer, the application cannot open up any xHarbour files unless the files= are NOT managed by ADS. Can anyone help me with this problem? Hi did you try to disable windows 7 uac or call ADSRIGHTSCHECK( ADS_IGNORERIGH= TS )=2...

sql running slow when run from java but runs fine when run from toad
A sql statement is taking a long time to run from Java, but it runs quicky from Toad. I am on 10.1.0 on Windows. Can anybody tell me where to look at? Thanks. I am pasting two trace files below. This is the TRACE File generated when i run the query from TOAD: ***************************************************************************************************** Dump file c:\oracle\product\10.1.0\admin\saracenp\udump\saracenp_ora_6028.trc Thu May 04 16:40:48 2006 ORACLE V10.1.0.2.0 - Production vsnsta=0 vsnsql=13 vsnxtr=3 Oracle Database 10g Release 10.1.0.2.0 - Production Windows Server 2003...

Clipboard Pasting app?
Anyone know if there's an app or system extension that will allow the OS to hold a list of clipboard items in memory that you need often--something like the auto-fill memory in a browser, or maybe a pulldown list, only system-wide for the paste function? This would come in handy for credit card numbers and the like for example, where fields don't recognize auto-fill items. Knowing Apple, seems like they would've already implemented this into the OS. Or maybe it is, and I'm missing something. Thanks, Rog In article <roger-2151D9.10351318102007@nntp.aioe.org>, ...

Pasting onto the clipboard
In java, I know in the 1.4.2 API specification there is a Clipboard class and a Clipboard owner class. I tried but couldn't find out how you just paste a String onto the clipboard. Could someone show me the code I need to copy a simple String onto the clipboard which can be used in other mainstream applications (like Word, etc.)? "Hari" <harixseshadri@yahoo.com> wrote in news:346dnZqr_esndLHcRVn-gA@adelphia.com: > In java, I know in the 1.4.2 API specification there is a Clipboard > class and a Clipboard owner class. I tried but couldn't find out how > you...

Pasting from clipboard gives [ ]
Updated to Eudora 6.1.2 (paid) and when pasting from the clipboard, the image appears momentarily, then shows only [ ] (and no image). Worked good for awhile, but not any more. Have reinstalled pgm and no change. Any help on where to look for solution would be greatly appreciated. Cut & paste works function for all other programs. Using Win-98SE ...

paste image to the clipboard
this should be easy, I want to paste images from many different formats to the clipboard. First, Do I need to know the format of the image? (jpg or png or gif) second what is the best command to do this? right now I think I will need to search for the file type and do a print command. ...

Web resources about - How to run Notepad and Paste from clipboard to it - comp.lang.xharbour

Clipboard - Wikipedia, the free encyclopedia
A clipboard is a thin, rigid board with a clip at the top for holding paper in place. A clipboard is typically used to support paper with one ...

Water polo coach's clipboard for iPhone, iPod touch, and iPad on the iTunes App Store
Get Water polo coach's clipboard on the App Store. See screenshots and ratings, and read customer reviews.

Clipboard and Pen 2 - Flickr - Photo Sharing!
Clipboard and Pen 2 - Past and present tools of the collection agency trade.

Clip Stack: A Clipboard Your Phone Needs – XDA App Review - YouTube
and millions of cat videos. Smartphones have brought friends and family closer. Find something funny, adorable, or twisted that your friends ...

New from Google: Paid web apps, drawings in web clipboard, latest breathtaking 45° imagery in Maps
Stunning 45-degree views are now available in Maps for more places in the US and abroad. Never content with resting on its laurels, Google have ...

Google Docs, Sheets, & Slides iOS apps now let you ‘Make a copy’, copy links to clipboard, more
... function for documents, spreadsheets, and presentations across all three apps, you’ll also now be able to copy links to your device’s clipboard. ...

Salesforce Acquires Bookmarking Startup Clipboard for More than $10M
Salesforce has acquired Clipboard , a social bookmarking service that had built interesting hooks for saving rich web content across devices, ...

OneClip Is Microsoft's Upcoming Cross-Platform Cloud Clipboard Service
There's little doubt in anyone's mind that Microsoft has been marching forward with its cross-platform strategy over the past months. The company ...

First Major Command-C Update Brings Clipboard History And More
Version 1.1 also gives users the ability to share clipboards between Macs.

Take full control of the Windows clipboard with CLCL
If you’ve been using PCs for longer than 5 minutes then you’ve almost certainly run into the limitations of the Windows clipboard, and tried ...

Resources last updated: 2/11/2016 3:12:22 PM