기본 콘텐츠로 건너뛰기

3월, 2013의 게시물 표시

리스트 뷰의 응용

원문보기 1. 콜백항목 리스트 뷰는 컨트롤이 자체적으로 데이터를 관리한다. 그러나 메모리의 낭비가 생기고 데이터를 따로 관리해야 함으로 대량의 데이터를 관리할 경우에는 콜백 항목으로 데이터를 관리하는게 좋다. 콜백항목은  응용프로그램이 직접 리스트 뷰의 데이터를 소유 하고 있다가 리스트 뷰가 출력 또는 정렬을 위해 데이터가  필요할 경우에만 데이터를 제공 해 주는 형식을 말한다. 일괄적으로 데이터를 관리할 수 있다는 점과 메모리가 이중으로 낭비되지 않는다는 장점이 있다. 1-1 콜백항목의 추가 콜백항목을 사용하기 위해서는 일단 항목(아이템)을 추가 할 때 문자열은  LPSTR_TEXTCALLBACK  형식으로, 이미지는  I_IMAGECALLBACK  형식으로 추가를 하게 되면 콜백항목으로 등록이 된다. ex) LVITEM lvi ; lvi . mask = LVIF_TEXT ; lvi . state = 0 ; lvi . stateMask = 0 ; lvi . iSubItem = 0 ; for ( int i = 0 ; i < 5 ; i + + ) { lvi . iItem = i ; lvi . pszText = LPSTR_TEXTCALLBACK ; ListView_InsertItem ( hListView , & lvi ) ; ListView_SetItemText ( hListView , i , 1 , LPSTR_TEXTCALLBACK ) ; ListView_SetItemText ( hListView , i , 2 , LPSTR_TEXTCALLBACK ) ; ListView_SetItemText ( hListView , i , 3 , LPSTR_TEXTCALLBACK ) ; } 1-2 콜백항목의 데이터 처리 콜백항목으로 등록만 해서는 리스트 뷰에 데이터가 나타나지

MSTN VBA - Lession7(폴더 선택하기)

폴더를 선택하는 예제입니다. Dim MyBl As BrowseInfo Dim FList As Long Dim DirName As String Dim SelFolder As String DirName = Space(255) MyBl.sTitle = "Select Root Folder" MyBl.sDisplayName = Space(255) MyBl.ulFlags = Bif_ReturnOnlyFSDirs FList = SHBrowseForFolder(MyBl) SelFolder = SHGetPathFromIDList(FList, DirName) DirName = Left(DirName, InStr(1, DirName, Chr(0)) - 1) If DirName <> "" Then TextBoxFolder.Text = DirName Else TextBoxFolder.Text = "" End If

How to force C# .net app to run only one instance in Windows?

Single Application을 생성하는 예제입니다. [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] static extern bool SetForegroundWindow(IntPtr hWnd); /// /// The main entry point for the application. /// [STAThread] static void Main() { bool createdNew = true; using (Mutex mutex = new Mutex(true, "MyApplicationName", out createdNew)) { if (createdNew) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } else { Process current = Process.GetCurrentProcess(); foreach (Process process in Process.GetProcessesByName(current.ProcessName)) { if (process.Id != current.Id) { SetForegroundWindow(process.MainWindowHandle); break; } } } } }

Resource Compiler Error RC2170 bitmap file filename is not in 3.00 format

출처 THE IMAGINATIONS | 수나미 원문 https://blog.naver.com/imanoos/114581059 Resource Compiler Error RC2170 bitmap file filename is not in 3.00 format 매뉴얼로 PNG파일을 추가했는데 이런 에러가 떴을 경우, .rc 파일을 코드보기로 열어서 해당 파일의 BITMAP이라고 지정된 부분을 PNG로 수정하고 다시 컴파일한다. 별의별 일들이 발생한다니까요~~~