|
Hi,
I have some new hard disk with capacity of 500 giga.
I separate this hard disk to two part (one with 100 giga and other with 400 giga ).
I want to install the operation system on the part with the 100 giga and for some reason the installation of the windows ( win xp pro ) was install on the other partition.
How can i remove all the operation system from one partition to the other ( without install all the windwos from the start ) ?
( i can use Norton ghost or something like that ... ? )
Thanks for any help.
|
|
|
|
|
It would certainly involve copying the partition, change the boot.ini and the drive-letter assigned to the drive - after copying, try using the recovery mode for the windows installation CD, or the recovery console (if you can reach it).
Other than this, one should always install Windows on the only partition in the system, then add partitions and hard-drives later on. That way, the only existing partition will be the one that Windows suggests when you choose "install to existing partition".
Same thing happened to me once, but I had other problems, and so I was unable to fix it. If you succeed, do post your solution, please.
Cheers,
Sebastian
--
"If it was two men, the non-driver would have challenged the driver to simply crash through the gates. The macho image thing, you know." - Marc Clifton
|
|
|
|
|
Hi
I need to get - programatically - the graphic display's properties (specifically the x and y physical dimensions).
I found that using GetDeviceCaps(HORZSIZE) returns erroneous answers.
Is there any other way to get the info (maybe by communicating directly with the device), short of asking the user to measure the screen ?
Thanks
alex
'Architecture is music frozen in space.'
|
|
|
|
|
|
Thank you for answering.
As I wrote, I need the physical screen size (in milimeters), and GetSystemMetrics(SM_CXSCREEN) returns pixels.
The problem is GetDeviceCaps(HORZSIZE/VERTSIZE) is supposed to return the screen size in milimeters, but gives incorrect answers.
That's why I'm looking for the way to directly get the data from the hardware.
alex
'Architecture is music frozen in space.'
|
|
|
|
|
public class WinAPI
{
[DllImport("gdi32.dll")]
private static extern Int32 GetDeviceCaps(IntPtr hdc, Int32 capindex);
[DllImport("user32.dll")]
public static extern IntPtr GetDC(IntPtr ptr);
private const int DRIVERVERSION = 0x00;
private const int TECHNOLOGY = 0x2;
private const int HORZSIZE = 0x4;
private const int VERTSIZE = 0x6;
private const int HORZRES = 0x8;
private const int VERTRES = 0xA;
private const int BITSPIXEL = 0xC;
private const int PLANES = 0xE;
private const int NUMBRUSHES = 0x10;
private const int NUMPENS = 0x12;
private const int NUMMARKERS = 0x14;
private const int NUMFONTS = 0x16;
private const int NUMCOLORS = 0x18;
private const int PDEVICESIZE = 0x1A;
private const int CURVECAPS = 0x1C;
private const int LINECAPS = 0x1E;
private const int POLYGONALCAPS = 0x20;
private const int TEXTCAPS = 0x22;
private const int CLIPCAPS = 0x24;
private const int RASTERCAPS = 0x26;
private const int ASPECTX = 0x28;
private const int ASPECTY = 0x2A;
private const int ASPECTXY = 0x2C;
private const int SHADEBLENDCAPS = 0x2D;
private const int LOGPIXELSX = 0x58;
private const int LOGPIXELSY = 0x5A;
private const int SIZEPALETTE = 0x68;
private const int NUMRESERVED = 0x6A;
private const int COLORRES = 0x6C;
private const int VREFRESH = 0x74;
private const int DESKTOPVERTRES = 0x75;
private const int DESKTOPHORZRES = 0x76;
private const int BLTALIGNMENT = 0x77;
public static void GetLogPixels(IntPtr hDC, ref int logPixelsX, ref int logPixelsY)
{
logPixelsX= GetDeviceCaps(hDC , LOGPIXELSX );
logPixelsY= GetDeviceCaps(hDC , LOGPIXELSY );
}
public static void GetResolution(IntPtr hDC, ref int horzPixels, ref int vertPixels)
{
horzPixels = GetDeviceCaps(hDC, HORZRES);
vertPixels = GetDeviceCaps(hDC, VERTRES);
}
public static void GetScreenMM(IntPtr hDC, ref int horzMM, ref int vertMM)
{
horzMM = GetDeviceCaps(hDC, HORZSIZE);
vertMM = GetDeviceCaps(hDC, VERTSIZE);
}
public static void GetCalculatedScreenMM(IntPtr hDC, ref int horzMM, ref int vertMM)
{
int logX = 0;
int logY = 0;
int resX = 0;
int resY = 0;
double inchesX = 0.0d;
double inchesY = 0.0d;
GetLogPixels(hDC, ref logX, ref logY);
GetResolution(hDC, ref resX, ref resY);
inchesX = resX / logX;
inchesY = resY / logY;
horzMM = (int)(inchesX * 0.0394d);
vertMM = (int)(inchesY * 0.0394d);
}
}
IntPtr dc = WinAPI.GetDC(this.Handle);
int horzMM = 0;
int vertMM = 0;
WinAPI.GetCalculatedScreenMM(hDC, ref horzMM, ref vertMM);
int xMM = 0;
int yMM = 0;
WinAPI.GetScreenMM(hDC, xMM, yMM);
Well, what do you know!? My calculated mm millimeter resolution is 444x277, and calling the DeviceCaps function with (HORZSIZE, VERTSIZE) returned 470x293!
Anyway, there's your calculation for determining the width/height in millimeters.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
The values you compute are based on the results of GetLogPixels() which returns pixels/inch.
On my machine it seems I get 96dpi no matter what I do (i.e. no matter the screen resolution), so the result of the calculation is (very close to) what the system reports.
1. It seems there is a problem with the results of GetLogPixels(): it always returns 96. Look it up on the web.
2. What I am interested in is to interrogate the display device (EDID data) directly.
Even so, it seems that the EDID data is sometimes erroneous or even completely missing (fault of manufacturer). Again, see the web.
alex
'Architecture is music frozen in space.'
|
|
|
|
|
Most of the time, the DPI *is* 96 on a normal Windows desktop. But you can set your DPI to be higher (120 DPI) by using "large fonts".
If you want to verify that GetDeviceCaps is returning accurate info regarding size in mm, you could try setting the DPI to 120 and it *should* come back with the same mm size that was reported with normal fonts.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I set the display to large fonts and it still says 96 dpi.
>it *should* come back with the same mm size that was reported with normal fonts
It does, but the reported size is wrong.
alex
'Architecture is music frozen in space.'
|
|
|
|
|
On windows versions prior to vista DPI scaling was so fubar that if hardware didn't lie and claim 96 DPI everything was a mess. Vista's better, but anytime it has to scale an app bitmap image instead of a vector image it still sucks.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Hi all,
do value of index of the ethernet cards and also wireless adapters in pc have any definite range?
|
|
|
|
|
Indeex range?? What are you talking about?? Where are you looking that shows you an Index?
|
|
|
|
|
Each network adapter has an ip address,subnet mask attached with it,right?Similarly,an network adapter also has an index associated with it,through which we can bind a scoket to it.the ethernet adapter that i have has index 2.so,i am asking whether there is some range for index of an network adapter?
|
|
|
|
|
OK. The range you're talking about is technically 0 to Int32.Max. Though, system resources limits that to probably a few thousand adapters.
|
|
|
|
|
I didn't get your answer.see i have to develope an application in which i have to distinguish out of the network adapter cards available in the system,which one is ethernet and which one is wireless.Its easy to know which one is ethernet but for wireless i am not getting anything.But one think that I have noticed is index number for ethernet is genearlly 2,3etc and for wireless its 65530 etc.I was thinking to distinguish both referring to the index number.I hope u now understand what my problem is.Pls help if u have any answer to it.Thanks...
|
|
|
|
|
an89 wrote: number for ethernet is genearlly 2,3etc and for wireless its 65530
That's the wrong way to go about it. You have to query each adapter to get it's type.
You don't say what you're using to get the adapters list. I'll suggest using WMI to make it real easy to tell the difference. Check out the Win32_NetworkAdapter[^] class.
|
|
|
|
|
I have used GetAdapterAddress and GetAdapterInfo which are part of win32 API to get list of interfaces.But the problem is that for ethernet everything is showing fine.But for wireless adapter the type it is returning is "ethernet".But it is returning all other information correctly about the wireless adapter such as ipaddress,index and name.I don't know why its happening.and I can't use WMI.
|
|
|
|
|
OK. Look at Interfaces, not Adapters. You can get the media type (IEEE802.11 - Radio Spread Spectrum) from the Interfaces table. Check into the GetIf* functions instead.
|
|
|
|
|
I didn't get you.Could you please give me some links or some source code so as to understand what you have specified.Thanks....
|
|
|
|
|
GetIfTable[^]
If you look at the left side, you'll see all the GetIf* functions.
|
|
|
|
|
Thanks for your help but It didn't help either.The function displays type of wireless as ethernet.If you know any other method pls do reply.
|
|
|
|
|
Yes, it does tell you. That's the only method besides WMI to get what you want. The Type should have come back as IEEE802.11. If it didn't, then it's the fault of the driver for your adapter. dwType can currently come back with 144 different interface types.
|
|
|
|
|
no the type came as "ethernet".In Linux also the type for wireless adapter comes as "ethernet" when you give ifconfig.U can try it also.
|
|
|
|
|
I don't care, because I use WMI to do this stuff and it's not lying to me.
I already told you that this is the ONLY way to get the data you want, save for using WMI, which you "can't use". There is no other option. If it lies to you, there's nothing you can do about it. Well, other than see if the manufacturer of your wireless adapter has updated drivers, because that's where this data is coming from.
|
|
|
|
|
mine is not a built-in adapter.its a USB adapter.Can that be a reason for it?
|
|
|
|