|
I'm not sure exactly what you are after, but see if DeviceIoControl(..., IOCTL_DISK_GET_DRIVE_LAYOUT_EX, ...) will help.
Nope, that is for Windows NT-based machines. I'm not sure what will satisfy your Windows 98 requirement (I don't develop for it).
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Dear David,
That function requires a handle to device Physical Disk. Unfortunately, in Win98, we cannot create that handle. So the function DeviceIoControl won't work.
Thanks for your suggestion.
BRs.
____
Tuan
|
|
|
|
|
Tuan Dang wrote:
Unfortunately, in Win98, we cannot create that handle.
Why not?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
It's simple. Because the CreateFile() doesn't return a handle.
____
Tuan
|
|
|
|
|
Sure it does. Check the documentation or the function's prototype.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I did try it. It worked properly in Win2k/XP, but not in Win98. You can make a simple example and test it in Win98. Just create a file with a file name "PHYSICALDRIVE0".
BRs.
____
Tuan
|
|
|
|
|
This worked as expected:
HANDLE disk = CreateFile(_T("\\\\.\\PHYSICALDRIVE0"),
GENERIC_READ,
0,
NULL,
OPEN_EXISTING,
0,
NULL);
if (INVALID_HANDLE_VALUE != disk)
MessageBox(NULL, _T("Work"), _T(""), MB_OK);
else
MessageBox(NULL, _T("Not Work"), _T(""), MB_OK);
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Does that code work correctly in Win98 platform? If yes, it looks so strange. Let me try it again. Anyway, thank you so much.
BRs.
____
Tuan
|
|
|
|
|
Can any one suggest me a site or documentation to start wrting io device drivers?
Plese dont say MSDN coz its for reference i am more or less looking for tutorial kinda stuff
thanx.
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
"Windows 2000 Device driver book, A Guide for programmer" by Prentice Hall available in Ebook form.. i got it on some CD of ebooks.
or check Yashavant Kanetkar's online Device Driver course [^]
Muhammad Shoaib Khan
http://geocities.com/lansolution
|
|
|
|
|
Thank you very much.
I Touched Osama Bin Ladens Bushy Beard
|
|
|
|
|
hi,
i am using win2000,and i want to perform following operation in windows login,
i)All ways default user should be GUEST.
ii)if a user enters password wrong for three times, then automatically it has to login as guest.
iii)If administrator logs in it has to goes to desktop,
else i want to perform my application(ie ordinary user have no entry to desktop)
pls help me ....its urgent
bye,
achip
|
|
|
|
|
achip wrote:
i)All ways default user should be GUEST.
Check out the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system\DontDisplayLastUserName registry key. This won't do anything about a default user, but it does remove the ability to view which user was last logged onto the machine by clearing the username box on the login screen.
achip wrote:
ii)if a user enters password wrong for three times, then automatically it has to login as guest.
I'm not sure if this is possible without a custom GINA.DLL.
achip wrote:
iii)If administrator logs in it has to goes to desktop,
else i want to perform my application(ie ordinary user have no entry to desktop)
By default, after a successful login, the desktop is displayed. I'm not sure what you mean by "ordinary user have no entry to desktop." Perhaps the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\SecureDesktop registry key might be of use.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
i) ok......
then how u will set the default user name as Guest.
ii) i also know that for this u have to change the msgina.dll, but i dont have the source code & i dont know how to do it.
iii)what i mean is if the user is Administrator it has to dirrectly goes to desktop.
for all other user, after windows login dirrectly my applicaton has to run. No access to desktop.
i think now it is clear, u can help me..
i am waiting for ur reply,
thanks,
bye
|
|
|
|
|
achip wrote:
then how u will set the default user name as Guest.
Without creating your own MSGINA.DLL, I know of no way to automatically plug "Default" into the login box.
achip wrote:
...i dont know how to do it.
Start here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/security/msgina_dll_features.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/security/winlogon_and_gina.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/security/security/loading_and_running_a_gina_dll.asp
achip wrote:
what i mean is if the user is Administrator it has to dirrectly goes to desktop.
This happens by default. Some windows, such as Windows Explorer and Control Panel, might open back up if they were open when Administrator last logged off.
achip wrote:
for all other user, after windows login dirrectly my applicaton has to run. No access to desktop.
Then put your application in the Startup group, or the Run key (not in the HKLM hive) in the registry.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
hi,
if u put into startup then first desktop will come and after that ur application also will come.
more over from there by using some key u can access the desktop.
In our system only admin have the right to access the desktop, no one else.
so can u send some script for that
bye
|
|
|
|
|
achip wrote:
if u put into startup then first desktop will come and after that ur application also will come.
Correct. Only services start before the desktop.
achip wrote:
In our system only admin have the right to access the desktop, no one else.
Is this handled at the OS level (I've not been able to find anything), or is there a third party utility running that handles this?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I was considering a solution to my problem of grabbing strings from another application. Writing to a file seems to be easiest solution. However, the app which reads the file needs to read it in real time. Both apss run at the same time. The first program is writing data to a file (redirect stdout to a file and use printf). A second program is reading the file and displaying the data in a GUI text window. However, this does not seem to work. It may be a permission problem, but I'm not sure. I thought about using create named pipe, but I want the second app to be optional (meaning it does need to be run). When using pipes, don't both need to be connected? Any suggestions. Thanks.
|
|
|
|
|
One solution is memory-mapping. Another solution is WM_COPYDATA.
Kuphryn
|
|
|
|
|
Hi.
If your data is small you can use windows registery to pass the data.
If not you can use combination of two strategy named pipe and writing to file.
but i think after every write you close the file and open it at other time the second app can wait to close the file and then itself open it.
|
|
|
|
|
Hi.
You can use CFile class and in open function use this flag:
CFile::shareDenyNone
I think that this flag can useful for you.
|
|
|
|
|
I think this is exactly what you are looking for.
|
|
|
|
|
Hi All,
I need to select the entire column when a user clicks on a column header and I am not sure how to do it. Can someone give me some insights so I can get started.
Thank you,
Dmitry
Make things as simple as possible, but no simpler. -- Albert Einstein
|
|
|
|
|
Something like:
for (int x = 0; x < itemcount; x++)
listctrl.SetItem(x, column, LVIF_STATE, "", 0, LVIS_SELECTED, LVIS_SELECTED, 0); I've not tried this so it may be full of holes.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
With the standard list control, you can't select just a column. Take a look at the grid controls here at CP, those may be what you need.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0! | RightClick-Encrypt
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
|
|
|
|