|
CString str = _T("abcde");
CString s = str.Mid(2, 3);
s = str.Right(3);
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
you certainly not searched the web that much...
MSDN give you this : CString::Mid()[^]
CString s1 = "abcde";
CString s2 = s1.Mid(2, 3);
|
|
|
|
|
There seems to be an echo in the C++ forum today..
--
Mit viel Oktan und frei von Blei, eine Kraftstoff wie Benziiiiiiin!
|
|
|
|
|
i'm trying to delete the posts, but CP seem to have problems today...
at last, done ! roger
|
|
|
|
|
You get your answer with CString::Mid but maybe its helpful for you
<br />
extract right part from String<br />
CString str_T("abcdef");<br />
CString s;<br />
s=str.Right(3);
<br />
extract left part from String<br />
CString str_T("abcdef");<br />
CString s;<br />
s=str.Left(3);
<br />
And CString::Mid extract middle part from string
|
|
|
|
|
hi
Iam devolopping one project in that ,when i dial the numbers from command lines ,in this moment it is fine.When we give another number to dial from command prompt it didnt take that number,it exists in previous state only.please any body help in my project.
#sanroop#
|
|
|
|
|
Sanroop wrote: it didnt take that number,it exists in previous state only.
Can you post some source code?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
let me know whether you want to send message to an exe by code ?
if it is so use BroadcastSystemMessage(...)
Rinu Raj
|
|
|
|
|
thanque for u r reply ,we pass the string from command line
#sanroop#
|
|
|
|
|
Sanroop wrote: when i dial the numbers from command lines...
Your question is a bit too confusing to understand. What does "dial the numbers from command lines" mean? What exactly are you trying to do?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Could you be more specific
|
|
|
|
|
Hi there, I'm in need of help to move the mouse to any position on my program's window. I got help, and was told to use the SetCursorPos() function. This moves the mouse to a point on the screen and not on my window. How can I get my window's top and left position so that I can use
SetCursorPos(window.left + x, window.top + y) //x and y are the position on
//my program's window
?
Are there better ways of doing this?
thanx...
KOM UIT DAAAAA!!!
|
|
|
|
|
first take ur window's cordinate using the GetWindowRect function.then move the cursor to that position.
CRect WindowRect;
GetWindowRect( WindowRect );
SetCursorPos(WindowRect.left + x, WindowRect .top + y)
nave
|
|
|
|
|
You may use GetWindowRect(...) to Get the window co-ordinates
Also ClipCursor(...) to confine the cursor to a rectangular area on the screen
Rinu Raj
|
|
|
|
|
Grimes wrote: mouse to any position on my program's window.
Try ScreenToClient(LPPOINT lpPoint);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
You want to use the function GetWindowRect to get the window coordinates. From that you can then call
SetCursorPos and apply the correct offsets.
x_coord+=x_offset;
y_coord+=y_offset;
Search for GetWindowRect on google and it should take you to the msdn page for that function.
Chipper Martin
|
|
|
|
|
Gday everyone,
Please help me.
How to read and write a pointer of character to a file in C?
Thanks in advance.
Eric
eric
|
|
|
|
|
You don't write the pointer to a file. You write the data which the pointer points to.
char* string = ...;
FILE* pStream = fopen("file", "w");
fwrite(string, 1, strlen(string), pStream);
--
Mit viel Oktan und frei von Blei, eine Kraftstoff wie Benziiiiiiin!
|
|
|
|
|
Hi,
I'm trying to write a program that can copy a file URI into any window by drag and drop.
The problem lies in C++, so far i've found only two methods:
GetLogicalDrives and GetLogicalDriveString.
In .NET there is this eqivalent:
Environment.GetLogicalDrives and
DriveInfo.GetDirectories.
Im wondering if there is any eqivalent in Visual C++
Thanks
Tom
|
|
|
|
|
What does a URI have to do with GetLogicalDrives() or GetLogicalDriveString() ? How does drag/drop relate to all of this? Please explain what it is that you are after.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: What does a URI have to do with GetLogicalDrives() or GetLogicalDriveString()? How does drag/drop relate to all of this? Please explain what it is that you are after.
Ok, My app is supposed to display a tree view of the file system, you can then select the file you want. Then you drag a cross hair like in Spy++, to the window and it will copy the absolute path of the file to the location you dragged the crosshair to.
I know that can be done without an app been written, but in some windows that don't support drag/drop operations, eg. Lan Connections Screen in Internet Options.
Dragging the cross hair over the selected area will retreive the handle of the control and send a WM_PASTE message to that control and paste the file path into the selected window.
Tom
|
|
|
|
|
As soon as you start dragging from your tree control, are you sending a TVN_BEGINDRAG notification message?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: As soon as you start dragging from your tree control, are you sending a TVN_BEGINDRAG notification message?
I don't think you understand!
You don't drag from the tree view, you drag the crosshair like in Spy++ (See The Window Finder Article)
They'd be a cross hair in the bottom of the screen, then when you drag the cross hair onto the window, eg. Textbox , it would copy and paste the file path from the tree view into the window control that you dragged the cross hair.
Thanks
Tom
|
|
|
|
|
So what exactly is the problem? Implementing the crosshair? Figuring out what is selected in a tree control? Setting the text of an edit control?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: So what exactly is the problem? Implementing the crosshair? Figuring out what is selected in a tree control? Setting the text of an edit control?
The exact problem is implementing the drag and drop procedure so it works out of the current program, the cross hair needs a function that returns the window handle or control handle, so I can send a WM_PASTE message to the necessary control.
Tom
|
|
|
|