通過API函數打開QQ對話框

聲明API函數

        private void toolStripSplitButton1_ButtonClick(object sender, EventArgs e)
        {
            string qq = GetRandomQQ();
            ShellExecute((int)this.Handle, "open", "tencent://message/?uin=" + qq, "", "", 1);
        }

        [DllImport("shell32.dll ", EntryPoint = "ShellExecute")]
        public static extern int ShellExecute(
        int hwnd,
        string lpOperation,
        string lpFile,
        string lpParameters,
        string lpDirectory,
        int nShowCmd);

參數QQ爲任意存在號碼
以上代碼僅供參考
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章