메모내용

Resource

  • 리소스 편집기를 활용하여 추가적인 리소스를 만들 수 있다.
  • 운영체제가 기본적으로 제공하는 리소스를 사용시, hInstance 인수는 NULL 로 설정합니다.
  • Menu

    사용법

    LOWORD, HIWORD

    32bit os 에서 WORD 는 unsigned short 이다. typedef unsigned short WORD unsigned short 는 2바이트 이며, 0 ~ 65535 까지의 값을 나타낼 수 있다.

                            
    // 2byte 0x0000 
    typedef WORD unsigned short;
    
    // 4byte 0x00000000
    typdef DWORD unsinged long;
    
    #define LOWORD(l) ((WORD)(l))
    #define HIWORD(l) ((WORD)( (DWORD)(l) >> 16 & 0FFFF) )
    
                            
                        
                            
    #include "windef.h"
                                
    DWORD data = 0x12345678;
    
    WORD l_data = LOWORD(data); // 0x5678
                            
                        

    메시지 박스

    구조

    int MessageBox( HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType)

    문자열

    사용법

    리소스 가져오기

                    
                        LoadString(hInstance, IDS_000000, Buffer, BufferSize);
            
                        //예시
                        TCHAR MyString[100];
                        LoadString(hInst, IDS_STRING105, MyString, 100);