五丰称屠宰重客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

34 lines
1.1 KiB

using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace B3ButcherWeightClient {
public class WinApiSendMessage {
//声明 API 函数
[DllImport("User32.dll", EntryPoint = "SendMessage")]
public static extern int SendMessage(
int hWnd, // handle to destination window
int Msg, // message
int wParam, // first message parameter
int lParam // second message parameter
);
[DllImport("User32.dll", EntryPoint = "FindWindow")]
public static extern int FindWindow(string lpClassName, string lpWindowName);
[DllImport("wininet.dll")]
public extern static bool InternetGetConnectedState(out int connectionDescription, int reservedValue);
const int SND_ASYNC = 1;
const int SND_FileNAME = 0X20000;
[DllImport("winmm.dll", EntryPoint = "PlaySound")]
private static extern int PlaySound(string lpxzName, int hModul, int dwFlags);
public static int WinAPIPlaySound(string fileName) {
int isOk = PlaySound(Application.StartupPath + fileName, 1, SND_FileNAME | SND_ASYNC);
return isOk;
}
}
}