FireMonkey Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
FireMonkey 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
델마당
볼랜드포럼 광고 모집

FireMonkey 팁&트릭
[19] [C++] 앱 라이프 사이클 받기 예제...
개성제어 [kscontrol] 2130 읽음    2016-02-06 00:12
델파이 참고예제는 많은데 C++예제는 찾기 힘들어 델파이 예제와 C++예제를 짜 맞추었습니다.
RAD 특히 C++로 앱하나 완성하기가 쉬우면서도 쉽지 않는 부분들이 산재하네요.
이틀 동안 고생을 해서 이런 고생은 다른 사람은 안 했으면해서.....

먼저, 폼 생성시점에 파란색 코드를 그냥 복사하면 됩니다.
void __fastcall TTeleManForm::FormCreate(TObject *Sender)
{

  TGUID guid = StringToGUID("{F3AAF11A-1678-4CC6-A5BF-721A24A676FD}");  // GUID
IInterface *AEventSvc;
if (TPlatformServices::Current->SupportsPlatformService(guid)) {
  AEventSvc = TPlatformServices::Current->GetPlatformService(guid);
  IFMXApplicationEventService *EventSvc;
  AEventSvc->QueryInterface(guid,(void**)(&EventSvc));
  EventSvc-> SetApplicationEventHandler(  AppEventHandler);
  EventSvc->Release();
  }
// Ur Code!
}
이벤트 받을 함수.....
// ---------------------------------------------------------------------------
bool __fastcall TTeleManForm::AppEventHandler(TApplicationEvent AAppEvent,TObject *AContext)
{
  // 앱상태가 바뀌면 AAppEvent에서 앱의 상태를 받을 수 있습니다.
  return(true);
}

+ -

관련 글 리스트
19 [C++] 앱 라이프 사이클 받기 예제... 개성제어 2130 2016/02/06
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.