오래된 새로운 Win32api
이 페이지는 Raymond Chen의 유명한 블로그 The Old New Thing 의 게시물 서브 세트에 대한 링크 목록을 제공합니다. 서브 세트는 주로 Win32API 및 일부 COM 관련 항목으로 제한됩니다.
이 페이지를 유지하는 이유는 종종 MSDN에 누락 된 정보를 제공하거나 암호로 설명되는 정보를 제공하고 블로그를 쉽게 검색 할 수 없기 때문입니다.
여기의 링크는 연대순 순서 대신 주제별로 분류됩니다. 때로는 적절한 경우 단일 게시물이 여러 범주에 넣을 수 있습니다.
일부 (드문 경우) 경우 다른 소스에 대한 링크가 유용한 경우 포함됩니다.
면책 조항 : 나는 연결된 내용의 저자를 주장하지 않습니다. 이것은 Raymond가 수년에 걸쳐 쓴 위대한 기사의 희망적으로 유용한 조직에 관한 것입니다.
목차
- 프로세스 및 스레드
- 프로세스
- 스레드
- 스레드 풀
- 객체의 스레드 친화력
- 스레드 스택
- 섬유
- 동기화
-
WaitOnAddress()
-
WaitForMultipleObjects()
및 친척 - 잠금없는 패턴
- dlls
- 자원
- 비트 맵 및 아이콘 리소스
- 대화 상자 템플릿
- 메뉴 템플릿 및 가속기 리소스
- 문자열 리소스
- 버전 템플릿
- 데이터 및 사용자 정의 리소스
- 응용 프로그램 (전체)
-
HWND
(일반적인 관점) - 최상위 창
- 창 프레임 및 캡션
- DWM
- 대화
- 중첩 및 임베디드 대화 상자
- 일반적인 대화
- 제어 탐색
- 대화 관리자
- 양식
- 속성 시트
- 통제 수단
- 애니메이션 컨트롤
- 버튼
- 콤보 박스
- 컨트롤 편집
- 목록보기
- 풍부한 텍스트 제어
- 스크롤 바
- 정적 컨트롤
- 도구 모음
- 툴팁
- 트랙 바
- 트리 목록보기
- 메시지 처리
- 특정 메시지
- 알림
- 창 구성 및 파괴
- 창 지오메트리 메시지
- 창 그림 메시지
- 창 포커스 메시지
- 키보드 메시지
- 마우스 메시지
- 대화 메시지
- 다른 창 메시지
- 시스템 메시지
- GDI
- 커서
- 브러시
- 펜
- 비트 맵
- DIB
-
LockWindowUpdate()
- 표준 요소 그림
-
UXTHEME.DLL
- 여러 모니터
- 접근성
- com
- COM 인터페이스 선언
- com 아파트
- com 초기화
- com 정적 상점
- Com Marshaling
- com 오류 처리
- com 비동기 인터페이스
- 안내
- com 문자열
- com 변형
-
IUnknown
-
IMoniker
-
ICallback
-
IContextMenu
-
IFileDialog
-
IMultiLanguage
-
INamespaceWalk
-
IStream
-
IVirtualDesktopManager
- 클립 보드
- 드래그 앤 드롭
- 열거
- 껍데기
- 분류되지 않은 com 물건
- 메모리
- 입력 및 출력
- 비동기 입력 및 출력
- 파일 및 디렉토리
- ACL
- 보안 권한, 속성 및 식별자
- 기재
- 줄과 로케일
- NT 서비스
- 분류되지 않은
프로세스 및 스레드
프로세스
-
CreateProcess
프로세스가 시작될 때까지 기다리지 않습니다 -
CreateProcess
함수가 입력 명령 줄을 수정하는 이유는 무엇입니까? - 사람들은 왜
CreateProcess
전화를 잠그는가? - 프로그램 충돌 대화 상자를 비활성화합니다
- 시작할 때 많은 데이터를 프로세스에 어떻게 전달합니까?
-
WinMain
에 대한 hPrevInstance
매개 변수의 목적은 무엇입니까? -
RunAsInvoker
비밀, 더 높은 UAC 설정입니까? - 하위 프로세스가 Windows 오류보고 대화 상자를 표시하는 것을 방지하려면 어떻게해야합니까?
-
WriteProcessMemory
읽기 전용 메모리에 서면으로 성공한 것은 어떻습니까? -
WriteProcessMemory
페이지 보호를 관리하도록하는 것이 좋은 생각입니까? - 내 고가 프로세스에서 비정상적인 프로세스를 시작하려면 어떻게해야합니까, redux
- 내 프로세스의 무결성 수준을 어떻게 확인할 수 있습니까?
- 구조화 된 예외 핸들러에서 구조화 된 예외를 올리면 프로세스가 종료되는 것이 사실입니까?
- 작업 개체에서 프로세스를 만드는보다 직접적이고 실수없는 방법
스레드
- 유효하지 않은 스레드 및 프로세스 ID
- 내 스레드 손잡이가 갑자기 갑자기 나빠지는 이유는 무엇입니까? 내가 한 건 기다렸다!
-
_beginthread
및 _beginthreadex
로 전달 된 스레드 콜백에서 단순히 돌아 오면 어떻게됩니까? - 스레드를 중단해서는 안된 이유
- UI 스레드에서 수면의 위험
- 메시지 대기열을 추구합니다
- 프로세스에서 스레드를 열거합니다
- Win32 사용자 인터페이스 작업은 본질적으로 단일 스레드입니다
- 스레드가 종료 된 후 오랫동안 스레드 핸들을 닫는 것이 얼마나 나쁜가요?
- 내가 알 수있는 스레드에 대해
GetExitCodeThread
호출한다면, 왜 종료했는지 왜 여전히 STILL_ACTIVE
라고 말합니까? - 64 비트 시스템에서
CreateRemoteThread
에 문제가 있습니까? -
TerminateThread
함수는 동기입니까? - 작업 대상이 비어있는 대기하는 코드에서
TerminateThread
제거합니다. -
FreeLibraryAndExitThread
의 요점은 무엇입니까? - 스택 커밋 및 스택 리저브에 대한 모순 값을 제공하면 어떻게됩니까?
스레드 풀
-
SetThreadpoolTimer
의 msWindowLength
매개 변수는 정확히 무엇을 의미합니까? -
CreateTimerQueueTimer
와 SetThreadpoolTimer
의 차이점은 무엇입니까? - 스레드 풀 콜백을 취소 할 때 무료 메모리에 액세스하는 것을 피하는 방법
- 스레드 풀 콜백을 취소 할 때 교착 상태 방지, 1 부 : 외부 콜백 데이터
- 스레드 풀 콜백을 취소 할 때 교착 상태 방지, 2 부 : 포함 된 개체를 다시 참조
- GOTCHA : 스레드 풀주기 타이머는 이전 진드기가 완료 될 때까지 기다리지 않습니다.
- 프로세스 종료 중에 스레드 풀에서 예외가 발생하는 이유는 무엇입니까?
- 전달 된 함수에서 반환 된 값은
QueueUserWorkItem
으로 어떻게됩니까? -
StartThreadpoolIo
의 정신 모델 - 스레드 풀 작업 항목이 너무 오래 걸리는 것을 어떻게 감지 할 수 있습니까?
- 스레드 풀을 닫고 대기시킨 모든 작업을 취소하려면 어떻게해야합니까?
객체의 스레드 친화력
- 사용자 인터페이스 객체의 스레드 친화력, 1 부 : 창 핸들
- 사용자 인터페이스 객체의 스레드 친화력, 2 부 : 장치 컨텍스트
- 사용자 인터페이스 객체의 스레드 친화력, 파트 3 : 메뉴, 아이콘, 커서 및 가속기 테이블
- 사용자 인터페이스 객체의 스레드 친화력, 파트 4 : GDI 객체 및 친화력에 대한 기타 메모
- 사용자 인터페이스 객체의 스레드 친화력, 5 부 : 객체 정리
- 사용자 인터페이스 객체의 스레드 친화력 : 부록
스레드 스택
- 런타임에 스레드 스택을 어떻게 확장하려면?
- 섬유를 사용하여 런타임에 스레드 스택을 확장, 파트 1
- 섬유를 사용하여 런타임에 스레드 스택을 확장, 2 부
- 섬유를 사용하여 런타임에 스레드 스택을 확장, 파트 3
- 섬유를 사용하여 런타임에 스레드 스택을 확장, 파트 4
- 섬유를 사용하여 런타임에 스레드 스택을 확장, 파트 5
- 섬유를 사용하여 런타임에 스레드 스택을 확장, 6 부
- 런타임에 스레드 스택을 확장하기 위해 섬유를 스레드와 비교
- 사용 가능한 스택 공간이 대략 얼마나 결정되는지, Part 1
- 사용 가능한 스택 공간이 대략 얼마나되는지, 2 부
섬유
- 스레드가 종료 될 때 스레드에서 실행 된 섬유는 어떻게됩니까?
- 섬유를 사용하는 것은 괜찮지 만 모두가 계획을 가지고 탑승해야합니다.
- 섬유는 더 이상 유용하지 않습니다. 섬유와 관련이없는 이유로 유용한 한 구석이 있습니다.
동기화
-
WAIT_ABANDONED
의 결과를 이해합니다 - Windows 키 이벤트, 중요한 섹션 및 새로운 Vista 동기화 기능
- 독특한 이벤트의 작업 대기열을 자동리스 세트 이벤트와 순서가 중요하지 않습니다.
- 특히 독자와 작가가있을 때 SRW 자물쇠는 얼마나 공정합니까?
- 파일을 동기화 객체로 사용할 수도 있습니다.
- 커널 이벤트가 서명되지 않을 때까지 기다릴 수 있습니까?
-
SRWLOCK
(Slim Reader/Writer Lock)가 공유 잠금 소유자가 누구인지 기억하지 못하면 재귀 적으로 인수해도 괜찮습니까?
WaitOnAddress()
-
WaitOnAddress
데이터 변수, 심지어 바이트에서도 동기화 객체를 만들 수 있습니다. -
WaitOnAddress
측면에서 동기화 장벽을 구현합니다 -
WaitOnAddress
측면에서 중요한 섹션을 구현합니다 - 타임 아웃을 지원하기 위해
WaitOnAddress
기반으로 중요한 섹션을 확장 -
WaitOnAddress
와 Futexes 비교 (Futexi? futexen?) -
WaitOnAddress
에서 세마포어 생성 -
WaitOnAddress
에서 최대 수의 세마포어 생성 -
WaitOnAddress
에서 수동 리셋 이벤트 생성 -
WaitOnAddress
에서 자동 리셋 이벤트 생성
WaitForMultipleObjects()
및 친척
-
MsgWaitForMultipleObjects
및 대기열 상태 - 손잡이가 0으로
MsgWaitForMultipleObjects
에 전화 할 수 있습니다 - 일정 기간을 기다리는 동안 메시지를 펌핑합니다
-
MsgWaitForMultipleObjects
로 모든 핸들을 기다리는 것은 일어나기를 기다리는 버그입니다. - 모든 매개 변수가 나에게 유효 해 보일 때
WaitForMultipleObjects
ERROR_INVALID_PARAMETER
반환하는 이유는 무엇입니까? - 둘 이상의 객체가
WaitForMultipleObjects
가 돌아 오게하는 경우 다른 객체에 대해 어떻게 알 수 있습니까? -
MsgWaitForMultipleObjects
에 절대 서명되지 않은 이벤트를 전달하는 요점은 무엇입니까?
잠금없는 패턴
- 잠금 무료 많은 프로듀서/단일 소비자 패턴 : 작업 대상이있는 작업 대기열
- 잠금 무료 많은 프로듀서/단일 소비자 패턴 : 마지막 사람이이기는 작업 대기열
- 잠금 무료 많은 프로듀서/단일 소비자 패턴 : 동일한 비 응집성 이벤트의 작업 대기
- 잠금 무료 많은 프로듀서/단일 소비자 패턴 : 고유 한 이벤트의 작업 대기열, 순서가 중요하지 않습니다.
- 잠금 무료 많은 프로듀서/단일 소비자 패턴 : 뚜렷한 이벤트의 작업 대기, FIFO
- 잠금 무료 다수/단일 소비자 패턴 : 뚜렷한 이벤트의 작업 대기열, 순서 중요하지 않음, 후속 질문
dlls
- 반환 주소를 믿지 마십시오
- 내가 dllexport의 함수를
GetProcAddress
수없는 이유는 무엇입니까? -
HINSTANCE
와 HMODULE
의 차이점은 무엇입니까? - 정적 라이브러리에서 현재 모듈의
HINSTANCE
에 액세스합니다 -
LoadLibraryEx(DONT_RESOLVE_DLL_REFERENCES)
근본적으로 결함이 있습니다 - DLLS가 "잘못된"순서로 언로드되는 이유는 무엇입니까?
- DLL 기능은 32 비트 창에서 어떻게 내보내나요?
- 실제로 전달자 인 내보내기 기능
- 32 비트 창에 대한 DLL 내보내기가 해결되는 방식을 다시 생각합니다.
- 가져 오기 라이브러리의 이름은 이유를 위해 장식되어 있습니다.
- dllimport가 잘못되면 어떻게됩니까?
- 수입 기능을 위해 스터브를 생성하도록 강요하는 것과 관련된 문제
- 모듈 경계에서 메모리 할당 및 자유화
- DLL 전달은 지연로드와 같지 않습니다
- DLL 가져 오기 힌트 란 무엇입니까?
- DLL 가져 오기 바인딩이란 무엇입니까?
-
FreeLibraryAndExitThread
의 요점은 무엇입니까? -
LOAD_LIBRARY_AS_DATAFILE
(또는 유사한 플래그)을 통해로드 된 라이브러리는 순록 모듈 게임에서 재생되지 않습니다. - 자신의 프로세스에서
GetModuleFileNameEx
호출하는 데 문제가있을 수 있습니까? - 내 DLL이 DLL이있는 동일한 디렉토리에서 DLL 종속성을 해결해야한다고 어떻게 지정할 수 있습니까?
- DLL Delay-Load를 다른 DLL로 만든 후, 내 DLL이 프로세스 분리 코드에서 충돌하기 시작했습니다.
- 다양한 종류의 DLL 심기
-
GetModuleInfo
실행 파일의 진입 점을 생성하지 못하는 이유는 무엇입니까? -
MODULEINFO
구조에서 SizeOfImage
무엇을 의미합니까? -
LoadLibrary
실패 할 때 나타나는 오류 상자를 어떻게 억제합니까?
DllMain()
- 당신의
DllMain
에서 무서운 일을하지 않는 몇 가지 이유 - 당신의
DllMain
에서 무서운 일을하지 않는 또 다른 이유 : 부주의 한 교착 상태 -
DllMain
에서 무서운 일을하지 않는 몇 가지 이유, Part 3 -
DLL_PROCESS_DETACH
알림을받는 스레드는 반드시 DLL_PROCESS_ATTACH notification
받은 스레드가 아닙니다. -
DLL_PROCESS_DETACH
에서 DLL을로드하는 방법조차 깨닫지 못합니다. -
DLL_PROCESS_DETACH
프로세스가 종료되고 있다고 말하면 가장 좋은 방법은 아무것도하지 않고 돌아 오는 것입니다.
자원
- 리소스 컴파일러는
CP_ACP
로 기본값을 얻습니다. 파일이 UTF-8이라는 미묘한 힌트에도 불구하고 - 32 비트 창에서 모듈 리소스와 리소스 파생 객체의 관계
-
FreeResource
와 DestroyAcceleratorTable
의 차이점은 무엇입니까? - PE 리소스는 4 바이트 정렬되어야하지만 사람들이 다른 정렬을 시도하는 것을 막지는 않습니다.
- 누군가가 포인터 안에 정수를 밀수하기 위해
MAKEINTRESOURCE
매크로를 사용했다고 어떻게 말할 수 있습니까? - 끔찍하게 불쾌한 Gotcha :
FindResource
및 FindResourceEx
비트 맵 및 아이콘 리소스
- 장치 독립적 인 비트 맵이 거꾸로 된 이유는 무엇입니까?
- 비트 맵 리소스의 형식
- 아이콘 리소스의 형식
- 아이콘 리소스의 형식, 재 방문
- ICO 파일 형식의 진화, 1 부 : 흑백 시작
- ICO 파일 형식의 진화, 2 부 : 이제 색상!
- ICO 파일 형식의 진화, 파트 3 : 알파 블렌드 이미지
- ICO 파일 형식의 진화, 파트 4 : PNG 이미지
- GDI 비트 맵의 알파 채널을 255로 어떻게 설정합니까?
메시지 문자열 리소스
-
FormatMessage
왜 %0
후행 신성 라인없이 메시지를 종료한다고 말합니까? 비밀리에 Newlines를 추가하고 있습니까?
대화 상자 템플릿
- Win32 대화 상자 템플릿에서 픽셀-완벽한 레이아웃을 얻는 데 어려움
- 대화 상자 템플릿의 진화 - 32 비트 클래식 템플릿
- 대화 상자 템플릿의 진화 - 32 비트 확장 템플릿
- 대화 상자 템플릿의 진화 - 요약
- 리소스 컴파일러는 귀하를 위해 창 스타일을 추가로 추가하지만 대화 상자 템플릿을 직접 구축하는 경우 그 도움을받지 못합니다.
메뉴 템플릿 및 가속기 리소스
- 메뉴 템플릿의 진화 : 소개
- 메뉴 템플릿의 진화 : 32 비트 클래식 메뉴
- 메뉴 템플릿의 진화 : 32 비트 확장 메뉴
- 가속기 테이블 리소스의 형식
문자열 리소스
- 문자열 자원의 형식
-
LoadString
널이 포함 된 문자열로드 될 수 있지만 래퍼 함수는
버전 템플릿
- 버전 리소스의 진화 - 32 비트 버전 리소스
- 버전 리소스의 진화 - 32 비트 버전 리소스 손상
데이터 및 사용자 정의 리소스
응용 프로그램 (전체)
-
Alt+Tab
목록에 어떤 창이 나타나나요? - Windows Vista는
Alt+Tab
순서를 약간 변경했습니다 - Win32 사용자 인터페이스 작업은 본질적으로 단일 스레드입니다
-
STARTF_USESHOWWINDOW
언제 ShowWindow
로 전달 된 매개 변수를 무시합니까? -
WaitForInputIdle
실제로 WaitForProcessStartupComplete
라고해야합니다 -
WaitForInputIdle
모든 스레드를 기다립니다. - 표준 핸들을 관리하기위한 규칙은 무엇입니까?
- 표준 핸들은 실제로 단일 스레드 프로그램을위한 것입니다
- dlls 만
DllMain
알림을받을 수 있다면 스레드가 생성 될 때 EXE가 어떻게 알림을받을 수 있습니까?
명령 줄
- 명령 줄의 첫 번째 단어는 컨벤션 별 프로그램 이름입니다.
-
CommandLineToArgvW
함수는 어떻게 사용 되었습니까? -
CommandLineToArgvW
의 인용 표시와 백 슬래시의 이상한 대우는 무엇입니까?
작업 표시 줄
- 사용자가 내 프로그램을 작업 표시 줄에 고정시키는 것을 어떻게 방지합니까?
- 무언가를 만들고 숨기려고 시도하는 대신 처음에 그것을 만들지 마십시오 (트레이 아이콘).
- 내 응용 프로그램이 실제로 두 개의 응용 프로그램이 단일 파일로 번들로 이루어지고 Windows 7의 작업 표시 줄에서 두 그룹으로 수집하고 싶다면 어떻게해야합니까?
- 작업 표시 줄에 응용 프로그램 Windows가 어떻게 그룹화되는지 사용자 정의하려면 어떻게해야합니까?
- 작업 표시 줄 버튼에 오버레이가 표시됩니다
- 작업 표시 줄 미리보기 창에 제어 버튼을 표시합니다
- 애플리케이션에 대한 사용자 정의 썸네일을 표시하고 (그리고 당신이 그것을하는 동안, 사용자 정의 라이브 미리보기)
- 보조 모니터에서 작업 표시 줄의 위치를 어떻게 쿼리 할 수 있습니까?
- 그 프로그램을 설치할 때 그 프로그램이 작업 표시 줄에 어떻게 고정 되었습니까?
- 논리적으로 단일 응용 프로그램 인 두 가지 프로그램이 있고 작업 표시 줄에서 단일 그룹으로 취급되기를 원한다면 어떻게해야합니까?
- 그룹화 된 Windows의 작업 표시 줄 아이콘이 왜 이상한 것으로 변경됩니까?
HWND
(일반적인 관점)
- 창이 유니 코드가 되려는 것은 무엇을 의미합니까?
- 펑크가 아닌 실제 창 절차 주소를 얻으려면 어떻게해야합니까?
-
GWLP_WNDPROC
에서 반환 된이 이상한 값은 무엇입니까? - 보너스 창은
GWLP_USERDATA
의 바이트 바이트입니다 -
WM_DESTROY
와 WM_NCDESTROY
의 차이점은 무엇입니까? - 창문 보내기
WM_DESTROY
메시지는 경찰 인 척하는 사람을 부르는 장난과 같습니다. -
GetWindowText
의 비밀 생활 -
GetWindowText
의 규칙이 왜 그렇게 이상합니까? - 화면에서 창문이 보이는 경우에만 그림
- 창문이 덮여 있는지 여부를 결정합니다
- 최소화하는 동안 창 크기와 위치를 얻습니다.
-
GetForegroundWindow
SetForegroundWindow
- Windows는 새로 만들어진 창이 LTR 또는 RTL 레이아웃을 사용해야하는지 여부를 어떻게 결정합니까?
Windows 계층
- 데스크탑 창의 특별한 점은 무엇입니까?
- 창 중첩 한계는 무엇입니까?
-
HWND_TOP
과 HWND_TOPMOST
의 차이점은 무엇입니까? - 창은 부모 나 소유자를 가질 수 있지만 둘 다
- 내 컨트롤이 기꺼이 기본 후 잘못된 창에 알림을 보내는 이유는 무엇입니까?
-
WindowFromPoint
, ChildWindowFromPoint
, RealChildWindowFromPoint
, 언제 끝날까요? -
EnumClaw
만큼 혼란 GetParent
실제 기능입니다! ( GetAncestor()
, GetWindow()
) - 다른 프로세스에서 소유자 창이있는 것은 까다 롭지 만 때로는 옳은 일입니다.
- UI 상태를 동기화하는 것에 대해 말해 주려는
SetParent
의 문서는 무엇입니까? - 부모와 자식 창에 다른 UI 상태가있을 때 어떤 일이 발생하는지 보여줍니다.
- 동일한 UI 상태를 갖도록 부모와 자식 창이
창 스타일
- 어떤 창 스타일 비트가 누구에게 속합니까?
- 내 창문이 오른쪽에서 왼쪽으로 레이아웃 규칙을 따르기를 원한다는 것을 어떻게 표시합니까?
- 투명한 정적 제어가 투명하지 않은 이유는 무엇입니까? (
WS_EX_TRANSPARENT
) - 케이크처럼,
WS_EX_TRANSPARENT
거짓말이거나 적어도 모든 진실이 아닙니다. -
WS_EX_COMPOSITED
사용하여 다시 그리기 깜박임을 제거했지만 응답이 느려졌습니다. -
WS_CLIPCHILDREN
어떻게 사용하고 여전히 투명한 배경으로 컨트롤을 그릴 수 있습니까?
창 클래스
-
CreateWindow
및 RegisterClass
에 사용 된 HINSTANCE
는 무엇입니까? -
RegisterClass
에서 잘못된 HINSTANCE
사용하는 것은 신원 도용과 같습니다. -
RegisterClass
함수가 사용자 정의 배경 브러시의 소유권을 가져 오면 왜 누출이 발생합니까? - 창 클래스 변경은 해당 클래스에 속하는 모든 창에 영향을 미칩니다.
-
CS_SAVEBITS
무엇을합니까? -
CS_OWNDC
클래스 스타일은 무엇을합니까? -
CS_CLASSDC
클래스 스타일은 무엇을합니까? -
CS_NOCLOSE
스타일을 수정하면 클래스의 모든 창에 영향을 미치며 반드시 눈에 띄는 방식이 아닙니다. -
PrintWindow
CS_PARENTDC
싫어하는 이유는 무엇입니까? 모두가 CS_PARENTDC
싫어하기 때문입니다! -
PrintWindow
CS_PARENTDC
싫어하는 이유는 무엇입니까? redux - 더 안전한 서브 클래싱
- 개인 클래스, 슈퍼 클래스 및 글로벌 하위 클래싱
-
GetClassName
보다 RealGetWindowClass
훨씬 더 현실적으로 만드는 이유는 무엇입니까? -
CreateWindowEx
연장 스타일 매개 변수를 마지막 대신 첫 번째 매개 변수로 취하는 이유는 무엇입니까? -
CS_GLOBALCLASS
언제 사용해야합니까? -
SetWindowSubclass
호출 할 때 UIDSubclass 매개 변수는 얼마나 독특해야합니까?
최상위 창
창 프레임 및 캡션
- 캡션 아이콘에 대한 사용자 정의 마우스 오른쪽 버튼 클릭 메뉴 가져 오기
- 활성화되지 않은 경우에도 활발한 캡션을 그리십시오
- 하나의 창만 한 윈도우 드래그/크기를 억제하려면 어떻게해야합니까?
- 일반과 전체 화면 사이에서 창을 어떻게 전환합니까?
- 내 캡션 바에서 버튼을 최소화, 최대화 및 닫는 방법을 활성화하고 비활성화하려면 어떻게해야합니까?
- 제목 표시 줄에서 닫기 버튼의 위치 얻기
- Windows 2000 또는 Windows XP에서 제목 표시 줄에서 닫기 버튼의 위치를 가져옵니다.
- 최대화 된 창의 치수가 모니터보다 큰 이유는 무엇입니까?
- 한 방향으로 만 크기를 조정할 수있는 창 만들기
-
WM_GETMINMAXINFO
전달하고 결과를 클램핑하지 않겠습니까?
DWM
- 상징적 인 표현을 요청할 때 왜 내 프로그램이
WM_DWMSENDICONICTHUMBNAIL
메시지를받지 않습니까? -
DwmExtendFrameIntoClientArea
기능에 대한 MARGINS
매개 변수는 프레임이 클라이언트 영역으로 얼마나 멀리 확장되는지 제어합니다. - 창을 숨기거나 표시 할 때 발생하는 기본 애니메이션을 어떻게 억제합니까?
- 애플리케이션에 대한 사용자 정의 썸네일을 표시하고 (그리고 당신이 그것을하는 동안, 사용자 정의 라이브 미리보기)
- 쉘에 의해 화면에서 내 창이 억제되었음을 어떻게 감지 할 수 있습니까? ( "창 클로킹")
대화
- 대화 상자를 만들 수없는 이유는 무엇입니까? 신인 실수 #1
- 대화 상자를 만들 수없는 이유는 무엇입니까? 신인 실수 #2
- 대화 상자 절차에서 값을 반환합니다
- 다른 유형의 대화 절차
- 다른 유형의 대화 상자 절차
- 모든 대화 상자에 대한 기본 답변은 "취소"입니다.
- Z- 주문을 회전시킵니다
-
TAB
키를 사용하여 비 디 알 로그를 탐색합니다 -
TAB
키를 사용하여 비 디 알 로그에서 탐색, redux - 대화 상자에서 제어 텍스트 편집 텍스트 편집 방지
- 대화 관리자를 이해하지 못하는 사람들은 그것을 다시 시개 할 운명입니다.
-
WM_GETDLGCODE
의 다른 트릭 -
GetDialogBaseUnits
그릇입니다 -
MapDialogRect
매핑 대화 상자가없는 이유는 무엇입니까? - 대화 상자가 처음에 숨겨져있는 이유는 무엇입니까?
-
DS_SHELLFONT
플래그와의 거래는 무엇입니까? -
DS_SHELLFONT = DS_FIXEDSYS | DS_SETFONT
? - 대화 상자에서 초점을 설정하는 방법
- 장애인 통제에 집중하지 마십시오
- 이전 창 위치를 복원하는 미묘함
- 이미 알고있는 것 : 무언가를하기 전에 대화 상자가 표시 될 때까지 어떻게 기다려야합니까?
-
TranslateAccelerator
무엇을합니까? - 사용자 정의 가속기가있는 Modeless 대화 상자가있는 경우 먼저 전화해야합니다.
IsDialogMessage
또는 TranslateAccelerator
- 부드러운 알림 : 대화 상자에서 확인하지 말고 가속기를 취소하십시오.
- 숨겨진 컨트롤을위한 가속기가 여전히 활성화되는 이유는 무엇입니까?
- 메인 창에서 사용될 때만 가속기를 모드리스 대화 상자를 사용할 때만 가속기를 적용하려면 어떻게해야합니까?
-
TAB
키가 WS_TABSTOP
로 표시 한 컨트롤에서 왜 작동하지 않습니까? - 대화 상자에서
WM_USER
메시지를 사용할 수 없습니다. - 런타임에 대화 상자를 오른쪽으로 오른쪽으로 만드는 방법은 무엇입니까?
- 대화 상자 관리자는 문자의 평균 너비를 어떻게 계산합니까?
중첩 및 임베디드 대화 상자
-
DS_CONTROL
스타일은 무엇입니까? -
DS_CONTROL
스타일 사용에 대한 더 많은 메모 - 대화 상자에 여러 컨트롤을 동일한 ID를 제공하는 것은 좋은 생각이 아닙니다.
- 다른 사람 안에 대화 상자를 포함시킬 때 실수로 중복 제어 ID를 생성하지 않도록하십시오.
- 기본 푸시 버튼이 호출되면 호출은 최상위 대화 상자로 이동합니다.
일반적인 대화
- 내
MessageBox
올바른 위치에 랩핑되지 않는 이유는 무엇입니까? - 파일 열기 대화 상자의 좋아하는 링크 섹션을 사용자 정의하려면 어떻게해야합니까?
- 공통 파일 대화 상자가 현재 디렉토리를 변경하는 이유는 무엇입니까?
- 공통 파일 대화 상자를 와일드 카드로 필터링 할 수 있습니다
- 프린터 찾기 대화 상자를 프로그래밍 방식으로 어떻게 표시합니까?
- 공유 폴더의 열린 파일 목록 스냅인이 내 열린 파일을 모두 표시하지 않는 이유는 무엇입니까?
- 연장 연관을위한 일반적인 제어는 기한이 지났습니다
- 폴더 브라우징에 나타나는 폴더 필터링 대화 상자
- 미리 선택된 특정 폴더를 사용하여 클래식 폴더 브라우저 대화 상자 열기
- 공통 파일 저장 대화 상자가 임시 파일을 생성 한 다음 삭제하는 이유는 무엇입니까?
- 표준 색상 피커 대화 상자를 사용자 정의합니다
- 파일 열기 대화 상자의 초기 디렉토리를 가상 디렉토리로 설정하려면 어떻게해야합니까?
- 파일 열기 대화 상자에서 여러 파일을 선택하면 마지막 항목이 먼저 오는 이유는 무엇입니까?
-
OPENFILENAME
구조에서 OFN_NONETWORKBUTTON
옵션을 설정했지만 탐색 창의 네트워크 항목에는 영향을 미치지 않습니다. - 공통 파일 열기 또는 파일 저장 대화 상자에 사용자 정의 컨트롤을 추가하려면 어떻게합니까?
-
FileOpenPicker
또는 FolderPicker
가 선택한 것과 동일한 폴더에서 FileSavePicker
열도록하려면 어떻게해야합니까? (게시물 끝에서 언급 된 win32/com 동등성)
제어 탐색
-
TAB
키를 사용하여 비 디 알 로그를 탐색합니다 -
TAB
키를 사용하여 비 디 알 로그에서 탐색, redux - 가속기의 UI 상태 관리 및 초점 사각형
- 대화 상자의 사용자 정의 탐색, redux
- 대화 상자는 마지막으로 전환했을 때 초점을 맞춘 컨트롤에 초점을 맞 춥니 다. 내 자신의 창문에 대한 그 행동에 어떻게 들어가나요?
- 내 Win32 대화 상자에서 비 회로 탭 순서 또는 다른 유형의 사용자 정의 순서를 어떻게 만들 수 있습니까?
대화 관리자
- 대화 관리자, 1 부 : 워밍업
- 대화 상자 관리자, 2 부 : 프레임 창 만들기
- 대화 상자 관리자, 3 부 : 컨트롤 생성
- 대화 상자 관리자, 4 부 : 대화 상자 루프
- 대화 상자 관리자, 5 부 : 비 모달 대화 상자를 모달로 변환
- 대화 상자 관리자, 6 부 : 메시지 루프의 미묘함
- 대화 상자 관리자, 7 부 : 메시지 루프의 더 많은 미묘함
- 대화 상자 8 부 : 대화 상자의 사용자 정의 탐색
- 대화 상자 9 부 : 대화 상자의 사용자 정의 가속기
양식
- Windows를 비활성화하고 활성화하기위한 올바른 순서
- 양식, 1 부 : UI- 모드 vs 코드 모달
- 양식, 2 부 : 코드 모달성 대 UI- 모드
- 양식, 3 부 :
WM_QUIT
메시지 - Modality, Part 4 : Modal UI의 올바른 소유자를 설정하는 것의 중요성
- Modality, 5 부 : Modal UI의 올바른 소유자 설정
- Modality, Part 6 : Modal이 사라진 프로그램과 상호 작용
- Modality, Part 7 : 시간이 지정된
MessageBox
, 저렴한 버전 - 양식, 8 부 : 시간이 지정된
MessageBox
, 더 나은 버전 - Modality, Part 9 : Modal UI의 올바른 소유자 설정, 실제 시험
- 스레드 메시지는 모달 루프에 의해 섭취됩니다
- 메시지 필터를 통해 모달 루프에서 스레드 메시지를 구출합니다
속성 시트
-
DS_SHELLFONT
속성 시트 페이지에서 어떤 영향을 미칩니 까? -
PSM_ISDIALOGMESSAGE
IsDialogMessage
대화 상자에 이르기 때문에 Modeless 속성 시트입니다. - 자신의 보너스 데이터로
PROPSHEETPAGE
구조를 확장 할 수 있습니다. -
PSN_SETACTIVE
알림은 마법사 페이지가 활성화 될 때마다 전송됩니다. -
PROPSHEETPAGE
구조에 추가 페이로드를 추가합니다 - 가변 크기의
PROPSHEETPAGE
구조 배열을 속성 시트로 어떻게 전달합니까?
통제 수단
- 당신이 컨트롤이라고해서 당신이 반드시 대화 상자 안에 있다는 것을 의미하지는 않습니다.
애니메이션 컨트롤
- 쉘 애니메이션 컨트롤의 한계
- 버전 6 애니메이션 컨트롤이 배경 스레드를 사용하지 않는 이유는 무엇입니까?
버튼
-
BS_PUSHLIKE
버튼 스타일은 무엇입니까? (사용하지 말고 요즘 완전히 쓸모가 없습니다. 대신 확인란이나 라디오 버튼을 사용하십시오.)
콤보 박스
- Combobox 또는 Listbox (
WM_SETREDRAW
)에 항목 추가 속도
컨트롤 편집
-
EM_SETHILITE
메시지는 무엇입니까? - 대화 상자에서 제어 텍스트 편집 텍스트 편집 방지
- 비밀번호 편집 컨트롤에서
CapsLock
경고를 억제하려면 어떻게해야합니까? -
ES_NUMBER
편집 제어 스타일의 초기 역사 -
ES_NUMBER
편집 제어 스타일로 음수를 허용하려면 어떻게해야합니까? - 마이너스 부호를 편집 컨트롤에 입력 할 수 있지만 첫 번째 문자 인 경우에만 어떻게합니까?
목록보기
- 위치가없는 목록보기 뷰
- 접힌 및 전개 된 ListView 항목에 대한 인포꼭지 표시
- 백그라운드의 컴퓨팅 ListView Infotips
-
LVM_HITTEST
와 LVM_INSERTMARKHITTEST
의 차이점은 무엇입니까? - 이미 완벽하게 좋은
LVN_ITEMCHANGED
알림이있을 때 왜 LVN_ODSTATECHANGED
알림이 있습니까? - 일부 항목에서 확인란이있는 ListView 만들기는 있지만 다른 항목은 아닙니다.
- 내용에 맞게 ListView 열을 프로그래밍 방식으로 크기를 조정하려면 어떻게해야합니까?
- ListView 항목에 대한 비활성화 된 확인란을 어떻게 작성합니까?
- Combobox 또는 Listbox (
WM_SETREDRAW
)에 항목 추가 속도
풍부한 텍스트 제어
머레이 사르 젠트 (Murray Sargent)의 풍부한 통제의 역사 (게시물은 https://blogs.msdn.microsoft.com/murrays/2006/10/19/Some-Richedit-history/에 대한 링크입니다.- 전체 파일을 풍부한 텍스트 제어에로드하려면 어떻게해야합니까?
- 32,000 문자 이상을 풍부한 텍스트 제어에 넣으려면 어떻게해야합니까?
- 풍부한 텍스트 제어의 내용을 어떻게 인쇄합니까?
스크롤 바
- 스크래치 프로그램
- 스크롤 바, 2 부
- 스크롤 바, 파트 3 : 페인트 사이클 최적화
- 스크롤 바, 파트 4 : 비례 스크롤 바 추가
- 5 부 : 스크롤 바의 키보드 접근성
- 부록 5 파트 : 키보드 코드의 미묘함
- 스크롤 바 6 부 - 휠
- 스크롤 바 7 부 - 인기 성
- 스크롤 바 파트 8- 통합 대화식 크기 조정
- 스크롤 바 파트 9- 은유 유지
- Scrollbars Part 10-
WM_NCCALCSIZE
메시지에 대한 더 깊은 이해를 향해 - Scrollbars 11 부 :
WM_NCCALCSIZE
메시지에 대한 더 깊은 이해를 향해 - 스크롤 바의 운동에 대한 답변 파트 11
- 스크롤 바 12 부 : 스크롤 바 샘플에
WM_NCCALCSIZE
적용합니다 - Scrollbars redux : Part 12
- 두 가지 유형의 스크롤 바가 있습니다
- 왜
WHEEL_DELTA
100 또는 10과 같은 훨씬 더 편리한 값 대신 120으로 선택 되었습니까? - 수평 스크롤 막대 범위를 처음으로 설정하는 이유는 수직 범위를 설정하고 그 반대도 마찬가지입니까?
- 드래그에 자동 스크롤, 1 부 : 기본 구현
- 드래그에 자동 스크롤, 2 부 : 마우스를 흔들면 왜 스크롤이 더 빨라지는가?
- 드래그에 자동 스크롤, 파트 3 : 마우스 위치를 기반으로 동적 자동 스CROLL
- 드래그에 자동 스크롤, 파트 4 : 탈출 속도를 기반으로 한 동적 자동 스CROLL
- 드래그에 자동 스크롤, 5 부 : 속도를 피하기 위해 스크롤에 흔들림 추가
정적 컨트롤
- 정적 컨트롤은 언제로드 된 이미지를 자동으로 삭제하고 응용 프로그램의 책임은 언제입니까?
탭 컨트롤
- 탭 컨트롤이있는 대화 상자에서 컨트롤을 만드는 방법은 무엇입니까?
- Win32 탭 컨트롤의 자녀를 어떻게 만들어야합니까?
도구 모음
- 왜
TBSTYLE_EX_VERTICAL
과 CCS_VERT
가 있습니까? - 작업 표시 줄에있는 도구 모음을 어떻게 작성합니까?
- 올바른 정렬 도구 모음 버튼을 어떻게 만들려면?
- 점프 목록에서 사용자 정의 작업 생성
툴팁
- 내 위치 툴팁 코딩
- 툴팁에서 사용자 정의 드로우를 사용하여 글꼴을 조정합니다
- 여러 도구를 툴팁에서 하나로 멀티플렉싱합니다
- 도구 텍스트 생성 동적으로 생성
- 비활성화 된 창에 대한 툴팁을 표시 할 수없는 이유는 무엇입니까?
- 초과 문서화
TTM_RELAYEVENT
및 툴팁이 보이는 한 1 초주기 타이머가 발생하는 이유
트랙 바
- 트랙 바를 하나의 장치로 이동하기위한
Ctrl
+Arrow Accelerator 추가 1 부 : 초기 플 런지 - 트랙바를 하나의 장치 만 이동하기위한
Ctrl
+화살표 가속기 추가, 2 부 : 두 번째 시도 - 사용자가 마우스를 사용하여 트랙 바 썸을 5의 배수가 아닌 위치로 드래그하지 못하도록하려면 어떻게해야합니까? 1 부 : 문제를 재구성하십시오
- 사용자가 마우스를 사용하여 트랙 바 썸을 5의 배수가 아닌 위치로 드래그하지 못하도록하려면 어떻게해야합니까? 2 부 : 엄지 손가락 위치를 깎아냅니다
나무 목록보기
-
TVS_CHECKBOXES
스타일은 기발하다. -
TVS_CHECKBOXES
스타일을 사용할 때 누출 된 이미지 목록을 조심하십시오. - 수동으로 트리 뷰 확인란 만들기 : 간단한 상태 이미지 목록
- 수동으로 트리 뷰 확인란 생성 : 클릭에 응답
- 수동으로 트리 뷰 확인란 만들기 : 테마 확인란
- 트리 뷰 확인란 : 끔찍한 역사
- 트리 뷰 확인란 : 확장 확인란 상태
메시지 처리
- 어떤 메시지 번호가 누구에게 속합니까?
- 메시지를 보내는 다양한 방법
- 사용자 정의 메시지를 방송합니다
- 스레드는 언제 창 메시지를받을 수 있습니까?
-
GetKeyState
와 GetAsyncKeyState
의 차이점은 무엇입니까? - 스레드 메시지는 모달 루프에 의해 섭취됩니다
- 메시지 필터를 통해 모달 루프에서 스레드 메시지를 구출합니다
- 창 메시지 필터링의 위험
-
PostMessage
로 키보드 입력을 시뮬레이션 할 수 없습니다 - 일정 기간을 기다리는 동안 메시지를 펌핑합니다
- 메시지 대기열을 추구합니다
- 아니요, 실제로 처리되지 않은 모든 메시지를
DefWindowProc
에 전달해야합니다. - 메시지를 처리 할 코드가 있더라도
DefWindowProc
에 전화 할 수 있습니다. -
Get/SetMessageExtraInfo
무엇을 사용 했습니까? -
GetWindowLongPtr
64 비트 창에서 쓰레기 가치를 반환하는 이유는 무엇입니까? -
TrackMouseEvent
창에서 마우스 이벤트를 추적하지만 이벤트가 창에 속한 경우에만 - 잠금 계층에 메시지 대기열을 포함시키는 것을 잊지 마십시오.
-
SendMessageTimeout
이 타임 아웃에 도달하면 보낸 메시지는 어떻게됩니까? - 왜
WM_COPYDATA
메시지를 PostMessage
수는 없지만 작은 타임 아웃으로 그것을 SendMessageTimeout
? - 마우스 움직임, 페인트 및 타이머 메시지가 필요에 따라 생성 되더라도 대기열에서 끝날 수 있습니다.
- 게시 된 메시지는 나중에 게시 된 경우에도 입력 메시지보다 앞서 처리됩니다.
- 메시지 전용 창이 어떤 종류의 메시지를받을 수 있습니까?
-
DispatchMessageA
및 DispatchMessageW
의 프로토 타입이 동일하다면 왜 둘 다가 있습니까? - 대화 관리자를 이해하지 못하는 사람들은 그것을 다시 시개 할 운명입니다.
- 내부 응용 프로그램 상태를 변경 한 후 마우스 커서의 recalc를 어떻게 트리거 할 수 있습니까?
- 내부 응용 프로그램 상태를 변경 한 후 마우스 커서의 recalc를 트리거하려면 어떻게해야합니까?, 후속 조치
-
GetQueueStatus
와 대기열 상태
훅킹
- What is the
HINSTANCE
passed to SetWindowsHookEx
used for? - How can I get notified when the cursor changes?
- What does the thread parameter to
SetWindowsHookEx
actually mean? - Why does
SetFocus
fail without telling me why?
Specific Messages
알림
- What's the difference between the
wParam
of the WM_NOTIFY
message and the idFrom
in the NMHDR
structure. - Restating the obvious about the
WM_COMMAND
message - Restating the obvious about the
WM_NOTIFY
message
Window Construction and Destruction
- What is the difference between
WM_DESTROY
and WM_NCDESTROY
? - How can I determine the reason why my window is closing? (
WM_CLOSE
)
Window Geometry Messages
- Use
WM_WINDOWPOSCHANGED
to react to window state changes - Use
WM_WINDOWPOSCHANGING
to intercept window state changes
Window Painting Messages
- Paint messages will come in as fast as you let them (
WM_PAINT
) - What happens if I don't paint when I get a
WM_PAINT
message? - What is the implementation of
WM_PRINTCLIENT
? - There's a default implementation for
WM_SETREDRAW
, but you might be able to do better - Speeding up adding items to a combobox or listbox (
WM_SETREDRAW
) - Using
WM_SETREDRAW
to speed up adding a lot of elements to a control
Window Focus Messages
-
WM_KILLFOCUS
is the wrong time to do field validation - The dangers of playing focus games when handling a
WM_KILLFOCUS
message - Why doesn't the
MoveWindow
function generate the WM_GETMINMAXINFO
message?
Keyboard Messages
- How do I respond to the
WM_MENUCHAR
message?
Mouse Messages
- Why is there no
WM_MOUSEENTER
message? - Why do I get spurious
WM_MOUSEMOVE
messages? - Sure, I can get spurious
WM_MOUSEMOVE
messages, but why do they keep streaming in? - How do I get mouse messages faster than
WM_MOUSEMOVE
? - Logical consequences of the way Windows converts single-clicks into double-clicks
- Implementing higher-order clicks
- How slow do you have to slow-double-click for it to be a rename?
- How can I prevent the mouse from moving in response to touch input?
Dialog Messages
- Those who do not understand the dialog manager are doomed to reimplement it, badly
- Managing the UI state of accelerators and focus rectangles (
WM_CHANGEUISTATE
, WM_QUERYUISTATE
and WM_UPDATEUISTATE
) - Untangling the confusingly-named
WM_UPDATEUISTATE
and WM_CHANGEUISTATE
messages - Who sends the initial
WM_UPDATEUISTATE
message? - How can I prevent the keyboard focus rectangle from appearing on a control I created?
- Other tricks with
WM_GETDLGCODE
- How do I prevent multi-line edit controls from eating the Enter key?
- Why do
DLGC_WANTALLKEYS
and DLGC_WANTMESSAGE
have the same value?
Other Window Messages
- The dangers of messing with activation when handling a
WM_ACTIVATE
message - Why does my window get a
WM_ACTIVATE
message when it isn't active? - A timed context menu (
WM_CANCELMODE
) - Pitfalls in handling the
WM_CONTEXTMENU
message ( WM_CONTEXTMENU
) -
WM_NCHITTEST
is for hit-testing, and hit-testing can happen for reasons other than the mouse being over your window - How likely is it that a window will receive a
WM_NULL
message out of the blue? ( WM_NULL
) - Why is there a special
PostQuitMessage
function? ( WM_QUIT
) - How does
PostQuitMessage
know which thread to post the quit message to? ( WM_QUIT
) - Who is responsible for destroying the font passed in the
WM_SETFONT
message? ( WM_SETFONT
) - When I send a
WM_GETFONT
message to a window, why don't I get a font? ( WM_GETFONT
) - If my
WM_TIMER
handler takes longer than the timer period, will my queue fill up with WM_TIMER
messages? - Killing a window timer prevents the
WM_TIMER
message from being generated for that timer, but it doesn't retroactively remove ones that were already generated
System Messages
- If one program blocks shutdown, then all programs block shutdown (
WM_QUERYENDSESSION
, WM_ENDSESSION
) - Why do I have to return this goofy value for
WM_DEVICECHANGE
? ( WM_DEVICECHANGE
) - Windows doesn't close windows when a user logs off; that's your call (
WM_ENDSESSION
) - Once you return from the
WM_ENDSESSION
message, your process can be terminated at any time ( WM_ENDSESSION
)
GDI
- Why are
RECT
s endpoint-exclusive? - Can you create an information context for the display?
- What does the
CS_OWNDC
class style do? - What does the
CS_CLASSDC
class style do? - How do you detect "Large Fonts"? (DPI)
- Drawing a monochrome bitmap with transparency
- Let GDI do your RLE compression for you
- The mysterious stock bitmap: There's no way to summon it, but it shows up in various places
- Why is my icon being drawn at the wrong size when I call
DrawIcon
? - You must flush GDI operations when switching between direct access and GDI access, and direct access includes other parts of GDI
- How do I get the dimensions of a cursor or icon?
- What are the dire consequences of not selecting objects out of my DC?
- Of what use is the
RDW_INTERNALPAINT
flag? - Functions that return GDI regions rarely actually return regions
- Color-aware ClearType requires access to fixed background pixels, which is a problem if you don't know what the background pixels are, or if they aren't fixed
- What is the correct way of using
SaveDC
and RestoreDC
? - How are
BitBlt
raster opcodes calculated? - Notes on
DrawText
and tab stops - Why doesn't
GetTextExtentPoint
return the correct extent for strings containing tabs? - Why are there trivial functions like
CopyRect
and EqualRect
? - More on trivial functions like
CopyRect
and EqualRect
- What are the consequences of increasing the per-process GDI handle limit?
- The focus rectangle says, “I'm not orange. I'm just drawn that way.”
Cursors
- The effect of
SetCursor
lasts only until the next SetCursor
- What can or should I do with the cursor handle returned by
SetCursor
? - What is the deal with the
SM_CXCURSOR
system metric? - How do I find out the size of the mouse cursor?
Brushes
- The hollow brush
- Other uses for bitmap brushes
- What is the DC brush good for?
- I know I can change the color of the DC pen, but what about the other attributes?
- How can I extract the color from a solid color GDI brush?
펜
- Is there a difference between creating a null pen with
CreatePen
and just using the stock null pen?
Bitmaps
- How do I set the alpha channel of a GDI bitmap to 255?
DIB
- A survey of the various ways of creating GDI bitmaps with predefined data
- Blitting between color and monochrome DCs
- Manipulating the DIB color table for fun and profit
- Using DIB sections to perform bulk color mapping
- The fun and profit of manipulating the DIB color table can be done without having to modify it
- Separating the metadata from the DIB pixels: Precalculating the
BITMAPINFO
- Separating the metadata from the DIB pixels: Changing the raster operation
- The disembodiment of DIBs from the DIB section
- What is the
hSection
parameter to CreateDIBSection
for?
LockWindowUpdate()
- What does
LockWindowUpdate
do? - How is
LockWindowUpdate
meant to be used? - With what operations is
LockWindowUpdate
meant to be used? - With what operations is
LockWindowUpdate
not meant to be used? - Final remarks on
LockWindowUpdate
Painting Standard Elements
- Rendering standard Windows elements
- Rendering menu glyphs is slightly trickier
- What states are possible in a
DRAWITEMSTRUCT
structure?
UXTHEME.DLL
-
BeginBufferedPaint
: It's not just for buffered painting any more - How do
IsThemeActive
, IsAppThemed
, and IsCompositionActive
differ? - How do I get the tabbed dialog effect on my own custom tabbed dialog?
- How do I revert a control back to its default theme?
Multiple Monitors
- For better performance, set all your monitors to the same color format
- How do I get a handle to the primary monitor?
- Why does the primary monitor have
(0,0)
as its upper left coordinate? - How do I get the color depth of the screen?
- How does the window manager adjust
ptMaxSize
and ptMaxPosition
for multiple monitors?
Accessibility
- Accessibility is not just for people with disabilities
- How to retrieve text under the cursor (mouse pointer)
- How do I set an accessible name on an unlabeled control?
- How can I get notified when some other window is destroyed?
- Using accessibility to monitor windows as they come and go
- How can I write a program that monitors another window for a title change?
- How can I write a program that monitors another window for a change in size or position?
com
Declaring COM Interfaces
- The macros for declaring COM interfaces, revisited: C version
- The macros for declaring COM interfaces, revisited: C++ version
- The macros for declaring COM interfaces, revisited: C++ implementation
- The oracle always tells the truth, even when it is wrong: COM method calls with a user-defined type as a return value (on problems of COM interfaces called from C code)
- The COM interface contract rules exist for a reason
- Giving a single object multiple COM identities, part 1
- Giving a single object multiple COM identities, part 2
- Giving a single object multiple COM identities, part 3
- Giving a single object multiple COM identities, part 4
- How do I consume raw COM interfaces from a Windows Runtime metadata file?
COM Apartments
- The dreaded "main" threading model
- A slightly less brief introduction to COM apartments (but it's still brief)
- Yo dawg, I hear you like COM apartments, so I put a COM apartment in your COM apartment so you can COM apartment while you COM apartment
- What kind of apartment is the private apartment I created via
CLSID_ContextSwitcher
? - Setting up private COM contexts to allow yourself to unload cleanly
- How do you get into a context via
IContextCallback::ContextCallback
? - Using contexts to return to a COM apartment later
- What do the output values from
CoGetApartmentType
mean? - User interface code + multi-threaded apartment = death
- Other problems traced to violating COM single-threaded apartment rules in the shell
- What's the point of
APTTYPE_CURRENT
? I mean, of course I'm current. - How do I get a foothold in the neutral apartment?
- What is so special about the Application STA?
- What does it mean when a call fails with
0x8000001F = RO_E_BLOCKED_CROSS_ASTA_CALL
?
COM Initialization
- What does the
COINIT_SPEED_OVER_MEMORY
flag to CoInitializeEx
do? - Crashing in COM after I call
CoUninitialize
, how can COM be running after it is uninitalized?
COM Static Store
- The COM static store, part 1: Introduction
- The COM static store, part 2: Race conditions in setting a singleton
- The COM static store, part 3: Avoiding creation of an expensive temporary when setting a singleton
- The COM static store, part 4: Aggregating into a single object
- The COM static store, part 5: Using COM weak references
- The COM static store, part 6: Using C++ weak references
COM Marshaling
- What is COM marshaling and how do I use it?
- On proper handling of buffers in COM and RPC methods
- What are the rules for
CoMarshalInterThreadInterfaceInStream
and CoGetInterfaceAndReleaseStream
? - What are the rules for
CoMarshalInterface
and CoUnmarshalInterface
? -
CoGetInterfaceAndReleaseStream
does not mix with smart pointers - The COM marshaller uses the COM task allocator to allocate and free memory
- Why do I get a
QueryInterface(IID_IMarshal)
and then nothing? - We batched up our COM requests and return a single stream of results, but the performance is still slow
- What are the various usage patterns for manually-marshaled interfaces?
- An initial look at the mechanics of how COM marshaling is performed
- https://devblogs.microsoft.com/oldnewthing/20220616-00/?p=106757
- Writing a marshal-by-value marshaler, part 1
- Writing a marshal-by-value marshaler, part 2
- Writing a compound marshaler
- Understanding the marshaling flags: The free-threaded marshaler
COM Error Handling
- What happens to my COM server-side object when clients die unexpectedly?
- Why does COM require output pointers to be initialized even on failure?
- How do I convert an
HRESULT
to a Win32 error code? - How can I tell the WIL
RETURN_IF_FAILED
macro that some errors are ignorable? - Do not overload the
E_NOINTERFACE
error - What does it mean when a call fails with
0x8000001F = RO_E_BLOCKED_CROSS_ASTA_CALL
? - What does it mean when my cross-thread COM call fails with
RPC_E_SYS_CALL_FAILED
? - Understanding a mysterious
RPC_E_WRONGTHREAD
exception when we're on the right thread
COM Asynchronous Interfaces
- COM asynchronous interfaces, part 1: The basic pattern
- COM asynchronous interfaces, part 2: Abandoning the operation
- COM asynchronous interfaces, part 3: Abandoning the operation after a timeout
- COM asynchronous interfaces, part 4: Doing work while waiting for the asynchronous operation
- COM asynchronous interfaces, part 5: The unreliable server
- COM asynchronous interfaces, part 6: Learning about completion without polling
- COM asynchronous interfaces, part 7: Being called directly when the operation completes
- COM asynchronous interfaces, part 8: Asynchronous release, the problems
- COM asynchronous interfaces, part 9: Asynchronous release, assembling a solution
GUIDs
- What's the difference between
UuidFromString
, IIDFromString
, CLSIDFromString
, GUIDFromString
... - What is the difference between
UuidToString
, StringFromCLSID
, StringFromIID
, and StringFromGUID2
? - Why are there four functions for parsing strings into GUIDs, and why are they in three different DLLs?
- Why does COM express GUIDs in a mix of big-endian and little-endian? Why can't it just pick a side and stick with it?
COM Strings
- Why is there a
BSTR
cache anyway? - Raymond's complete guide to
HSTRING
semantics - What is the correct way of using the string buffer returned by the
WindowsPreallocateStringBuffer
function?
COM Variants
- What's the difference between
VARIANT
and VARIANTARG
? - Nasty gotcha:
VarCmp
vs VariantCompare
- Why can't
VarDateFromStr
parse back a Hungarian date that was generated by VarBstrFromDate
?
IUnknown
- The layout of a COM object
- Under what conditions will the
IUnknown::AddRef
method return 0? - The ways people mess up
IUnknown::QueryInterface
- The ways people mess up
IUnknown::QueryInterface
, episode 2 - The ways people mess up
IUnknown::QueryInterface
, episode 3 - The ways people mess up
IUnknown::QueryInterface
, episode 4 - COM object destructors are very sensitive functions
- Avoiding double-destruction when an object is released
- I'd like an
IUnknown
, I know you have many, I'll take any of them - A very brief introduction to patterns for implementing a COM object that hands out references to itself
- Giving a single object multiple COM identities, part 1
- Giving a single object multiple COM identities, part 2
- Giving a single object multiple COM identities, part 3
- Giving a single object multiple COM identities, part 4
- Reducing chattiness by querying for multiple interfaces at once, part 1
- Reducing chattiness by querying for multiple interfaces at once, part 2
IMoniker
- Pidls and monikers do roughly the same thing, just backwards
ICallback
- A very brief introduction to patterns for implementing a COM object that hands out references to itself
IContextMenu
- Why an object cannot be its own enumerator
- How to host an
IContextMenu
, part 1 - Initial foray - How to host an
IContextMenu
, part 2 - Displaying the context menu - How to host an
IContextMenu
, part 3 - Invocation location - How to host an
IContextMenu
, part 4 - Key context - How to host an
IContextMenu
, part 5 - Handling menu messages - How to host an
IContextMenu
, part 6 - Displaying menu help - How to host an
IContextMenu
, part 7 - Invoking the default verb - How to host an
IContextMenu
, part 8 - Optimizing for the default command - How to host an
IContextMenu
, part 9 - Adding custom commands - How to host an
IContextMenu
, part 10 - Composite extensions - groundwork - How to host an
IContextMenu
, part 11 - Composite extensions - composition - Simplifying context menu extensions with
IExecuteCommand
- How do I launch a file as if it were a text file, even though its extension is not
.txt
? - Do not access the disk in your
IContextMenu
handler, no really, don't do it - Sure, we do that: Context menu edition
- Psychic debugging: Why your
IContextMenu::InvokeCommand
doesn't get called even though you returned success from IContextMenu::QueryContextMenu
- Don't forget to implement canonical names for verbs in your shell context menu extension
IFileDialog
- The
SetClientGuid
method of the common file and folder dialogs lets you give names to those dialogs, too (multiple contexts for open/save dialogs) - How can I get my
FileSavePicker
to open in the same folder that was picked by the FileOpenPicker
or FolderPicker
? (win32/COM equivalent mentioned at the end of the post) - Why does IFileDialog still show non-filesystem folders when I pass
FOS_FORCEFILESYSTEM
?
IMultiLanguage
- Converting between
LCID
s and RFC 1766 language codes - Feel free to stop using
IMultiLanguage2::DetectInputCodepage
INamespaceWalk
- How can I control which parts of the shell namespace the
INamespaceWalk::Walk
operation will walk into? - How can I cancel the
INamespaceWalk::Walk
operation? - Cancelling the
INamespaceWalk::Walk
operation a little faster
IStream
- The subtleties of
CreateStreamOnHGlobal
, part 1: Introduction and basic usage - The subtleties of
CreateStreamOnHGlobal
, part 2: Suppressing the deletion of an unknown HGLOBAL
- The subtleties of
CreateStreamOnHGlobal
, part 3: Suppressing the deletion of a shared HGLOBAL
- The subtleties of
CreateStreamOnHGlobal
, part 4: Non-movable memory - A practical use for
GetHGlobalFromStream
when sharing was never your intention
IVirtualDesktopManager
- Virtual desktops are an end-user window management feature, not a programmatic one
Clipboard
- How ownership of the Windows clipboard is tracked in Win32
- What happens when applications try to copy text by sending
Ctrl+C
- How do I make it so that users can copy static text on a dialog box to the clipboard easily?
- What is the proper handling of
WM_RENDERFORMAT
and WM_RENDERALLFORMATS
? - Copying a file to the clipboard so you can paste it into Explorer or an email message or whatever
- Printing the contents of the clipboard as text to
stdout
- Improving the performance of
CF_HDROP
by providing file attribute information - What's up with the
CF_SYLK
and CF_DIF
clipboard formats? - How can I wait more than 30 seconds for a delay-rendered clipboard format to become rendered?
Drag and Drop
- What a drag: Dragging text
- What a drag: Dragging a Uniform Resource Locator (URL)
- What a drag: Dragging a Uniform Resource Locator (URL) and text
- What a drag: Dragging a virtual file (
HGLOBAL
edition) - What a drag: Dragging a virtual file (
IStream
edition) - What a drag: Dragging a virtual file (
IStorage
edition) - You can drag multiple virtual objects, you know
- Reading a contract from the other side: Simulating a drop
- Simulating a drop, part two
- What happens if I drag the mouse by exactly the amount specified by
SM_CXDRAG
? - How do I accept files to be opened via
IDropTarget
instead of on the command line? - How do I accept files to be opened via
IDropTarget
instead of on the command line? - bonus content - Using Explorer's fancy drag/drop effects in your own programs
- Drag/drop effects: The little drop information box
- Why isn't my shell namespace extension getting every single
DragOver
mouse message? - Why doesn't my program get fancy drag/drop effects in high contrast mode with
CLSID_DragDropHelper
?
열거
- Using fibers to simplify enumerators, part 1: When life is easier for the enumerator
- Using fibers to simplify enumerators, part 2: When life is easier for the caller
- Using fibers to simplify enumerators, part 3: Having it both ways
- Using fibers to simplify enumerators, part 4: Filtering
- Using fibers to simplify enumerators, part 5: Composition
껍데기
- When does
SHLoadInProc
unload a DLL? - What does
SHGFI_USEFILEATTRIBUTES
mean? - What's the difference between
SHGetMalloc
, SHAlloc
, CoGetMalloc
, and CoTaskMemAlloc
- Querying information from an Explorer window
- Execute a file as if it were a program, even though its extension is not
EXE
- How do I launch a file as if it were a text file, even though its extension is not
.txt
? - What does the
SEE_MASK_UNICODE
flag in ShellExecuteEx
actually do? - Simple things you can do with the
ShellExecuteEx
function - What were
ShellExecute
hooks designed for? - Why does
ShellExecute
return SE_ERR_ACCESSDENIED
for nearly everything? - How do I
ShellExecute
a file, but with a specific program instead of the default program? - What is the difference between
CSIDL_DESKTOP
and CSIDL_DESKTOPDIRECTORY
? -
SHCIDS_CANONICALONLY
is the moral equivalent in the shell namespace of the Unicode ordinal comparison - Don't forget to double-null-terminate those strings you pass to
SHFileOperation
- Why does
SHFileOperation
have internal error codes for DVD? - Why do non-folders in my shell namespace extension show up in the folder tree view?
-
SHAutoComplete
giveth, and SHAutoComplete
taketh away - What is the
lpClass
member of SHELLEXECUTEINFO
used for? - Some known folders cannot be moved, but others can, and you'll just have to accept that
- One possible reason why
ShellExecute
returns SE_ERR_ACCESSDENIED
and ShellExecuteEx
returns ERROR_ACCESS_DENIED
- Why does
SHGetSpecialFolderPath
take such a long time before returning a network error? - How do you obtain the icon for a shortcut without the shortcut overlay? (
SHGetFileInfo()
) - How can I get information about the items in the Recycle Bin?
- Modernizing our simple program that retrieves information about the items in the Recycle Bin
- Invoking commands on items in the Recycle Bin
- How do I perform shell file operations while avoiding shell copy hooks?
- Command line tool to manage Windows 7 Libraries, with source code (
IShellLibrary
) -
IShellFolder::BindToObject
is a high-traffic method; don't do any heavy lifting - Obtaining the parsing name (and pidl) for a random shell object
- Creating a simple pidl: For the times you care enough to send the very fake
- Creating a simple shell item, just as fake as a simple pidl
- Displaying a property sheet for multiple files
- How do I get a high resolution icon for a file?
- How do I extract an icon at a nonstandard size if
IExtractIcon::Extract
tells me to go jump in a lake? - How do I read the "Double-click to open an item (single-click to select)" setting in Folder Options?
- The wonderful world of shell bind context strings
- Helper functions to make shell bind contexts slightly more manageable
- Customizing item enumeration with
IShellItem
- Customizing item enumeration with
IShellItem
, the old-fashioned way - How do I create an
IShellItemArray
from a bunch of file paths? - How do I invoke a verb on an
IShellItemArray
? - How does a shell namespace extension provide icons for virtual items that track the standard icons set by the user's file associations?
- How do I get the user-customed name of My Computer or Recycle Bin?
- How do I get the user-customized name of a mapped network drive?
- Enumerating all the programs that can open a particular file extension
- Enumerating all the programs that can launch a particular protocol
- How do I register a command on the desktop background context menu? (And how do I remove one I don't like?)
- How can I get the canonical name for a known folder?
- Peeking inside an
IShellItem
to see what it's made of - Why does
SHGetKnownFolderPath
return E_FAIL
for a known folder? - Why does
SHGetKnownFolderPath
fail when impersonating? - Why can't I use
SHSetKnownFolderPath
to change the location of FOLDERID_LocalAppData
? - How do I programmatically add a folder to my Documents library?
- Why doesn't
SHGetFileInfo
give me customized folder icons? - How can I detect that a shell item refers to a virtual folder, or to a file system inside a file?
- Why is there a limit of 15 shell icon overlays?
- The case of the
SHGetFolderPath(CSIDL_COMMON_DOCUMENTS)
that returned ERROR_PATH_NOT_FOUND
- Why is the
HSHELL_WINDOWDESTROYED
notification raised when a window is hidden, even if it hasn't been destroyed? - Why am I receiving
HCNE_UPDATEDIR
notifications that my code never generates? - Why am I receiving
SHCNE_UPDATEDIR
notifications that my code never generates? - How can I get the original target of a shortcut without applying any 32-bit adjustments?
- How does Explorer calculate the “Date” of a file?
Uncategorized COM Stuff
- The macros for declaring and implementing COM interfaces
- An introduction to COM connection points
- Dispatch interfaces as connection point interfaces
- Adjustor thunks
- What is the underlying object behind a COM interface pointer?
- How to turn off the exception handler that COM "helpfully" wraps around your server
- Shortcuts are serializable objects, which means that they can be stored in places other than just a file
- Why does
IFileOperation
skip junctions even though I passed FOFX_NOSKIPJUNCTIONS
? - Nasty gotcha:
STGM_READ | STGM_WRITE
does not grant read/write access - How can I get the list of programs the same way that Programs and Features gets it?
- How do I obtain the computer manufacturer's name via C++? (
IWbemClassObject
) - The stream pointer position in
IDataObject::GetData
and IDataObject::GetDataHere
is significant - The sad implementation history of COM component categories and why it means you have to click twice to see your newly-installed taskbar toolbar
- How do I request that my out-of-process COM server run unelevated?
- How can a desktop app use a Windows Runtime object that infers UI context from its thread? The
IInitializeWithWindow
pattern ( IInitializeWithWindow
) - How do I protect myself against a COM call that can hang? I'm already running the server out-of-process.
- What can I do about timer build-up when waiting for COM outbound calls to complete?
- Manipulating the positions of desktop icons
- A reminder about the correct way of accessing and manipulating the position of icons on the desktop
- The oracle always tells the truth, even when it is wrong: COM method calls with a user-defined type as a return value (on problems of COM interfaces called from C code)
- Notes on COM aggregation: Obtaining a pointer to your aggregated partner without introducing a reference cycle
- Notes on COM aggregation: How do you implement tear-offs in an aggregated object?
- The theory behind the
IHttpFilter
interface
메모리
- Stupid memory-mapping tricks
- Creating a shared memory block that can grow in size
- Why do I have to pass a valid page protection value to
VirtualAlloc
even if it ignores it? - How can I include/exclude specific memory blocks in user-mode crash dumps?
-
IsBadXxxPtr
should really be called CrashProgramRandomly ( IsBadWritePtr()
et al.) - A closer look at the stack guard page
- The case of the stack overflow exception when the stack is nowhere near overflowing
- How to allocate address space with a custom alignment or in a custom address region
Input and Output
- Mount points, volumes, and physical drives, oh my!
- What's the difference between an asynchronous
PIPE_WAIT
pipe and a PIPE_NOWAIT
pipe? - Be careful when redirecting both a process's
stdin
and stdout
to pipes, for you can easily deadlock - Looking at the problem at the wrong level: Closing a process's
stdin
-
ReadDirectoryChangesW
reads directory changes, but what if the directory doesn't change? - How do
FILE_FLAG_SEQUENTIAL_SCAN
and FILE_FLAG_RANDOM_ACCESS
affect how the operating system treats my file? - I used
FILE_FLAG_SEQUENTIAL_SCAN
but it didn't seem to speed up my sequential scanning - You can use an
OVERLAPPED
structure with synchronous I/O, too - We're currently using
FILE_FLAG_NO_BUFFERING
and FILE_FLAG_WRITE_THROUGH
, but we would like our WriteFile
to go even faster - On using
ILE_FLAG_WRITE_THROUGH
and FILE_FLAG_NO_BUFFERING
for memory-mapped files - On the interaction between the
FILE_FLAG_NO_BUFFERING
and FILE_FLAG_WRITE_THROUGH
flags - Why does my synchronous overlapped
ReadFile
return FALSE
when the end of the file is reached? - Why does
SetFileValidData
fail even though I enabled the SE_MANAGE_VOLUME_NAME
privilege? - Is
GENERIC_ALL
equivalent to GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE
? -
CancelIoEx
can cancel I/O on console input, which is kind of nice -
CancelIoEx
can cancel synchronous I/O, which is kind of nice - Why does
IsPathRelative
return FALSE
for paths that are drive-relative? - The security check happens at the acquisition of the handle
- Taking a shortcut: You can query properties from a volume, and it will forward to the physical drive
- https://devblogs.microsoft.com/oldnewthing/20201023-00/?p=104395
- How do I disassociate a thread from an I/O completion port?
- Is it okay to call
MapViewOfFile
on the same mapping handle simultaneously from different threads? - What are these dire multithreading consequences that the
GetFullPathName
documentation is trying to warn me about? - How can I force a
WriteFile
or ReadFile
to complete synchronously or hang, in order to test something? - How can I perform a
CopyFile
, but also flush the file buffers before the destination handle is closed?
Asynchronous Input and Output
- Developing the method for taking advantage of the fact that the
OVERLAPPED
associated with asynchronous I/O is passed by address - Ready... cancel... wait for it! (part 1)
- Ready... cancel... wait for it! (part 2)
- Ready... cancel... wait for it! (part 3)
- If you're waiting for I/O to complete, it helps if you actually have an I/O to begin with
- Why does my asynchronous I/O complete synchronously?
- If an asynchronous I/O completes synchronously, is the
hEvent
in the OVERLAPPED
structure signaled anyway? - You can use an
OVERLAPPED
structure with synchronous I/O, too - Why does my synchronous overlapped
ReadFile
return FALSE
when the end of the file is reached? - If I issue a second overlapped I/O operation without waiting for the first one to complete, are they still guaranteed to complete in order?
- Why are my file write operations synchronous, even though I opened the file as
FILE_FLAG_OVERLAPPED
? - File-extending writes are not always synchronous, which is entirely within the contract
- Why you might need additional control over the secret event hiding inside the file object
- Why doesn't my asynchronous read operation complete when I close the handle?
- The mental model for
StartThreadpoolIo
- How can I force a
WriteFile
or ReadFile
to complete synchronously or hang, in order to test something? - If I issue multiple overlapped I/O requests against the same region of a file, will they execute in the order I issued them?
- What are the potentially-erroneous results if you don't pass
NULL
as the lpNumberOfBytesRead
when issuing overlapped I/O?
Files and Directories
- The Definitive Guide on Win32 to NT Path Conversion
- How can I tell that a directory is really a recycle bin?
- How can I tell that a directory is weird and should be excluded from the user interface?
- How do I get information about the target of a symbolic link?
- How do I access a file without updating its last-access time?
- How do I show the contents of a directory while respecting the user's preferences for hidden and super-hidden files as well as the user's language preferences?
- You can use a file as a synchronization object, too
- How can I append to a file and know where it got written, even if the file is being updated by multiple processes?
- The
FILE_FLAG_DELETE_ON_CLOSE
flag applies to the handle, also known as the file object, which is not the same as the file - How long do I have to keep the
SECURITY_ATTRIBUTES
and SECURITY_DESCRIPTOR
structures valid after using them to create a file? - How do I create a directory where people can create subdirectories but cannot mess with those created by other users?
- How can I tell whether a file is on a removable drive, a fixed drive, or a remote drive?
- How can I tell whether a file is on an SSD?
- Why does a non-recursive
ReadDirectoryChangesW
still report files created inside subdirectories? - The early history of Windows file attributes, and why there is a gap between System and Directory
- Even if you open a file with GUID, you can still get its name, or at least one of its names (
GetFinalPathNameByHandle()
) - How do I get from a file path to the volume that holds it?
- How do I get from a volume to the physical disk that holds it?
- Renaming a file is a multi-step process, only one of which is changing the name of the file
- How can I recognize file systems that don't support 64-bit unique file identifiers?
- How can I recognize whether two handles refer to the same underlying file?
ACL
- The
MoveSecurityAttributes
policy affects only how Explorer recalculates ACLs when a file is moved; everybody else is on their own - How to create a folder that inherits its parent's ACL, and then overrides part of it
Security Permissions, Attributes and Identifiers
- The security check happens at the acquisition of the handle
- What is the default security descriptor?
- How do I convert a SID between binary and string forms?
- What are these SIDs of the form
S-1-15-2-xxx
? - What are these SIDs of the form
S-1-15-3-xxx
? - An easy way to determine whether you have a particular file permission
- What are the access rights and privileges that control changing ownership of an object?
- How do the names in the file security dialog map to access control masks?
- If you ask for
STANDARD_RIGHTS_REQUIRED
, you may as well ask for the moon - A user's SID can change, so make sure to check the SID history
- Detecting whether a SID is well-known SID
- SIDs are really just another a fancy way of creating unique IDs in a decentralized way
- What's the point of giving my unnamed object proper security attributes since unnamed objects aren't accessible outside the process anyway (or are they?)
- Is a SID with zero subauthorities a valid SID? It depends whom you ask
- What's the difference between duplicating the handle to a token and duplicating a token?
- I called
AdjustTokenPrivileges
, but I was still told that a necessary privilege was not held - I called
AdjustTokenPrivileges
, but I was still told that a necessary privilege was not held, redux - The history of the
EncodePointer
function for obfuscating pointers - Additional helpful pseudo-handles: The process token, the thread token, and the effective token
- How can I tell whether my process is running as SYSTEM?
- A brief summary of the various versions of the Security Descriptor Definition Language (SDDL)
- How do I free the pointers returned by functions like
GetTokenInformation
? - A clarification on the multithreading constraints of the
EncryptMessage
function
기재
- Beware of non-null-terminated registry strings
- The performance cost of reading a registry key
- So how bad is it that I'm calling
RegOpenKey
instead of RegOpenKeyEx
? - If I simply want to create a registry key but don't intend to do anything else with it, what security access mask should I ask for?
- How can I programmatically inspect and manipulate a registry hive file without mounting it?
- Why doesn't
RegSetKeySecurity
propagate inheritable ACEs, but SetSecurityInfo
does? - Why does
RegNotifyChangeKeyValue
stop notifying once the key is deleted? - How can I emulate the
REG_NOTIFY_THREAD_AGNOSTIC
flag on systems that don't support it? part 1 - How can I emulate the
REG_NOTIFY_THREAD_AGNOSTIC
flag on systems that don't support it? part 2 - How can I emulate the
REG_NOTIFY_THREAD_AGNOSTIC
flag on systems that don't support it? part 3 - How can I emulate the
REG_NOTIFY_THREAD_AGNOSTIC
flag on systems that don't support it? part 4 - How can I emulate the
REG_NOTIFY_THREAD_AGNOSTIC
flag on systems that don't support it? part 5 - The history of passing a null pointer as the key name to
RegOpenKeyEx
- On the failed unrealized promise of
RegOverridePredefKey
(ie don't use it.)
Strings and Locales
-
TEXT
vs. _TEXT
vs. _T
, and UNICODE
vs. _UNICODE
- The sad history of Unicode
printf
-style format specifiers in Visual C++ - Nasty gotcha:
SetThreadUILanguage
cannot be used to restore the thread UI language - How can
CharUpper
and CharLower
guarantee that the uppercase version of a string is the same length as the lowercase version? (use LCMapStringEx()
in any new code) - Is there a code page that matches ASCII and can round trip arbitrary bytes through Unicode?
- A consequence of being the first to adopt a standard is that you may end up being the only one to adopt it: The sad story of Korean jamo
- The
activeCodePage
manifest element can be used for more than just setting UTF-8 as the active code page - Feel free to stop using
IMultiLanguage2::DetectInputCodepage
- On the proper care and feeding of the enigmatic
GetDistanceOfClosestLanguageInList
function - How can I get
WideCharToMultiByte
to convert strings encoded in UTF-16BE?
NT Services
- Calling
ShutdownBlockReasonCreate
from my service doesn't stop the user from shutting down - What does it mean when my attempt to stop a Windows NT service fails with
ERROR_BROKEN_PIPE
? - How can I configure my Windows NT service to autostart when the system gains Internet access?
- On the confusing names for the Windows service SID types
Uncategorized
- How do I determine the processor's cache line size? (
GetLogicalProcessorInformation()
) - Why are structure sizes checked strictly?
- What's the difference between
CreateMenu
and CreatePopupMenu
? - Why are
HANDLE
return values so inconsistent? - How to retrieve text under the cursor (mouse pointer)
- How to detect programmatically whether you are running on 64-bit Windows
- A timed context menu
- The importance of passing the
WT_EXECUTELONGFUNCTION
flag to QueueUserWorkItem
- If your callback fails, it's your responsibility to set the error code
- The double-click time tells the window manager how good your reflexes are
- The cursor isn't associated with a window or a window class; it's associated with a thread group
- Menu item states are not reliable until they are shown because they aren't needed until then
- How can I display a live screenshot of a piece of another application?
- Converting from a UTC-based
SYSTEMTIME
directly to a local-time-based SYSTEMTIME
- Programmatically uploading a file to an FTP site
- How can you use both versions 5 and 6 of the common controls within the same module?
- How can I tell if Windows Update is waiting for the system to reboot?
- How do I call
SetTimer
with a timer ID that is guaranteed not to conflict with any other timer ID? - A window can't have two timers with the same ID, so how do I assign an ID that nobody else is using?
- What does it mean when a display change is temporary?
- How do I obtain the comment for a share?
- How accurate are the various Windows time-querying functions?
- How can I detect whether the user is logging off?
- Why are timer IDs and dialog control IDs 64-bit values on 64-bit Windows? Did you really expect people to create more than 4 billion timers or dialog controls?
- If you suppress GDI+ background thread, then you are expected to pump messages yourself
- If one program blocks shutdown, then all programs block shutdown (
WM_QUERYENDSESSION
, WM_ENDSESSION
) - When I ask the
GetIpAddrTable
function to sort the results, how are they sorted? - How can I detect that the system is no longer showing a UAC prompt? (
EVENT_SYSTEM_DESKTOPSWITCH
) - How can I get the number of processors in the system, when there are more than 64?
- Why are some system functions exported as stubs instead as forwarders?
- How can I check whether the user has disconnected from the session?
- Why does
PF_VIRT_FIRMWARE_ENABLED
return false even when virtualization is enabled in the firmware? - How can I convert between IANA time zones and Windows registry-based time zones?
- The focus rectangle says, “I'm not orange. I'm just drawn that way.”
- Why does the precise point at which I get a stack overflow exception change from run to run? (structured exception handling aka SEH)
- How do I programmatically reposition monitors in a multiple-monitor system? (
ChangeDisplaySettingsEx()
) - How do I upgrade a 32-bit tick count to a 64-bit one?
- The error code you get might not be the one you want
- How can I find out which processor architectures are supported via emulation by the current system?
- How can I detect whether the system has a keyboard attached? On the
GetRawInputDeviceList
function - Filtering out fake keyboards from the
GetRawInputDeviceList
function - How expensive is
PssCaptureSnapshot
? 얼마나 빠르나요? How much memory does it consume? - What is the
CreateExplorerShellUnelevatedTask
scheduled task? - Under what conditions can I modify the memory that I received in the form a
STGMEDIUM
? - Is it true that raising a structured exception from a structured exception handler terminates the process?
- Why are many Windows user interface elements positioned at multiples of 4 or 8 pixels? (DPI,
DEVICE_SCALE_FACTOR
) - A history of the
fd_set
, FD_SETSIZE
, and how it relates to WinSock - How can I detect programmatically whether Windows is an N or KN version?
- How should I interpret the various values of
NLM_CONNECTIVITY
? - How can I find out the last time a user logged on from C++?
- How can I specify icons for my app to use on the Start menu in high contrast mode?
- How can I add an environment variable to a process launched via
ShellExecuteEx
or IContextMenu
? - Functions that return the size of a required buffer generally return upper bounds, not tight bounds