Windows NT 的两个问题(50分)

  • 主题发起人 主题发起人 Randolph
  • 开始时间 开始时间
R

Randolph

Unregistered / Unconfirmed
GUEST, unregistred user!
1 如何恢复在FAT分区上的NT引导信息?我不希望用修复或重装?
2 如何在程序中获得任务栏改变大小及位置的消息?
 
试一试Kv300!
 
1。
A。使用NT的修复盘可以非常容易地恢复
B。重新安装的话只要安装程序刚刚开始往硬盘上拷文件的时候Reboot就行了

两种办法都非常简单,不知道您为什么不愿意用
提供方法C:
从别的机器上面的引导NT的FAT分区复制引导记录(使用DISKEDIT之类的工具)
 
Problem 2: You can read this article from MSDN:

Processing Appbar Notification Messages
An appbar receives a notification message when the state of the task bar changes, when a full screen application starts (or the last one closes), or when an event occurs that can affect the appbar’s size and position. The following example shows how to process the various notification messages.


// AppBarCallback - processes notification messages sent by the system.
// hwndAccessBar - handle of the appbar
// uNotifyMsg - identifier of the notification message
// lParam - message parameter
void AppBarCallback(HWND hwndAccessBar, UINT uNotifyMsg,
LPARAM lParam)
{
APPBARDATA abd;
UINT uState;

abd.cbSize = sizeof(abd);
abd.hWnd = hwndAccessBar;

switch (uNotifyMsg) {
case ABN_STATECHANGE:

// Check to see if the taskbar's always-on-top state has
// changed and, if it has, change the appbar's state
// accordingly.
uState = SHAppBarMessage(ABM_GETSTATE, &abd);
SetWindowPos(hwndAccessBar,
(ABS_ALWAYSONTOP & uState) ? HWND_TOPMOST : HWND_BOTTOM,
0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
break;

case ABN_FULLSCREENAPP:

// A full screen application has started, or the last full
// screen application has closed. Set the appbar's
// Z order appropriately.
if (lParam) {
SetWindowPos(hwndAccessBar,
(ABS_ALWAYSONTOP & uState) ?
HWND_TOPMOST : HWND_BOTTOM,
0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
} else {
uState = SHAppBarMessage(ABM_GETSTATE, &abd);
if (uState & ABS_ALWAYSONTOP)
SetWindowPos(hwndAccessBar, HWND_TOPMOST,
0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}

case ABN_POSCHANGED:

// The taskbar or another appbar has changed its
// size or position.
AppBarPosChanged(&abd);
break;
}
}

The following function adjusts an appbar’s bounding rectangle and then calls the application-defined AppBarQuerySetPos function (included in the previous section) to set the bar’s size and position accordingly.


// AppBarPosChanged - adjusts the appbar's size and position.
// pabd - address of an APPBARDATA structure that contains information
// used to adjust the size and position
void PASCAL AppBarPosChanged(PAPPBARDATA pabd)
{
RECT rc;
RECT rcWindow;
int iHeight;
int iWidth;

rc.top = 0;
rc.left = 0;
rc.right = GetSystemMetrics(SM_CXSCREEN);
rc.bottom = GetSystemMetrics(SM_CYSCREEN);

GetWindowRect(pabd->hWnd, &rcWindow);
iHeight = rcWindow.bottom - rcWindow.top;
iWidth = rcWindow.right - rcWindow.left;

switch (g_uSide) {
case ABE_TOP:
rc.bottom = rc.top + iHeight;
break;

case ABE_BOTTOM:
rc.top = rc.bottom - iHeight;
break;

case ABE_LEFT:
rc.right = rc.left + iWidth;
break;

case ABE_RIGHT:
rc.left = rc.right - iWidth;
break;
}
AppBarQuerySetPos(g_uSide, &rc, pabd);
}
 
1.
a. Make sure no error in ur boot.ini and it point to the current
place where winnt directory is located.
make sure osload,ntdetect are in ur root
 
But NT modifies boot record of FAT partition, so you must use
repair disk, or quick reinstall, then cancel,
or using Diskedit to copy boot record from another good FAT partition
with NT available, :(
 
对于问题1,我也是使用pegasus提出的方法B,但这种方法只适合自己使用,
你把这种方法告诉客户肯定不行,特别是很多机器需要这么做时更显得繁琐。
一般情况下NT的引导信息被破坏是因为被某个混蛋用DOS的SYS命令做掉了,
Boot.ini一般没有损坏。我希望这样告诉客户:“拿这张磁盘去,执行...就
可以了”,pegasus大虾是否可以把方法C写的详细点?

 
If using method C,
You can use Norton Diskedit, open Boot Record, then "Write to"
a file.

On target machine, open that file, write to the location of target partition's boot record.

If you want your client restore NT boot record easily,
then you'd better write a program to do so.

If you do need install NT and 95, I suggest using SystemCommand,
then you can let NT using NTFS as boot partition, it is more reliable
than FAT, and is safer, too.
 
To use method C, I suggest you write a tool
to backup/restore Boot Record.
 
接受答案了.
 
后退
顶部