3
Contributors
10
Replies
11
Views
11 Years
Discussion Span
Last Post by Han1977
0

Yes. We understand what you mean. But where do you have the problem?

I want to use the text that was put in the textbox(the file location) to be used in the DeleteFile function.

DeleteFile(FileName)

In FileName I want the text that the user input to be used. Just like I would use cin.

0

"The GetWindowText function copies the text of the specified window's title bar"

Thats not what I want.

0

If you read further it says that if it is a control it copies the text of the control.

You're right. lol. I over read. Sorry.

0

Quan Chi2: Okay, Im still confused. Can anyone else help?

How about this :

     len = GetWindowTextLength(GetDlgItem(yourwindowhwnd, yourtextboxtID));
     if(len > 0)
     {
         int i;
         char* buf;
         buf = (char*)GlobalAlloc(GPTR, len + 1);
         GetDlgItemText(yourwindowhwnd, yourtextboxID, buf, len + 1);

         string filename = buf;
         GlobalFree((HANDLE)buf);
     }

Edited by pyTony: fixed formatting

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.