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

C++빌더 Q&A
C++Builder Programming Q&A
[50615] Re:Re:Application->Restore(); 이것을 API로 표현하면 어떻게 될까요?
박영목 [] 1924 읽음    2007-09-19 13:42
꾸벅^^.... 장성호 고수님  답변 감사합니다....

장성호 님이 쓰신 글 :
: 그냥 프로그램이 Minimize나 Hide된  상태에서
: Nomal 이나 Maximize 상태로 복귀 시키는 것입니다.
:
: 아래는 VCL 원본 코드와 그걸 C++Builder로 변환해 봤습니다.
: // VCL  Delphi 코드
: procedure TApplication.Restore;
: begin
:   if IsIconic(FHandle) then
:   begin
:     SetActiveWindow(FHandle);
:     if (MainForm <> nil) and (ShowMainForm or MainForm.Visible)
:       and IsWindowEnabled(MainForm.Handle) then
:       DefWindowProc(FHandle, WM_SYSCOMMAND, SC_RESTORE, 0)
:     else ShowWinNoAnimate(FHandle, SW_RESTORE);
:     SetWindowPos(FHandle, 0, GetSystemMetrics(SM_CXSCREEN) div 2,
:       GetSystemMetrics(SM_CYSCREEN) div 2, 0, 0, SWP_SHOWWINDOW);
:     if (FMainForm <> nil) and (FMainForm.FWindowState = wsMinimized) and
:       not FMainForm.Visible then
:     begin
:       FMainForm.WindowState := wsNormal;
:       FMainForm.Show;
:     end;
:     RestoreTopMosts;
:     if Screen.ActiveControl <> nil then
:       Windows.SetFocus(Screen.ActiveControl.Handle);
:     if Assigned(FOnRestore) then FOnRestore(Self);
:   end;
: end;
: //---------------------------------------------------------------------------
:
: // C++Builder
: void TApplication::Restore()
: {
:   if( IsIconic(FHandle) )
:   {
:     SetActiveWindow(FHandle);
:     if( (MainForm !=NULL) && (ShowMainForm || MainForm->Visible)  && IsWindowEnabled(MainForm->Handle) )
:         DefWindowProc(FHandle, WM_SYSCOMMAND, SC_RESTORE, 0)
:     else
:         ShowWinNoAnimate(FHandle, SW_RESTORE);
:
:     SetWindowPos(FHandle, 0, GetSystemMetrics(SM_CXSCREEN) / 2, GetSystemMetrics(SM_CYSCREEN) / 2, 0, 0, SWP_SHOWWINDOW);
:
:     if( (FMainForm != NULL) && (FMainForm->FWindowState == wsMinimized) && ! FMainForm->Visible )
:     {
:           FMainForm->WindowState = wsNormal;
:           FMainForm->Show();
:     }
:     RestoreTopMosts();
:     if( Screen->ActiveControl != NULL )
:     {
:         SetFocus(Screen->ActiveControl->Handle);
:     }
:     if( Assigned(FOnRestore) )
:         FOnRestore(this);
:   }
: }
: //---------------------------------------------------------------------------
:
:
: 박영목 님이 쓰신 글 :
: : Application->Restore(); 이것을 API로 표현하면 어떻게 될까요?
: :
: : 아주 궁금함,......   아시는 분 답변......    부탁드립니다........

+ -

관련 글 리스트
50587 Application->Restore(); 이것을 API로 표현하면 어떻게 될까요? 박영목 1277 2007/09/17
50589     Re:Application->Restore(); 이것을 API로 표현하면 어떻게 될까요? 장성호 1483 2007/09/17
50615         Re:Re:Application->Restore(); 이것을 API로 표현하면 어떻게 될까요? 박영목 1924 2007/09/19
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.