Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying Dialog problem

Status
Not open for further replies.

gosth98

Programmer
Joined
Jan 9, 2004
Messages
1
Location
MX
Hi, All

I got a problem, I want to know how can I get the file name when the Copying Dialog appears, I'm using FindWindow and a Timer to know when the copying dialog appear but I don't know which API call could I use? and how to use it?, sorry but I'm new on it...

Thanks to All
 
Hello, gosth98. Could you point out what should your app be doing. I suspect there would be an easier way to do what you want than the one you've chosen. Probably you want to do the so-called shell extension. But you should be more specific on the purpose of your app rather than on what you cannot do in this case. I've checked this thread for e-mail notification so I'll be around when there's activity.

regards,
Ivan

A well-defined problem is half solved.
 

gosth98, have you read FAQ222-2244 yet.

I have never tried it with the dialog that you mention but the GetWindowText API will retrieve text from other windows.

Good Luck

 
gosth98, I don't actually think you got me on this one. I am asking you to point out the general idea of your app because there may be a way for the OS to give you the name of the file directly, not by using hand-crafted techniques and tricks. Actually the file name in the copy dialog is a label and not all labels have a handle by which you can get their value. Try using WinSight32 (comes with Borland Delphi) or Spy++ (comes with MS VC++) while the copy dialog is on-screen and try to find if the label with the file name has a handle. If it does what you want to do is possible but if not - you should probably try to explain your app's idea in more detail. Again I suppose you need to use shell extensions. I read the FAQ and I don't think I violated any of the rules there. What I stand for is the fact that there is a chance that you can't get the name of the file being copied the way you want it because the OS won't let you. That's it. I am sorry if I sounded rude - believe me I didn't mean that at all.
Code:
int GetWindowText(

    HWND hWnd,	// handle of window or control with text
    LPTSTR lpString,	// address of buffer for text
    int nMaxCount 	// maximum number of characters to copy
   );
I agree that GetWindowText can be used for the purpose but first you have to find the value of hWnd. The problem is that your label may not have a handle...

good luck,
Ivan

--------------------------------------
A well-defined problem is half solved.
 

gosth98, have you read FAQ222-2244 yet? Did you get your problem solved?

Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top