[STL] Insert Iterator Demo

이미지
Front Insert Iterator : 앞부분부터 삽입. 새치기하듯이 삽입되어서, 먼저 들어온 원소가 가장 마지막에 위치하게 된다. Back Insert Iterator : First Com First Serv.방식 온 순서대로 차례로 왼쪽에서 오른쪽으로 삽입된 결과를 나타낸다. Insert Iterator : Sequence Container에서는 원하는 index에 접근해서 삽입이 가능하다. 그러나 Associative Container의 경우 의미를 가지지 못한다. 따라서, 값이 정렬된 상태로 출력된다. #include <iostream> #include <list> #include <vector> #include <set> #include <string> #include <iterator> using namespace std; template<typename Container> void   PrintContainer ( string   strTitle,Container& cont ) ; int   main ( ) {       int   pArray [ 5 ]   =   { 9 , 1 , 4 , 7 , 2 } ;       //Front Insert Iterator     list<int> iList;     copy ( pArray,pArray +5 ,front_inserter ( iList ) ) ;     PrintContainer ( "Front Insert" ,iList ) ;       //Back Insert Iterator     vector<int> iVector;       for ( int   i= 0 ; i< 5 ; i++ ) {         back_inserter ( iVector )   = pArray [ i ] ;       }  

[Win32 API] WNDCLASSEX Structure

Contain window class information. It is used with the RegisterClassEx and GetClassInfoEx functions. The WNDCLASSEX structure is similar to the WNDCLASS structure. There are two differences. WNDCASSEX include the cbSize member, which specifies the size of the structure, and the hIconSm member, which contains a handle to a small icon associated withe the window class. Syntax typedef struct tagWNDCLASSEX { UINT      cbSize; UINT      style; WNDPROC   lpfnWndProc; int       cbClsExtra; int       cbWndExtra; HINSTANCE hInstance; HICON     hIcon; HCURSOR   hCursor; HBRUSH    hbrBackground; LPCTSTR   lpszMenuName; LPCTSTR   lpszClassName; HICON     hIconSm; } WNDCLASSEX, *PWNDCLASSEX; Members cbSize : The size, in bytes, of this structure. Set this member to sizeof(WNDCLASSEX). Be sure to set this member before calling GetClassinfoEx function. style : The class style(s). This member can be any combination of the Class Style. lpfnWndProc : A pointer to the w

[Win32 API] DefWindowProc Function

Calls the default window procedure to provide default processing for any window messages that an application does not process. This function ensures that every message is processed. DefWindowproc is called with the same parameters recieved by the window procedure. Syntax LRESULT WINAPI DefWindowProc( __in  HWND hWnd, __in  UINT Msg, __in  WPARAM wParam, __in  LPARAM lParam ); Parameters Same as WindowProc Function. Return Value The return value is the result of the message processing and depends on the message. Reference :  http://msdn.microsoft.com/en-us/library/ms633572(VS.85).aspx

[Win32 API] WindowProc

An application-defined function that processes messages sent to a window. the WNDPROC type define a pointer to this callback function. Syntax LRESULT CALLBACK WindowProc( __in  HWND hwnd, __in  UINT uMsg, __in  WPARAM wParam, __in  LPARAM lParam ); Parameters hwnd : a handle to the window. uMsg : The message For list of the system-provide messages. see System-Defined Message. wParam : Additional message information. The contents of this parameter depend on the value of th uMsg parameter. lParam : Additional message information. The contents of this parameter depend on the value of th uMsg parameter. Return Value  The return value is the result of the message processing and depend on the message sent. Reference :  http://msdn.microsoft.com/en-us/library/ms633573(VS.85).aspx

[Win32 API] MessageBox Function

Display a modal dialog box that contain a system icon, a set of buttons, and a brief application-specific message, such as status or error information, The message box returns an integer value that indicates which button the user clicked. Syntax int WINAPI MessageBox( __in_opt HWND hWnd, __in_opt LPCTSTR lpText, __in_opt LPCTSTR lpCaption, __in UINT uType ); Parameters hWnd : A handle to the owner window of the message box to be created.If this parameter is NULL, the message box has no owner window. lpText : The message to be displayed. If the string consist of more than one line, you can separate the lines using a carriage return and/or linefeed character between each line. lpCaption : the dialog box title. If this parameter is NULL , the default title is Error. uType: The contents and behavior of the dialog box. This parameter can be a combination of flags from the following group flags. 너무 많다. Link :  http://msdn.microsoft.com/en-us/library/ms645505(VS.85

[Win32 API] MSG Structure

Contain message information from a thread's message queue. Syntax typedef struct tagMSG { HWND   hwnd; UINT   message; WPARAM wParam; LPARAM lParam; DWORD  time; POINT  pt; } MSG, *PMSG, *LPMSG; Members hwnd : A handle to the window whose window procedure receives the message. This member is NULL when the message is a thread message. message : The message identifier.Applications can only use the low word; the high word is reserved by system. wParam : additional information about the message.The exact meaning depends on the value of the message member. lParam : additional information about the message.The exact meaning depends on the value of the message member. time : The time at which the message was posted. pt : The cursur position,in screen coordinates, when the message was posted.

[Win32 API] TranslateMessage()

Translate virtual-key messages into character messages. The character messages are posted to the caling thread's message queue, to be read the next time the thread call the GetMessage or PeekMessage function. Syntax BOOL WINAPI TranslateMessage( __in  const MSG *lpMsg ); Parameters lpMsg ; A pointer to an MSG structure that contains messgae information retrieved from the calling thread's message queue by using the GetMessage or PeekMessage function. Return Value If the message is translate, the return value is nonzero(true). otherwise, the return value is zero(false) If the message is WM-KEYDOWN,WM_KEYUP,WM_SYSTEMDOWN,or WM_SYSTEMUP, the return value is nonzero, regardless of the translation. conceptual :  Message and Message Queues example :  Using Message and Message Queues. Reference :  http://msdn.microsoft.com/ko-kr/library/ms644955.aspx?appId=Dev10IDEF1&l=KO-KR&k=k(CMFCPROPERTYGRIDFONTPROPERTY);k(DevLang-