473,657 Members | 2,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

copying window text....please help! this language is insane.

i have an application that allows you to Select some text in a window,
but no option to Copy it to the clipboard (nor does Ctrl-C or
Shift-insert work, or right click etc..) i want to get these values
somehow.

below is the best posted method i have found online.
if anyone can elaborate, as to how to implement such message passing
(as a novice) i would be thrilled. i am using and old visual c++ 4
compiler with
an example program that simply creates instances of notepad-like
windows.
(to test the idea)
i can't find examples on how to implement message handling at the
simplest level. specifically what/where do i insert into a message
map, and where does the code go that 'listens' for this change in
window focus. (or will the below idea even work)
thanks.
chris

"
Assuming that you can get the window handle of the edit control
you are concerned with, I would think that all you need to do is
send a WM_COPY message to that control. That slaps the selected
text onto the clipboard:

SendMessage(hwn dEdit,WM_COPY,0 ,0L);

You should be able to get the edit control's handle by calling
GetFocus() to see which window has the keyboard focus when your
button on the titlebar is pushed. I can see the problem with
this, though...when your application is activated by a button
push, YOUR app will have keyboard focus. To get around this,
you can process the WM_SETFOCUS message in your app to see which
window you are taking the focus FROM. This should be the edit
control with the selected text.
"
Jul 22 '05 #1
3 2938

"chris kramer" <ze******@yahoo .com> wrote in message
news:88******** *************** ***@posting.goo gle.com...
i have an application that allows you to Select some text in a window,
but no option to Copy it to the clipboard (nor does Ctrl-C or
Shift-insert work, or right click etc..) i want to get these values
somehow.


What language? You are talking about Win32 API programming not C++. You
would face exactly the same issue if you were using another language like
Pascal or assembly.

Please take this question to a group where is it relevant, like
comp.os.ms-windows.program mer.win32. Your question has no C++ content.

[snip]

John
Jul 22 '05 #2
john - you are right..
was overwhelmed and slightly drunk when i gave up and made a plea for
help :)
i have gotten closer - i can shut down a window in VB using WM_CLOSE
message.
(i gave up on using visual c++, it is absurdly complex)
WM_COPY doesn't seem to work though. If anyone knows anyone that can
get highlighted text from another window that won't allow direct
copying, i'd love to know how. (ze******@yahoo .com)
sorry about posting to the wrong place.. thank god Visual C++ is not
something the world accepts as a standard. i think it is a complete
nightmare.
Jul 22 '05 #3
"chris kramer" <ze******@yahoo .com> wrote...
john - you are right..
was overwhelmed and slightly drunk when i gave up and made a plea for
help :)
i have gotten closer - i can shut down a window in VB using WM_CLOSE
message.
(i gave up on using visual c++, it is absurdly complex)
WM_COPY doesn't seem to work though. If anyone knows anyone that can
get highlighted text from another window that won't allow direct
copying, i'd love to know how. (ze******@yahoo .com)
sorry about posting to the wrong place.. thank god Visual C++ is not
something the world accepts as a standard. i think it is a complete
nightmare.


Please don't apologise for off-topic, post in the right newsgroup
instead: comp.os.ms-windows.program mer.

Thank you.

V
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3641
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore my settings if my profile became tampered with or corrupt. Is there any sample code available out there? -Robert
2
3869
by: Matt | last post by:
I want to know how to submit the form data to a modal dialog window? The following is page1.asp, and when the user clicks submit button, it will post the form data to page2.asp by opening a new window. But I want modal dialog window, any ideas?? <form action="page2.asp" method="post" target="_blank"> <input type="text" name="username"> <input type="submit" name="submit"> </form>
8
1915
by: brian kaufmann | last post by:
Hi, I'm new to Access and this may be a basic question but I would appreciate it if you could let me know how to do this: I've created an Access table and would like to insert a column with the field name "name" and to put the same word "unknown" down all the rows of the column. How could this be done both in the design mode and in sql code?
3
1856
by: Tom van Stiphout | last post by:
I have written some code to export all objects to text files, and to import those files back into a new database. Hopefully this will eliminate some forms of corruption. The icing on the cake would be to copy the relationships window as well. So far, I was trying this code below, but it doesn't work. First off, I'm surprised that on several MDBs the count of objects is 2. I was expecting 1 because an MDB can have only 1 relationship...
5
2334
by: Son KwonNam | last post by:
I found some information about copying text to clipboard in IE, but it does not preserve html formats. Is this possible to copy some html area, and when I paste it into MS Word or Excel, I could see the same fonts, table, colors, blah, blah... on Word or Excel?? Regards, KwonNam.
0
2032
by: hcuellar | last post by:
Hi. Please I need your help for this: After a database query, a table is created with a cell for each information retrieved, and for each record, two buttons, and second one have besides it an text imput field to asign this, open a mail client to send a mail to some people. All this, is made in php. In other words, user logs in, a window is open (after query) showing new appointments (set in other office), and each new appointment...
1
1393
by: Headbanger | last post by:
Hello, I would appreciate any help or suggestions. I am not a programmer. I need a large amount of non-personal data from a form to be transfered to a script in a popup. Client-side scripting only. This worked well (below) but the form contains too many characters and this method is limited to 2kb. <script type="text/javascript"> function formtransfer()
1
1403
by: anonymousstar | last post by:
Hi Everyone, I am creating a search facility that holds titles and SKU numbers. When the results appear in a 2 column table I would like the title to go into an input (readonly) field and the SKU to go into a different input field. I have the code below to help visualise what I am trying to do. I think what I want is similar to a calendar where you can select the date you want and it appears in an input field - this I can do, but can't...
1
3592
by: soms2m | last post by:
HELLO ALL, I want to fill the parent window height with respect to the sub window height which is loading using ajax (mootools). For example if the parent window height is normal and the loading child window height is 1200px (saying), when the child window load the height of the parent window changs but the backgorund color which is given 100% not fill the parent window. I have given my example codes, please give a solution as soon as...
0
8407
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8319
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8512
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6175
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.