怎么用一个键显示和隐藏form!!!!
rokyo 2003-02-06 07:48:32 我用的是hook 现在
if(GetAsyncKeyState(VK_F12){ ShowForm();}
bool ShowForm(Tfmshow *Form1)
{
bool FormExist=false;
for(int i=0;i<Screen->FormCount;i++)
if(Screen->Forms[i]->ClassType()==Form1->ClassType())
{
FormExist=true;
break;}
if(FormExist==false)
{ Form1=new Tfmshow(NULL);
WndHandle = FindWindow(NULL,"nage");
ShowWindow(WndHandle,SW_HIDE);
ShowWindow(Form1->Handle,SW_SHOW);
returnValue=FALSE;
}
if(FormExist==true)
{
ShowWindow(Form1->Handle,SW_HIDE);
returnValue=TRUE;
}
else if(returnValue==true)
{
ShowWindow(Form1->Handle,SW_SHOW);
ShowWindow(WndHandle,SW_HIDE);
returnValue=FALSE;
}
return true;
}
我是想当我用F12是后出现Form1再次按F12时隐藏Form1 (不是关掉) 当我再次按F12时
又显示Form1
我这段有问题 我按F12老是新建Form 按几下就有几个
不能隐藏
为什么??