コード例 #1
0
        //读取INI
        public static string ReadIni(string iniFileName, string Section, string Ident, string Default)
        {
            StringBuilder temp = new StringBuilder(255);
            int           i    = DllManager.GetPrivateProfileString(Section, Ident, Default, temp, 255, iniFileName);

            return(temp.ToString());
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: venson9/homeServiceRobot
        private void ExecuteSpeechOrder(string SRecoResult)
        {
            string def    = "def";
            string answer = m_DBManager.GetAnswer(SRecoResult, def);

            if (answer != def)
            {
                SRecoManager.Speak(answer);
            }
            //唱歌
            answer = m_DBManager.GetAnswer("NAME_SONG", SRecoResult, def);
            if (answer != def)
            {
                if (thread_song != null)
                {
                    thread_song.Abort();
                }
                else
                {
                    //thread_song = new Thread(new ThreadStart(PlaySound1));
                    name_song = answer;
                    //thread_song.Start();
                    DllManager.PlaySound(name_song, 0, 0x0001);
                }
            }
            else
            {
//                 if (thread_song!=null)
//                 {
                //thread_song.Abort();
                name_song = null;
                DllManager.PlaySound(name_song, 0, 0x0001);
                /* }   */
            }
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: venson9/homeServiceRobot
        private void HideOtherWindow(string name_otherWindow)
        {
            IntPtr hWnd = DllManager.FindWindow(null, name_otherWindow);

            if (hWnd != IntPtr.Zero)
            {
                DllManager.ShowWindow(hWnd, 0);
            }
        }
コード例 #4
0
ファイル: MainForm.cs プロジェクト: venson9/homeServiceRobot
        private void ShowOtherWindow(string name_otherWindow, int flag_fullScreen = 1)
        {
            IntPtr hWnd = DllManager.FindWindow(null, name_otherWindow);

            if (hWnd != IntPtr.Zero)
            {
                //                 Rectangle rect=new Rectangle();
                //                 GetWindowRect(hWnd, ref rect);
                Rectangle rect = new Rectangle(new Point(0, 0), new Size(0, 0));
                if (flag_fullScreen == 1)
                {
                    rect = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea;
                }
                else
                {
                    DllManager.GetWindowRect(hWnd, ref rect);
                }
                DllManager.SetWindowPos(hWnd, -1, 0, 0, rect.Width, rect.Height, 0x4000 | 0x0040);
                DllManager.ShowWindow(hWnd, 1);
            }
        }
コード例 #5
0
ファイル: MainForm.cs プロジェクト: venson9/homeServiceRobot
 private void 唱首歌ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     DllManager.PlaySound(@"D:\人机交互\音乐\范玮琪-一个像夏天 一个像秋天.wav", 0, 1);
 }
コード例 #6
0
ファイル: MainForm.cs プロジェクト: venson9/homeServiceRobot
 private void PlaySound1()
 {
     DllManager.PlaySound(name_song, 0, 0x0001);
     //PlaySound(null, 0, 0);
     MessageBox.Show("没有播放歌曲吧!");
 }