Wi n E x e c ( ' N o t e P a d ' , S W _ R E S TORE); // 运行写字本procedure TForm1.Button1Click(Sender: TO b j e c t ) ; v a r S t a r t u p I n f o : T S t a r t u p I n f o ; P r o c e s s I n f o : T P r o c e s s I n f o r m a t i o n ; b e g i n // 初始化工作 F i l l C h a r ( S t a r t u p I n f o , S i z e o f ( S t a r t u p I n f o ) , # 0 ) ; StartupInfo.cb := Sizeof(StartupInfo); StartupInfo.dwFlags := STA RT F _ U S E S H O W W I N D O W; C r e a t e P r o c e s s ( n i l , 'Calc', // 运行计算器 n i l , n i l , f a l s e , C R E ATE_NEW_CONSOLE or N O R M A L _ P R I O R I T Y _ C L A S S , n i l , n i l , S t a r t u p I n f o , P r o c e s s I n f o ) ; end;
ShellExecute(handle,'open','c:\test.jpg',nil,nil,SW_SHOWNORMAL);
v a r
S t a r t u p I n f o : T S t a r t u p I n f o ;
P r o c e s s I n f o : T P r o c e s s I n f o r m a t i o n ;
b e g i n
// 初始化工作
F i l l C h a r ( S t a r t u p I n f o , S i z e o f ( S t a r t u p I n f o ) , # 0 ) ;
StartupInfo.cb := Sizeof(StartupInfo);
StartupInfo.dwFlags := STA RT F _ U S E S H O W W I N D O W;
C r e a t e P r o c e s s ( n i l ,
'Calc', // 运行计算器
n i l ,
n i l ,
f a l s e ,
C R E ATE_NEW_CONSOLE or
N O R M A L _ P R I O R I T Y _ C L A S S ,
n i l ,
n i l ,
S t a r t u p I n f o ,
P r o c e s s I n f o ) ;
end;
ShellExecute(handle,'open','c:\test.jpg',nil,nil,SW_SHOWNORMAL);