2024年1月21日发(作者:)
_watchForActivate = false;
_handle = ;
CheckMsgbox();
}
c(ref m);
}
private void CheckMsgbox()
{
if (_buttonTitles == null || _ == 0)
return;
// Button title index
int buttonTitleIndex = 0;
// Get the handle of control in current window.
IntPtr h = dow(_handle, GW_CHILD);
// Set those custom titles to the three buttons(Default title are: Yes, No and Cancle).
while (h != )
{
if (dowClassName(h).Equals("Button"))
{
if (_ > buttonTitleIndex)
{
// Changes the text of the specified window's title bar (if it has one).
// If the specified window is a control, the text of the control is changed.
// However, SetWindowText cannot change the text of a control in another application.
dowText(h, _buttonTitles[buttonTitleIndex]);
buttonTitleIndex++;
}
}
// Get the handle of next control in current window.
h = dow(h, GW_HWNDNEXT);
}
}
}
public const int GW_CHILD = 5;
public const int GW_HWNDNEXT = 2;
public class NativeWin32API
{
[DllImport("", CharSet = )]
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int Width, int Height, int flags);
[DllImport("")]
public static extern IntPtr GetWindow(IntPtr hWnd, Int32 wCmd);
[DllImport("")]
public static extern bool SetWindowText(IntPtr hWnd, string lpString);
[DllImport("")]
public static extern int GetClassNameW(IntPtr hWnd, [MarshalAs()]StringBuilder lpString, int nMaxCount);
public static string GetWindowClassName(IntPtr handle)
{
StringBuilder sb = new StringBuilder(256);
// Retrieves the name of the class to which the specified window belongs
GetClassNameW(handle, sb, ty);
return ng();
}
}
}


发布评论