|
Why do you need to modify the .rc file?
Why not use the dialog editor to move the control?
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Dear Friends !
Can anyone help me out !
i get friendly name while inserting the device into system. No issue in it.
But i want to get the friendly name of the removable drive by giving the drive letter
for example
if i give G: then it should give the device inserted in G as "Trancend ..."
I hope some once can do in clever !
thanks in advance
Regards
.....Jack
|
|
|
|
|
|
Thank you for the solution.
but This returns only the volume information.
it teturns the name of the volume not a friendly name of the device.
i checked with the above WINAPI function it just returns the volume name
for example: the device inserted is "Trances 4GB Removable..." but it shows the volume name "Jack"
if i am wrong sorry and i hope when we insert the removable device it mounds with the device partition. that is the reason While we use WM_DEVICE_CHANGE enables to track the device and even to get the friendly name using GUID
But i am very scared how to get the friendly name of the removable drive using the drive name.
i am trying...
thanks...
Regards
.....Jack
|
|
|
|
|
Bet you can get that using WMI.
I use WMI Explorer[^] to explore what information there is in the WMI database for my system. I just plugged in my flash drive, and it seems to have a 'friendly name' in the Caption property of its Win32_DiskDrive instance.
This VBScript (you can run it from the command-line with cscript filename.vbs ) can be used to retrieve that - the C++ equivalent is straightforward, but long-winded.
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set drives = objWMIService.ExecQuery("Select * FROM Win32_DiskDrive")
For Each drive in drives
WScript.StdOut.WriteLine drive.caption
Next
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks a lot !
My actual requirement towards this issue is this:
I am logging the file activities in Win32 DLL with the following details Create/Copy/Delete/Move details in the USB Drive - done
Along with Removable Drive Friendly Name – doing
I am not much familiar with system side Activities.
I hope we can use the WMI in Win32 dll applications . I will try it out.
And If u have any idea on this help me out.
Thank you.
|
|
|
|
|
jacob raj wrote: I hope we can use the WMI in Win32 dll applications .
Yes, you can - it's just a set of COM interfaces and objects, so is callable from C++.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello Friends
I was using findfirstFile to find files in a folder but now i hv to search in subfolder.Do u know any solution or any other function?
Thanks In Advance.
Regards
Yogesh
|
|
|
|
|
|
You need a recursive function to find the files within sub-folders.
Check if the dwFileAttributes is FILE_ATTRIBUTE_DIRECTORY and if it is, pass its name as the root folder and call the same function from within.
The function signature would be something like this.
int RecursiveFind(TCHAR* lpFileName, TCHAR* lpRootFolder);
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
FILE_ATTRIBUE_DIRECTORY is there but i m not getting,
Here is the scenario:
char defaultPath[256]="C:\\Program Files\\sample\\";
char filename[256]="abc.max";
WIN32_FIND_DATA FindData;
HANDLE hFind;
hFind = FindFirstFile( filename, &FindData );
m i using like this.But i m not getting.
|
|
|
|
|
You can use of FindFirstFile/FindNextFile in a loop.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
With MFC, use something like this:
void EnumFilesRecursive()
{
CFileFind ff;
BOOL bWorking = ff.FindFile("d:\\*.*");
while (bWorking == TRUE)
{
bWorking = ff.FindNextFile();
if (ff.IsDirectory())
{
if (ff.IsDots())
continue;
EnumFilesRecursive(ff.GetFilePath());
}
else
{
}
}
return;
}
|
|
|
|
|
Using ADO ,records could be deleted using Delete(adAffectCurrent) or SQL queries.
Which one is more feasible and faster to process ?
|
|
|
|
|
Why don't you make a test?
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]
|
|
|
|
|
As CPallini suggested - benchmarking...
The other factor to consider is this - which is simpler for you? - teh less time and effort you (have to) put in, the more likely the code is correct, and the more time you've got to do other stuff that matters!
|
|
|
|
|
Just adding to Carlo and Stuart's replies,
Usually if something is neatly wrapped up into a class and methods are exposed to you, it would come with a lot of conveniences like ease of use, error checking, etc., (most importantly prevents you from shooting your own foot). On any normal day, this must be a reasonable trade-off with the performance overhead that would impose (should take very little time more than the code what you might write - if written well).
I'd personally go with an existing class and use its methods, but that again depends on the requirements.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
hello sir/madam,
we are developing project on screen capturing and lock mouse and keyboard of client computer in JAVA. we are able to capture multiple client's screens. but in java , we didn't find any code to lock mouse and keyboard. so, i think it is possible to develop that code in C++. so can u give me some code example to lock mouse and keyboard so that i can call that functions of c++ in JAVA through JNI.pleas reply me.please sir/MADAM.................
|
|
|
|
|
You may use ClipCursor()[^] to lock the mouse cursor within a specific rectangle.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
use ANSI key or window API in CPP.
|
|
|
|
|
i don't know window programming in cpp. so can u give me some code example or hint in win 32 in cpp sa that i can call that function in java through jni?
|
|
|
|
|
Hi All
How can i know pen drive is formated through code?i am getting information of connection disconnection.But when pen drive is connected and then format,then how can i know pen drive is formated?Plz help me.
|
|
|
|
|
How can I know whether the path selected is a drive name of any other folder . I have a xml whether user can edit it and enter a path. User can enter any path in it like C:\, C:\\\\, or C:\test\abc or anything. I am getting a problem with path comparision I have to treat C:\\\ as C:\ only, Any api to check whether selected path is a drive name. So that I can consider C:\\\ as C:\
Thanks..
|
|
|
|
|
See _getdrive api. or See if PathFileExists suffices your needs.
You can trim/remove the extra slashes
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
[Add] You will need to trim any additional '\' characters on the right side of the string, before passing it to the following API. [/Add]
BOOL PathIsRoot()[^] returns TRUE if the given path is the root of a drive.
You will need to include shlwapi.h and link to shlwapi.lib to use this API.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|