serg128 |
Отправлено: 29.03.2005, 21:24 |
|
Дежурный стрелочник
Группа: Участник
Сообщений: 46
|
Пиплы, помогите плиз перевести с делфи на билдер:
type
TForm1 = class(TForm)
private
procedure MySuperProc(var msg: TMessage); message WM_QUERYENDSESSION;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.MySuperProc(var msg: TMessage);
begin
Close;
end; |
|
Rius |
Отправлено: 30.03.2005, 03:59 |
|
Мастер участка
Группа: Участник
Сообщений: 321
|
Кажись так (в билдере не проверял):
cpp
CODE | //---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::WndProc(TMessage& Message)
{
TWinControl::WndProc(Message);
switch(Message.Msg)
{
// case WM_PAINT: WMPaint(Message); break;
// case CM_MOUSEENTER: FOnMouseEnter(Message); break;
// case CM_MOUSELEAVE: FOnMouseLeave(Message); break;
// case WM_LBUTTONDOWN: FOnLeftMouseDown(Message); break;
// case WM_LBUTTONUP: FOnLeftMouseUp(Message); break;
case WM_QUERYENDSESSION: MySuperProc(Message); break;
// case WM_MOUSEMOVE: FOnMouseMove(Message); break;
// case WM_KILLFOCUS: FOnUnFocus(Message); break;
// case WM_SETFOCUS: FOnSetFocus(Message); break;
// case WM_KEYUP: FOnKeyUp(Message); break;
// case WM_FONTCHANGE: ShowMessage("Font changed"); break;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::MySuperProc(TMessage& Msg)// message WM_QUERYENDSESSION;
{
Close();
}
//--------------------------------------------------------------------------- |
h
CODE | //---------------------------------------------------------------------------
#ifndef Unit2H
#define Unit2H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
private: // User declarations
void __fastcall WndProc(TMessage& Msg);
void __fastcall MySuperProc(TMessage& Msg);// message WM_QUERYENDSESSION;
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif |
Отредактировано Rius — 30/03/2005, 07:03
|
|