全部博文(788)
分类:
2008-11-27 21:16:49
试下:
ShowWindow(Application.Handle, SW_SHOWNORMAL or SW_RESTORE);
帮顶
试了ShowWindow(Application.Handle, SW_SHOWNORMAL or SW_RESTORE);
也是一样,就是不提前显示出来
有用了,我发现如果最小化得时候采用Application.Handle就行了,哈哈,我再试试
目前处于别得窗体之后还不行
加上BringWindowToTop和SetForegroundWindow呢?用Application.Handle
我也是都在后面2函数上加上才能在最小化状态把窗体置前得。但是处于别得窗体之后还是不行。不知道怎么回事
不是你想SetForegroundWindow谁就可以SetForegroundWindow谁的。
(msdn只说win98/me是这样,其实2k/xp也一样)
the system restricts which processes can set the foreground window. A process can set the foreground window only if one of the following conditions is true:
The process is the foreground process.
The process was started by the foreground process.
The process received the last input event.
There is no foreground process.
The foreground process is being debugged.
The foreground is not locked (see LockSetForegroundWindow).
The foreground lock time-out has expired (see SPI_GETFOREGROUNDLOCKTIMEOUT in SystemParametersInfo).
No menus are active.
不信可以自己试验,
搞一个程序只有:
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
SetForegroundWindow(Handle);
}
保存起来,运行它然后把窗体放在后面,这时它只能在任务栏里闪。
再搞一个程序:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
WinExec("C:\\Documents and Settings\\Ray\\桌面\\新建文件夹\\project1.exe",SW_SHOW);//运行上一个程序
}
这时按Button1就可以调到前面来。
学习接分;;;;;;;;;;;
leonatcs(LeonKennedy)(时常逛一逛csdn,有益身心健康。)
真是这样,只在任务栏里闪,但是有没有办法直接掉到前面来?如果不开新进程。因为这个进程要一直开着,比如游戏外挂。我看到别得游戏外挂可以做到。
谢谢