|
hi DavidCrow,
actually this programming is a part of my project.so don't be confuse.I am now telling you about my project.Actually i have a C program which can read/write a file of extension .docx.means that c program can read/write the *.docx.so first i have to give input to that program .i mean that i have to give name and location of the *.docx file.So for its input i want that when i simply one click on any *.docx file it would be input for that program.Its my project.now i am thinking that when i simply one click on any *.docx file i would be able to know its location by C programming. I think that it should be now clear to you that what i want to ask you...
|
|
|
|
|
ravi 12 wrote: so first i have to give input to that program .i mean that i have to give name and location of the *.docx file.
Where? How?
ravi 12 wrote: ...when i simply one click on any *.docx file...
From where? Windows Explorer?
ravi 12 wrote: ...i would be able to know its location by C programming.
Do you have a WinMain() function?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi DavidCrow,
That *.docx file can be anywhere in my computer.So i want when i would be that location and if i simply one click by mouse, the C program which i mention early starts read it contain.Don't be confuse.
Suppose that file is in D:\files\my.docx location I want to do is that when i click on my.docx file that C program starts reading its contain.If it is in another location the same case would be happaned there.
Ya i have winmain() function and i also include windows.h #include<windows.h>.but further programming related to mouse , i don't know .So please tell me that part of program in detail.please
|
|
|
|
|
I told you before: create a file association in explorer. Name your program as the handler for .docx files. Then double clicking will load your program with the filename as an argument, just like clicking a Word-document start Word with the document opened
Rozis
|
|
|
|
|
Hi Rozis,
Thanks for your suggestion...
|
|
|
|
|
Alright, you asked for it!!!
You ave to traverse the file system, looking for the file you're after. (Recursion is the most oft used approach)
You'll need the functions FindFirstFile and FindNextFile.
'All' you have to do is start out in the root directory of any drive and do a FindFirstFile Followed by a FindNextFile (looking for *.*)
until you have retrieved all of the filenames in the current directory, or found your target.
Then, you have to check the file attributes to determine which files are plain files and which files are actually directories.
You must then remember a list of those directories, and one by one scan the contents of each of them.
Simply repeat these steps for all files on a drive, or until the file is found.
Here. This'll list the contents of D:\ (without traversing any directories)
#define UNICODE 1
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
WIN32_FIND_DATA foundFile;
HANDLE firstFile;
WCHAR* searchString = L"D:\*.*";
firstFile = FindFirstFile(searchString, &foundFile);
do {
printf("%S\n", foundFile.cFileName);
} while (FindNextFile(firstFile, &foundFile));
return 0;
}
|
|
|
|
|
Hi,
I want to know about mouse programming.Actually i want to do is that there is a *.docx file in my computer(windows-XP)and i have a c program which can read the content of *.docx file.so first i have to give input(the location of the *.docx file) to that C program then it can read the content of that *.docx file.I want that when i click on *.docx file then it will be input for that C program.I want to ask you also that can i find file location by using mouse programming?So how can i do this???
|
|
|
|
|
May I ask you politely to avoid shouting?
ravi 12 wrote: Hi,
I want to know about mouse programming.Actually i want to do is that there is a *.docx file in my computer(windows-XP)and i have a c program which can read the content of *.docx file.so first i have to give input(the location of the *.docx file) to that C program then it can read the content of that *.docx file.I want that when i click on *.docx file then it will be input for that C program.
I strongly suggest you to read articles in this series [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Why do you write in BOLD and what is "mouse programming"?
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Please don't keep repeating your question, i think you are posting it at least the third time. You already got an answer from 3 different people (file assiciations), if this does not give you the solution you are looking for you should try asking differently, preferably giving more detail about what exactly you wish to do. Also mentioning that file associations is not what you want could help avoid getting this same answer over and over again. Good luck...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
thanks for your reply. i cannot continue with my code for the reason that i dont have enough knowledge on it. My code is successful if i will not use radio button in getting the reasult but when i used a radion button to connect to the command button i cannot successfully link to it coz i dont know the code on how to do it. I just need a sample code for my reference...can u send sample code to connect the radio button to a command button please...?
Neil
|
|
|
|
|
I believe we had given a solution for this.
do you want to pass the value that is assigned to the radio button to the command button?
if that is the case create an event for the radio button and inside the function assign a value(say .10 which is 10%) to a global variable. Then use this global variable in command button.
Hope this helps you.
|
|
|
|
|
i will try sir but if still i cannot please dont stop helping me...
thanks a lot.
neil
|
|
|
|
|
Hi all,
I am making an application using vc++, when the process complete I need to boot the machine and at booting time it ask for disk check for FAT32 volume. I dont want that user will see this check disk black screen. So I am trying to check the disk with my code before machine boot.
Is there any win32API or any utility that checks disk so that I can implement it in to my code?
I dont want to use Chkdsk Method of the Win32_LogicalDisk Class.
One more option that I have to execute command chkdsk command on command prompt. But I am looking for any better option.
Thanks
Regards
M Chauhan
|
|
|
|
|
Do u want to check the disk before system login, right?
Величие не Бога может быть недооценена.
|
|
|
|
|
Yes.
I want to do the same thing with my code (at running stage of machine) that OS do itself at booting time.
|
|
|
|
|
There's a reason the OS does this at boot time - when the OS is fully running, the disk is potentially changing all the time, invalidating the check. And what if there's a problem in a loaded file?
Why is the OS doing this all the time? Mine doesn't! And which OS...
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need cotract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
assume table [User] has 2 fields: [ID] and [Name],
User ID in records are:
0,
1,
2,
5,
6,
12,
...
The minimum ID allowed for adding a new user is 3 now.
How to get the minimum ID by SQL?
|
|
|
|
|
May be you can move your post to General Database forum[^] where it is more likely to get answered.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
I want to drop an image from Internet Explorer onto my dialog and capture the URL of the image, when I implement OnDropFiles(WPARAM wParam, LPARAM lParam) ,but only can get a local file name from DragQueryFile without url from IE or other browser.who can help me how can I do this?
I also seach one article Drop images from IE[^]on codeproject seem do this ,but I also cannot do for the arguments I do not know how to get?
Thank you for any advice.
Regards,
|
|
|
|
|
Help
|
|
|
|
|
There is an application, i sadly can't recall the name, but maybe you can google it up, that will list you what data formats are "contained in a drag-drop operation", so to say (all you have to do is grab an image in your browser and drop it onto the window of this app). You probably won't be able to gain the URL from the FILEDROP format BUT using this app (it's free btw, could be that it is even somewhere here on CodeProject) you could check what other formats the browser gives to you when you drag a picture and one of these might just be what you need. If i can remember the name of this app i will tell you...
p.s.: Are you handling WM_FILEDROP? If so, i recommend you rather use the OLE way, check this[^] article.
And hey, that article uses the proggie i mentioned before, it is called "ClipSpy". What are the odds...
[EDIT]
So i checked it myself dragging from FireFox, the drop contains the URL in many formats, seems like it has CF_TEXT and CF_UNICODETEXT or a format called UniformResourceLocator or UniformResourceLocatorW and some other formats which all contain the URL (http://www.whatever.com/pics/picturename.jpg for example).
[EDIT]
I just checked it with IE too and it seems to contain only UniformResourceLocator for the URL so that's your best bet.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
modified on Wednesday, July 29, 2009 4:13 AM
|
|
|
|
|
Code-o-mat,Thanks for your reply.I really want to gain the image URL from browser
Handing WM_FILEDDROP can only get the local file name,so I want to how can I get the URL or other informations which can help me gain URL from this Message ?
OLE seem can do this,Let's try
Thanks again for your answer.
|
|
|
|
|
I'm not sure now if you are asking how to do it or just saying that you will do it that way, but i give some pointers. If you check out that article i have given you you can learn how to make your window a drop target the OLE way. To accept the URL data all you have to do is to look for a different clipboard format than CF_HDROP. Thanks to ClipSpy we now know that what you need is the "UniformResourceLocator" format, you can use RegisterClipboardFormat[^] to gain the identifier for this format and then you should use that ID instead of CF_HDROP. Also thanks to ClipSpy we know that this format seems to be nothing else but a string containing the URL, so if you look at the article again and check out what CMyDropTarget::OnDrop does you should not have too much trouble changing it to gain the string.
Does this all help?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Yes,Code-o-mat,Thanks,I thinks those enough can help me out of trouble and I will follow this tomorrow
Thanks again and sorry for my English.
BTW:Your reply is so fast
modified on Wednesday, July 29, 2009 11:01 PM
|
|
|
|