teky 的 blog
在vck中学习,在vck中进步~
<2008年8月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
31123456
公告

留言簿(10)

随笔档案

文章分类

文章档案

相册

Windows Mobile

我的好友

朋友创业,其路漫漫

搜索

最新评论

阅读排行榜

评论排行榜

 
VC知识库BLOG   首页  新随笔  联系  聚合  登录 
  随笔-29 文章-15 评论-88 Trackbacks-3

代码如下:主要就是利用SetForegroundWindow

[DllImport("coredll.dll", EntryPoint = "GetCapture")]
private static extern IntPtr GetCapture();

[DllImport("coredll.dll", EntryPoint = "SetForegroundWindow")]
private static extern bool SetForegroundWindow(IntPtr hwnd);

public  bool SetFormTop(Form form)
 {
           form.Capture = true;
           IntPtr hwnd = GetCapture();
           form.Capture = false;

           return SetForegroundWindow(hwnd);
}

 private void bt_Click(object sender, EventArgs e)
{
            Form1 fdlg = new Form1();
            string title = this.Text;
            this.Text = string.Empty;//隐藏窗口标题

            fdlg .ShowDialog();   

            this.Text = title;

            SetFormTop(this);//在上个Form窗口返回的时候,把自己设置到最上面显示
  }

如果是在Smartphone中,那么结合上次说的对Back Key健的响应处理就更完美了.

posted on 2007-01-26 17:41 teky 阅读(2274) 评论(2)  编辑 收藏
Comments
  • # re: 保证Windows mobile上程序在多窗口的模式中窗口之间切换显示的连续性
    fish
    Posted @ 2007-03-16 10:58
    请问下把EVC的工程转到vs2005上
    某些菜单项变成灰色不能响应
    有些菜单项是好的?
  • # re: 保证Windows mobile上程序在多窗口的模式中窗口之间切换显示的连续性
    膜结构
    Posted @ 2007-03-17 02:46
    谢谢文章
标题  
姓名  
主页
验证码 *
内容   
  登录  使用高级评论  Top
[使用Ctrl+Enter键可以直接提交]