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.

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

Thats not what I want.

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.

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 3 Years Ago by pyTony: fixed formatting

This question has already been answered. Start a new discussion instead.