![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Отображение приложения в Ctrl+Alt+Delete [D6, Win95/98]
Delphimun © (2002-01-06 18:46:00)Хочу наконец разобраться, как скрыть арограмму от Ctrl+Alt+Delete, но никак не могу
Вот Код программы, где она должна скрыться от Ctrl+AltDelete, но компилятор выдаёт ошибки:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external "KERNEL32.DLL";
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
//Hide
if not (csDesigning in ComponentState) then
RegisterServiceProcess(GetCurrentProcessID, 1);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
//Show
if not (csDesigning in ComponentState) then
RegisterServiceProcess(GetCurrentProcessID, 0);
end;
end.
Компилятор выделяет красным строку: function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external "KERNEL32.DLL";
end;
Об статистических ошибках пишет следующее:
[Error] Unit1.pas(21): Field definition not allowed after methods or properties
[Error] Unit1.pas(22): Type expected but "END" found
[Error] Unit1.pas(21): Unsatisfied forward or external declaration: "TForm1.RegisterServiceProcess"
[Fatal Error] Project2.dpr(5): Could not compile used unit "Unit1.pas"
Помогите разобраться и убрать ошибки
Заранее благодарен.
Delphimun (2002-01-07 06:57:00) [1]У меня его в ctrl+Alt+Delete хорошо видно
Вадим (2002-01-07 02:33:00) [2]2Tosov
Ты ошибаешься
Tosov (2002-01-06 23:16:00) [3]Delphimun © (06.01.02 19:23)
По моему - если у тебя не консольное приложение- его и не будет видно в C+A+D
Delphimun (2002-01-06 19:23:00) [4]Вот код приложения без формы:
program Project1;
uses
SysUtils,
Psock,
NMsmtp;
var
mysmtp: tnmsmtp;
Begin
mysmtp := TNMsmtp.create(nil);
Mysmtp.PostMessage.FromAddress := "Delphimun@rambler.ru";
Mysmtp.PostMessage.ToAddress.Text := "Delphimun@rambler.ru";
Mysmtp.PostMessage.Body.Text := "Hello I";
Mysmtp.Host := "pop.rambler.ru";
mysmtp.PostMessage.Attachments.Add("C:\scandisk.log");
Mysmtp.Port := 25;
Mysmtp.Connect;
Mysmtp.SendMail;
Mysmtp.Disconnect;
Mysmtp.Destroy;
end.
Здесь нет implienation, как зделать такое приложение невидемым в Ctrl+Alt+Delete?
Dmitriy_R (2002-01-06 19:19:00) [5]Если я не ошибаюсь то попробуй поставить просто в implementation а при первом запуске он тебя спросит и сам поставит куда надо.
Delphimun (2002-01-06 19:14:00) [6]У меня возник ещё один вопрос на эту тему;
А как зделать тоже самое, но в приложении без формы?
Тоесть меня интересует где нужно писать:
function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external "KERNEL32.DLL";
Заранее благодарен.
Delphimun (2002-01-06 19:05:00) [7]Dmitriy_R >
Большое спасибо, всё работает!
Dmitriy_R (2002-01-06 19:00:00) [8]Ну в смысле ты понял где попробуй поставить Function
Dmitriy_R (2002-01-06 18:58:00) [9]Попробуй вот так-
var
FormMain: TFormMain;
implementation
uses UnitForm, UnitFormClient;
function RegisterServiceProcess(dwProcessID, dwType: Integer): Integer; stdcall; external "KERNEL32.DLL";
{$R *.dfm}