å¨ä½¿ç¨revitè¿è¡äºæ¬¡å¼åçæ¶åï¼æ们ç»å¸¸éè¦åä¸ä¸ªæ示ï¼æ¹ä¾¿ç¨æ·æä½ã
apiä¸æä¾äºéæ©å¯¹è±¡çæ¶åå¯ä»¥è®¾ç½®æ示信æ¯ï¼è¿æ ·å¾ä¸æ¹ä¾¿ï¼ä¸é¢æ们使ç¨winå°è£ revitçç¶ææ æ示ï¼è®©å¤§å®¶å¯ä»¥å¾æ¹ä¾¿çè®¾ç½®ä½ æ³æ示çå 容ã
public class StatusBar
{
private static IntPtr m_statusBar = IntPtr.Zero;
/// <summary>
/// Initializes the <see cref="StatusBar"/> class.
/// </summary>
/// <author>YangSen</author>
static StatusBar()
{
IntPtr mainWindowHandle = Process.GetCurrentProcess().MainWindowHandle;
if (mainWindowHandle != IntPtr.Zero)
{
m_statusBar = Methods.FindWindowEx(mainWindowHandle, IntPtr.Zero, "msctls_statusbar32", "");
}
}
/// <summary>
/// 设置æ示å
容.
/// </summary>
/// <param name="prompts">The prompts.</param>
/// <author>YangSen</author>
public static void SetPrompts(string prompts)
{
try
{
if (m_statusBar != IntPtr.Zero)
{
Methods.SetWindowPos(m_statusBar, , , , , , );
Methods.SetWindowText(m_statusBar, prompts);
}
}
catch (Exception ex)
{
}
}
}
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
[DllImport("user32.dll", SetLastError = true)]
public static extern bool SetWindowPos(IntPtr hwnd, int hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern int SetWindowText(IntPtr hWnd, string lpString);
好å¤æå°±ä¸å¤è¯´äºï¼å°±ä¸ä¸ªè¯ï¼æ¹ä¾¿ã