📄 wpw_wapi_sysinfo_95.html
字号:
<HTML>
<HR><A NAME=WINAPI_MISC_DISK_INFO>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br>
<H4>Subject: Getting Disk Information</H4><PRE>
On Mon, 19 Jun 1995 04:56:25 GMT, smit2204@cs.fredonia.edu (Jaek Smith) said in article <DAELq1.AHA@cs.fredonia.edu>:
>Hello,
>
> I am working under Visual C++ - and am wanting to be able to find out the
>amount of free space on the hard drive. What is the easiest way to do this?
The same way you would do it in DOS. Use _dos_getdiskfree() in dos.h
--
Robert Mashlan R2M Software Company Programmer for Hire
mailto:rmashlan@r2m.com http://www.csn.net/~rmashlan PGP key available
Resources for Windows Developers - http://www.csn.net/~rmashlan/windev
Windows Developers FAQ - http://www.csn.net/~rmashlan/win-developer-FAQ
</PRE>
<HR><A NAME=WINAPI_MISC_DETECT_PENTIUM>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br>
<H4>Subject: Detecting Pentium Chip</H4><PRE>
Once you determine you are on a 486 or higher, try to set bit 21 of EFLAGS.
That bit can be set iff the CPU supports the CPUID instruction. Anything past
a 486 will support it. Thus, if you cannot set bit 21, you are on a 486.
If you *can* set bit 21, issue a CPUID. (It's possible that someone may do
a 486 that supports CPUID, so you can't assume that "supports CPUID" ==>
Pentium). CPUID will tell you what the CPU is.
See "The Undocumented PC" for code.
--Tim Smith
</PRE>
<HR><A NAME=WINAPI_MISC_Version_Number>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br>
<H4>Subject: Version number on Win95</H4><PRE>
In article <805710883snz@blimpy.demon.co.uk>
steck@acm.org "Paul A. Steckler" writes:
>I'm trying to 95ify my application.
>
>What does GetWindowsVersion() return under Windows 95?
Version 3.95. In a 32-bit program you should use "GetWindowsVersionEx"
which returns a LOT more information.
>Also, what is the format of the new long filenames? Length? Blanks
>allowed?
- Up to 255 characters
- Any character valid in a "short" name plus space, "+", ",", ";", "=",
"[", "]".
File names are actually stored on the disk in Unicode, but this is
transparent to your program.
Chris
--
--------------------------------------------------------------------------
| Chris Marriott, Warrington, UK | Author of SkyMap v2 shareware |
| chris@chrism.demon.co.uk | astronomy program for Windows. |
| For more info, see http://www.winternet.com/~jasc/skymap.html |
| Author member of Association of Shareware Professionals (ASP) |
--------------------------------------------------------------------------
</PRE>
<HR><A NAME=WINAPI_MISC_Disk_Label>
Return to <a href="wpw_wapi_index.html#TOC">Table of Contents for this chapter</a><br>
<H4>Subject: How to get the drive label?</H4><PRE>
I presume by the drives label you mean Volume Header ? If you do the the
code below will do it. If however you mean the Serial Number then I do
not know but if you figure it out please let me know.
Simon.
#include <stdio.h>
#include <dir.h>
#include <dos.h>
#include <stdlib.h>
int main(int argc,char *argv[])
{
struct ffblk ffblk;
int *return_string;
if(argc==1)
exit(1); //No files given
else
{
strcat(argv[1],"*.*");
if((findfirst(argv[1],&ffblk,FA_LABEL))!=0)
exit(2); //No label
else
{
return_string=&ffblk.ff_name;
return(*return_string);
}
}
return 0;
}
<HR>
try using _dos_findfirst() with the attribute set to _A_VOLID
Regards,
Tim
<HR>
| Karl V. Kutschke (kvk@shangri-la.mv.com) wrote:
| : Is there a way to get a drive's label?
| Me too! me too! How'd you do it?
How about
_dos_findfirst("C:\92*.*", _A_VOLID, ...); // substitute drive letter
as appropriate
<HR>
In article <DBu5AD.KIK@mv.mv.com>, kvk@shangri-la.mv.com says...
>
>>try using _dos_findfirst() with the attribute set to _A_VOLID
>Thanks, Tim, I'll look into it. The prefixed underscore seems to me
>to indicate one of Windows "undocumented" function calls. Is it?
No, the underscore is used by MS compilers to show it is MS defined.
_dos_findfirst ( or i.e. findfirst() in other compilers ) isn't a
undocumented call but a documented DOS ( and NT ) function call. Place
your cursor on findfirst in your compilers editor, hit F1 :-)
--
yours Carl Verner Skou
***********************************************************
What's mind? Doesn't matter. What's matter? Don't mind.
cvs@psy.aau.dk 2:237/10.3 Cognitive Point
Institute of Psychology, Aarhus University, Denmark
</PRE>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -