Click here to Skip to main content
12,818,964 members (28,531 online)
Rate this:
Please Sign up or sign in to vote.

Im working on Windows Embedded and writing in C++.
At the moment I'm writing a program to rename a harddisk from a driver. Im renaming the hard disk right after the first boot of the system.
The program is working fine. After the program is finished it has to reboot my computer.

But here is the problem:

The program has to check whether my system settings has changed or not.
If they changed, i have to wait, until the Dialog "Systems Settings Changed" poped up and restart.
Otherwise,I don't have to wait.

By now i found out, that windows is using the newdev.dll for installing devices.

Can i check somehow if the newdev.dll is in use?

I tried it with CreateFile() with READ and WRITE.
HANDLE hwnd;
std::cout << GetLastError();

In addtion I tried to load it with LoadLibrary. But that failed too.

hwnd= LoadLibrary("C:\\Windows\\System32\\newdev.dll");
IF(hwnd == NULL)
   printf("In Use");

I hope you can help me.

Posted 22-Aug-13 4:10am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Fetch all hard disk data before the change event and compare it to the fetched data after your change. If something is changed youre done...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170308.1 | Last Updated 26 Aug 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100