C Board  

Go Back   C Board > Platform Specific Boards > Windows Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 10-27-2006, 12:44 PM   #1
Registered User
 
Join Date: Oct 2006
Posts: 8
WM_COPYDATA and mutex selecting multiple files

Hope someone knows the answer. I am using the following method to select multiple files and folders in explorer and use them as input to my program:

* Create unique mutex from first program instance.
* When next call (next file/folder) is made check for mutex and if it is already there use
a sendmessage WM_COPYDATA to copy the file/foldername to the first instance.

Now when I choose 16 or more items in explorer I get a windows warning message that it may take a long time and the computer may respond slowly (this message is triggered before my program is called, so it looks like a default message when selecting 16 or more files and folders and use them as input to one program). I can set a check to prevent the warning message next time, but I see a lot of programs where I can select 16 or more files at once without windows showing me a warning message.

Anyone got an idea how to prevent this message maybe in code?
I integrated my program in the explorer menu with shell command in the registry.

As far as I know this is the most easy solution for selection multiple files and folders in explorer and use them as input to a program. If there are better solutions I would be happy to hear them.
gh0st is offline   Reply With Quote
Old 10-27-2006, 01:54 PM   #2
CSharpener
 
vart's Avatar
 
Join Date: Oct 2006
Posts: 5,336
My guess - the problem is how many instances of your program windows has to open - one per file...

You can try to use DDE - so only one instance for the first file will be opened... (look at file associations for .doc if word is installed for example)
About every additinal file explorer will send a DDE message to the first instance of the program that can process it...

More info can be found here for example: http://www.angelfire.com/biz/rhamini...c.html#HowOpen
__________________
If I have eight hours for cutting wood, I spend six sharpening my axe.
vart is offline   Reply With Quote
Old 10-27-2006, 02:22 PM   #3
Registered User
 
Join Date: Oct 2006
Posts: 8
Thanks for your info. I want my program to handle all files and folder types and not associate it to a specific extension. I'm going to look into DDE now.

Thanks
gh0st is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump


All times are GMT -6. The time now is 06:11 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22