不要哪些函数,一个 shellexecute 就可以,象打开其他文件一样,千万不要告诉我你不会shellexecute ,万一不会就看看帮助吧。

解决方案 »

  1.   

    to wjiachun:
      也许我没说清楚,我说的是“WINDOWS如何启动屏保”,即在“Control Panel”设置的,SHELLEXECUTE虽可启动屏保,却不能启动先前设置的屏保,如何获得这一屏保的文件名?
      

  2.   

    是利用程序的参数,我是这样做的:
      Mutex:=CreateMutex(NIL,True,'SingleApp');
      IF GetLastError<>ERROR_ALREADY_EXISTS THEN//如果不存在另一实例
      BEGIN
      
        Tag:=0;
        if LowerCase(ParamStr(1))='/a' then
          Tag:=1
        else if LowerCase(ParamStr(1))='/p' then
               Tag:=2
                 else if LowerCase(ParamStr(1))='/c' then
                        Tag:=3
                        else if LowerCase(ParamStr(1))='/s' then
                             Tag:=4;
    // /a 在显示属性对话框中单击他就可以修改口令
    // /p 每当选中显示属性对话框中屏幕保护程序标签时,在对话框显示预览效果
    // /c 在显示属性对话框中单击他进行设置
    // /s 在显示属性对话框中单击预览按钮或系统掉用屏保
      case Tag of
        4:
        begin
        Application.Initialize;
        Application.CreateForm(TForm1, Form1);
        Application.Run;
        end;    0,1,3:
        begin
        Application.Initialize;
        Application.CreateForm(TForm2, Form2);
        Application.Run;
        end;  end;
      

  3.   

    是利用程序的参数,我是这样做的:
      Mutex:=CreateMutex(NIL,True,'SingleApp');
      IF GetLastError<>ERROR_ALREADY_EXISTS THEN//如果不存在另一实例
      BEGIN
      
        Tag:=0;
        if LowerCase(ParamStr(1))='/a' then
          Tag:=1
        else if LowerCase(ParamStr(1))='/p' then
               Tag:=2
                 else if LowerCase(ParamStr(1))='/c' then
                        Tag:=3
                        else if LowerCase(ParamStr(1))='/s' then
                             Tag:=4;
    // /a 在显示属性对话框中单击他就可以修改口令
    // /p 每当选中显示属性对话框中屏幕保护程序标签时,在对话框显示预览效果
    // /c 在显示属性对话框中单击他进行设置
    // /s 在显示属性对话框中单击预览按钮或系统掉用屏保
      case Tag of
        4:
        begin
        Application.Initialize;
        Application.CreateForm(TForm1, Form1);
        Application.Run;
        end;    0,1,3:
        begin
        Application.Initialize;
        Application.CreateForm(TForm2, Form2);
        Application.Run;
        end;
      end;END;
    ReleaseMutex(Mutex);end.
      

  4.   

    发送一个屏幕保护的消息即可!
    SendMessage(HWND_BROADCAST,WM_SYSCOMMAND,SC_SCREENSAVE,0);
      

  5.   

    是利用程序的参数,我是这样做的:
      Mutex:=CreateMutex(NIL,True,'SingleApp');
      IF GetLastError<>ERROR_ALREADY_EXISTS THEN//如果不存在另一实例
      BEGIN
      
        Tag:=0;
        if LowerCase(ParamStr(1))='/a' then
          Tag:=1
        else if LowerCase(ParamStr(1))='/p' then
               Tag:=2
                 else if LowerCase(ParamStr(1))='/c' then
                        Tag:=3
                        else if LowerCase(ParamStr(1))='/s' then
                             Tag:=4;
    // /a 在显示属性对话框中单击他就可以修改口令
    // /p 每当选中显示属性对话框中屏幕保护程序标签时,在对话框显示预览效果
    // /c 在显示属性对话框中单击他进行设置
    // /s 在显示属性对话框中单击预览按钮或系统掉用屏保
      case Tag of
        4:
        begin
        Application.Initialize;
        Application.CreateForm(TForm1, Form1);
        Application.Run;
        end;    0,1,3:
        begin
        Application.Initialize;
        Application.CreateForm(TForm2, Form2);
        Application.Run;
        end;
      end;END;
    ReleaseMutex(Mutex);end.其实屏保程序就是一个exe,只是扩展名不同
      

  6.   

    分数就给Kingron(WinAPI) 吧,他说得不错。