|
In the description of SetWindowText(), it states that "it cannot change the text of a control in another application". Does anyone know how to do this, given the handle of the window control ? Thanks (in advance !!)
Doug
|
|
|
|
|
It shouldn't be possible to write to another application's textbox because your text buffer is located in your program's address space, not their's .
You can check the following article:
http://www.codeproject.com/threads/winspy.asp[^]
There are other articles as well.
this is this.
|
|
|
|
|
Thanks Khan++ for your reply,
The article that you referenced is going to take "some reading" !! I DO hope that there is some way to write to another app's controls as otherwise my current idea is "stuffed" !!!
Any other replies/suggestions to my problem would be welcomed !!
Doug
|
|
|
|
|
As per SetWindowText documentation:-
"To set the text of a control in another process, send the WM_SETTEXT message directly instead of calling SetWindowText"
Vipin - MVP
|
|
|
|
|
Hi Vipin,
I use VC++ Ver 6.0 and can't see this statement in SetWindowText(). What version do you see it in ?
Doug
-- modified at 17:10 Monday 26th December, 2005
Just checked MSDN and I DO see that statement - why doesn't 6.0 include it ??
Anyhow, great relief, as the other possibilities are pretty complex !! Thanks everyone !
|
|
|
|
|
Hi I have a problem.....
Actually i wrote a code which runs in service and hides in tray icon when minimized or closed...
When iam testing it by executing, its working , after when i restart the system to make run in service..
It is visible in service ,But No tray icon is Visible
If i keep any message Box in OnCreate() function ,
Then it's Working ...
Please help me...............
Thanks in Advance
|
|
|
|
|
I think it is because the service runs before any user is logged-on to the system, so when the serivice is setting its icon, the system tray has not been spawned yet.
I would suggest that you reset the tray icon every minute or so, so that it can be seen. Also, if explorer.exe crashes, all icons disappear. If you reset your icon every minute or so, your icon will remain in the tray.
this is this.
|
|
|
|
|
Try making the service Interactive service.
Vipin - MVP
|
|
|
|
|
vipinasda wrote: Interactive service.
Happy christmas friends. May the Love of My Lord and Saviour Jesus bring forth Joy and Happiness into your life too.
<marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" hspace="2" vspace="2">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Owner drawn wrote: vipinasda wrote:
Interactive service.
I believe he is right in his comment
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Actually, I used a class from here in my BugReporter[^]app to aid in putting the icon in the system tray. That worked great! But I also got the problem that when Explorer crashed and came back up, my icon was no longer in the tray. I can't remember off the top of my head, but you can register a message that will notify you of when the system tray/taskbar is being re-instantiated or redrawn. Handle that message and then redraw your icon. I think that's better than checking every minute. If you'd like to look in the BugReporter project, I think it's in the CMainFrame class that I did this.
My articles
BlackDice
|
|
|
|
|
jakib wrote: Please help me...............
For that you have to create Desktop interactive service.. you have to do that by two way :-
Manual Way:-
Right Click on Service-> Choose Properties menu item-> then when Property Sheet get displayed-> choose Log On Tab-> check Allow Service to interact with Desktop check box.
Coding Way:-
while installing service using CreateService api pass SERVICE_INTERACTIVE_PROCESS as one of parameter
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hi
i need to write a control that has to be plugged into unmanaged as well as managed UI applications,...
Control Description:
the control is going to be like supporting browsing and searching objects etc,..control have to have mostly UI stff in it(will have some buttons/edit boxes trees and list boxes inside it)....that will have to adjust its controls according to its container,..should support drag and drop from control to the application plugged into that can be managed or unmanaged application...
so should i make an ActiveX control or .Net Windows Control, ?
would like to have your comments on it,..backed up with pros and cons...etc..
Thanks all
Muhammad Ahmed
Ahmed
|
|
|
|
|
I think it depends on who you are building it for. If the client is stupid, and thinks .Net is new and hence better, then create it in .Net. However, I think un-managed apps will have problems with it. (Not sure). And I am not sure, even if it is possible to support the things you need. .Net is new, and you won't find (m)any experts in it.
If on the other hand, you are serious about creating the control, that is easy to use, easy to modify, can be controlled to the finest of details, is real-fast, then go for Un-managed. And you can get help from the Gurus if you ever get stuck.
1- It can contain web-browsers, if you need them.
2- It can contain buttons, list boxes, etc.
3- Can adjust its position, size.
4- Can support drag-drop. (Not sure how .Net apps will behave to that).
this is this.
|
|
|
|
|
Hi to everyone. I write data to a file without problems using CFile and CArchive classes, but the data write in a single line in the file.1) I want to be able to change line in the file. For example, the record Last Name, First Name, Hobby, Age should write in one line.The next record (which append) should become in new line, as it appears delow:
DeliyiannisDimitrisReading23 (First record in the file)
PapadopoulosJohnBasketball20 (Second record in the file)
... ... ... ...
... ... ... ...
2)Ηow can I access diffirent records? For example, if the user enter John OR Papadopoulos OR Basketball OR 20 in an edit box then in diffirent edit boxes display Papadopoulos John Basketball 20.
Please, help me. Thanks.
|
|
|
|
|
1-
If you writing data in the form of text to a textfile, then you can append "\r\n" to every line.
However, if you want the same program to read back the records, then you would be having problems, because you would have appended "\r\n" Carriage-return + Line-feed pair to the data yourself.
2-
To read the records back, read the file line by line like using CStdioFile::ReadString(...). Then parse the text yourself to obtain the values.
this is this.
|
|
|
|
|
Hi ! everyone.
I have to build an editor just like a VB editor in vc++.
please tell me how to go about it. It should hav all the buttons in VB like text box combo box and the buttons should have the properties like font etc. new files and forms should be opened and user should be able to write and save it.user should be able to use the buttons provided and make a form.
Please help me !!
Thanks and regards,
pooja
|
|
|
|
|
I think COM will be the way to go as far as designing is concerned. I think that when you are actually designing the form, that "un-named language" IDE is actually running the form in some way.
Create an MDI project, then the rest will be COM work; like resizable controls at runtime etc. Even the form itself will be resizable.
If I had to do it, I would start writing the controls; starting with the form, then the other controls.
And in which form do you want to save it? That "un-named language" IDE saves forms as binary files. So you will need to do some research on its format.
this is this.
|
|
|
|
|
Can a ANSI-C compliant compiler compile successfully a code containing functions embedded in structure?
hitherto shall thou come but not further thee
|
|
|
|
|
I think C does not support functions in structs. But in C++, structs and classes are very similar, and both can contain functions.
So for a .C file, functions within struct will not compile.
this is this.
|
|
|
|
|
I'm having a table in oracle 9i DB. One of the column(VARCHAR) in this table is stored with unicode string (chinese/japanese characters) .
Problem is if I take a backup of this table using the adodb.recordset.save("file") to file and lattter when adodb.recordset.open("saved file") the chinese character is lost in between any idea why this is hapenning ?
|
|
|
|
|
Hi All
1.I using MFC in my application , and i need to type on screen the preformance of the CPU in runtime.
How can i know the preformance ? what API can i use ?
2.I need to show some FORM (window) that i have in my app. on top, how can i do it ?
Thanks for any halp.
|
|
|
|
|
1-
GetPerformaceInfo(...)[^]
This function get you the needed info, but the requirements are high:
Client: Windows XP
Server Windows 2003
You can also use:
GetProcessTimes(...)[^]
You could enumerate all the processes using EnumProcesses() api, and use GetProcessTimes(...) with it.
2-
You could use:
MFC: SetWindowPos(&wndTopMost,0,0,0,0,SWP_NOSIZE | SWP_NOMOVE);
Win32: SetWindowPos(hWnd,HWND_TOPMOST,0,0,0,0,SWP_NOSIZE | SWP_NOMOVE);
this is this.
|
|
|
|
|
|
Hi
Does anyone know how UNDO operation is handled in explorer. Suppose if a file move is perfomred and undo is done. The file is restored to the original location.
Thanks in advance.
|
|
|
|