BYTE bytSave [
2
];
//
// 禁止右键菜单
HMODULE hModule;
FARPROC ProcAddr;
BYTE bytWrite [ 2 ];
bytWrite [ 0 ] = 0xc3 ;
bytWrite [ 1 ] = 0x90 ;
hModule = LoadLibrary ( " user32.dll " );
ProcAddr = GetProcAddress ( hModule , " TrackPopupMenu " );
ReadProcessMemory ( GetCurrentProcess () , ProcAddr , bytSave , 2 , 0 ) ;
WriteProcessMemory ( GetCurrentProcess () ,
ProcAddr ,
bytWrite ,
2 ,
0 ) ;
//
// 还原右键菜单
hModule = LoadLibrary ( " user32.dll " );
ProcAddr = GetProcAddress ( hModule , " TrackPopupMenu " );
WriteProcessMemory ( GetCurrentProcess () , ProcAddr , bytSave , 2 , 0 ) ;
//
// 禁止右键菜单
HMODULE hModule;
FARPROC ProcAddr;
BYTE bytWrite [ 2 ];
bytWrite [ 0 ] = 0xc3 ;
bytWrite [ 1 ] = 0x90 ;
hModule = LoadLibrary ( " user32.dll " );
ProcAddr = GetProcAddress ( hModule , " TrackPopupMenu " );
ReadProcessMemory ( GetCurrentProcess () , ProcAddr , bytSave , 2 , 0 ) ;
WriteProcessMemory ( GetCurrentProcess () ,
ProcAddr ,
bytWrite ,
2 ,
0 ) ;
//
// 还原右键菜单
hModule = LoadLibrary ( " user32.dll " );
ProcAddr = GetProcAddress ( hModule , " TrackPopupMenu " );
WriteProcessMemory ( GetCurrentProcess () , ProcAddr , bytSave , 2 , 0 ) ;