'개발/C & C++'에 해당되는 글 2건

  1. 2008/03/11 CString to Hex
  2. 2008/03/06 Keep your Window Always On Top

Newer Entries Older Entries

CString to Hex

View Comments

// CString 문자열의 값을 HEX 값(16진수)로 리턴하는 함수입니다.
// 조금 응용하면 다르게 표현도 가능하겠죠 ㅎㅎ

CString ConvertToHex(CString data)
{
     CString returnvalue;
     for (int x = 0; x < data.GetLength(); x++)
     {
          CString temporary;
          int value = (int)(data[x]);
          returnvalue.format("%02X ", value);
          returnvalue += temporary;
     }
     return returnvalue;
}

크리에이티브 커먼즈 라이센스
Creative Commons License
2008/03/11 16:22 2008/03/11 16:22

댓글0 Comments (+add yours?)

트랙백0 Tracbacks (+view to the desc.)

Keep your Window Always On Top

View Comments

윈도우를 항상 위에 보여주는 소스입니다.


Introduction

This article show you how to keep a window always on top.
A friend asked me about this question,I searched it on the internet and found
some codes but none of them works well,so I think it is necessary to write a
article about to help the beginners.


To keep a window always on top,you should do as flowing:
1.Create a Dialog based project(Similarly,you can create other projects).
2.Add flowing declare in *Dlg.h between "{{AFX_MSG" and "AFX_MSG}}"

afx_msg int OnCreate(LPCREATESTRUCT lpRes);


3.Add flowing function in *Dlg.cpp:


int *Dlg::OnCreate(LPCREATESTRUCT lpRes)
{
this->SetWindowPos(&CWnd::wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
return CDialog::OnCreate(lpRes);
}


4.Modify Message map codes,add flowing sentence between BEGIN_MESSAGE_MAP and END_MESSAGE_MAP():


ON_WM_CREATE()


After doing above,compile and build you project,you will find that your window will
keep always on top!That's it ,thank you!


출처 : http://www.codeproject.com/KB/cpp/KeepWindowAlwaysOnTop.aspx


크리에이티브 커먼즈 라이센스
Creative Commons License
2008/03/06 19:14 2008/03/06 19:14

댓글0 Comments (+add yours?)

트랙백0 Tracbacks (+view to the desc.)

Newer Entries Older Entries