IDM错误没有软盘弹窗如何解决怎么解决

当前访客身份:游客 [
当前位置:
想用WH_CBT钩子实现已注册窗口子类化,执行却总是报错,贴上代码,请教怎么回事
// t1.cpp : Defines the entry point for the application.
#include "stdafx.h"
#include "t1.h"
#define MAX_LOADSTRING 100
// Global Variables:
HINSTANCE hI
// current instance
TCHAR szTitle[MAX_LOADSTRING];
// The title bar text
TCHAR szWindowClass[MAX_LOADSTRING];
// the main window class name
// Forward declarations of functions included in this code module:
MyRegisterClass(HINSTANCE hInstance);
InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
HHOOK gHook=NULL;
class CExWnd{
m_hWnd=NULL;
m_lpfnOldWndProc=NULL;
WNDPROC m_lpfnOldWndP
virtual LRESULT CALLBACK DispatchWindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam){
if(uMsg==WM_CREATE){
::MessageBeep(1);
if(uMsg==WM_CLOSE){
DestroyWindow(m_hWnd);
if(uMsg==WM_DESTROY){
::PostMessage(m_hWnd,WM_QUIT,0,0);
return ::DefWindowProc(m_hWnd,uMsg,wParam,lParam);
static LRESULT CALLBACK WindowProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam){
if(WM_NCCREATE==uMsg){
CREATESTRUCT* pCs=(CREATESTRUCT*)lP
CExWnd* pWnd=(CExWnd*)pCs-&lpCreateP
pWnd-&m_hWnd=hW
SetWindowLong(hWnd,GWL_USERDATA,(LONG)pWnd);
return pWnd-&DispatchWindowProc(uMsg,wParam,lParam);
CExWnd* pWnd=(CExWnd*)GetWindowLong(hWnd,GWL_USERDATA);
return pWnd-&DispatchWindowProc(uMsg,wParam,lParam);
return ::DefWindowProc(hWnd,uMsg,wParam,lParam);
CExWnd* pE=NULL;
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
lpCmdLine,
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
pE=new CExW
// TODO: Place code here.
HACCEL hAccelT
// Initialize global strings
LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadString(hInstance, IDC_T1, szWindowClass, MAX_LOADSTRING);
MyRegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
return FALSE;
hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_T1));
// Main message loop:
while (GetMessage(&msg, NULL, 0, 0))
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
TranslateMessage(&msg);
DispatchMessage(&msg);
delete pE;
return (int) msg.wP
FUNCTION: MyRegisterClass()
PURPOSE: Registers the window class.
This function and its usage are only necessary if you want this code
to be compatible with Win32 systems prior to the 'RegisterClassEx'
function that was added to Windows 95. It is important to call this function
so that the application will get 'well formed' small icons associated
ATOM MyRegisterClass(HINSTANCE hInstance)
WNDCLASSEX
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style
= CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = CExWnd::WindowP
wcex.cbClsExtra
wcex.cbWndExtra
wcex.hInstance
wcex.hIcon
= LoadIcon(hInstance, MAKEINTRESOURCE(IDI_T1));
wcex.hCursor
= LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = MAKEINTRESOURCE(IDC_T1);
wcex.lpszClassName = szWindowC
wcex.hIconSm
= LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
return RegisterClassEx(&wcex);
FUNCTION: InitInstance(HINSTANCE, int)
PURPOSE: Saves instance handle and creates main window
In this function, we save the instance handle in a global variable and
create and display the main program window.
LRESULT CALLBACK QWndCbtProc(int nCode,WPARAM wParam,LPARAM lParam){
if(nCode!=HCBT_CREATEWND)
return ::CallNextHookEx(gHook,nCode,wParam,lParam);
HWND hWnd=(HWND)wP
CBT_CREATEWND* ccw=(CBT_CREATEWND*)lP
CExWnd* pWnd=(CExWnd*)ccw-&lpcs-&lpCreateP
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& //此处钩子异常,不知道怎么回事
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& pWnd-&m_lpfnOldWndProc=(WNDPROC)::GetWindowLong(hWnd,GWL_WNDPROC);
assert(pWnd-&m_lpfnOldWndProc);
if(pWnd-&m_lpfnOldWndProc!=CExWnd::WindowProc){
::SetWindowLong(hWnd,GWL_WNDPROC,(LONG)CExWnd::WindowProc);
return ::CallNextHookEx(gHook,nCode,wParam,lParam);
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
hInst = hI // Store instance handle in our global variable
hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance,pE);
//安装钩子
if(gHook==NULL){
gHook=::SetWindowsHookEx(WH_CBT,QWndCbtProc,hInstance,::GetCurrentThreadId());
if (!hWnd){
return FALSE;
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
Processes messages for the main window.
WM_COMMAND - process the application menu
WM_PAINT - Paint the main window
WM_DESTROY - post a quit message and return
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
int wmId, wmE
PAINTSTRUCT
switch (message)
case WM_COMMAND:
= LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
case IDM_ABOUT:
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
case IDM_EXIT:
DestroyWindow(hWnd);
return DefWindowProc(hWnd, message, wParam, lParam);
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code here...
EndPaint(hWnd, &ps);
case WM_DESTROY:
PostQuitMessage(0);
return DefWindowProc(hWnd, message, wParam, lParam);
// Message handler for about box.
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
UNREFERENCED_PARAMETER(lParam);
switch (message)
case WM_INITDIALOG:
return (INT_PTR)TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
return (INT_PTR)FALSE;
共有0个答案
有什么技术问题吗?
孟德军的其他问题
类似的话题超简单几步让斯巴达去广告10102安装后字体问题求告知!好可爱的小面团win10 10074 ISO现在连接已经放出可以下载小娜怎么回事,大家给看看
查看: 2538|回复: 5
IDM6.18怎么老是弹出这个
签到天数: 1 天[LV.1]初来乍到
马上注册,欢迎加入IT之家社区大家庭。
才可以下载或查看,没有帐号?
IDM6.18怎么老是弹出这个对话框,怎么解决
Internet Download Manager has been registered with a fake Serial Number
签到天数: 1049 天[LV.10]以坛为家III
用这个补丁试试
签到天数: 98 天[LV.6]常住居民II
无效序列号!自己再下载一个安装!
签到天数: 99 天[LV.6]常住居民II
本帖最后由 xcmz 于
18:31 编辑
X:\Program Files\Internet Download Manager 删除IDMGrHlp.exe
X:\Program Files\Internet Download Manager目录下建 “新建文本文档.txt” 改名IDMGrHlp.exe
别忘了把IDMGrHlp.exe右击-属性-设为只读........
重启idm就ok了!
注:X:\Program Files\Internet Download Manager为idm安装目录.
签到天数: 990 天[LV.10]以坛为家III
4楼方法可行
签到天数: 344 天[LV.8]以坛为家I
本帖最后由 fvptk 于
23:17 编辑
4楼方法可行的,主要是破解有BUG.用宋国母的就不会这样
版权所有 (C)查看: 2729|回复: 8
IDM下载自动弹出这个,什么问题,求解决
本帖最后由 louisbbe 于
09:24 编辑
IDM(Internet Download Manager)下载弹出这个,我打开浏览器就会自动弹出,特烦人啊,什么问题,求解决
(58.21 KB, 下载次数: 2)
00:29 上传
如弹窗所示,缺少文件,请重装IDM
缺少1文件,请您重新安装此产品(IDM)
卸载后重新安装吧。
这是某会员提供的Internet Download Manager 6.07 build 14破解版
版区有你更精彩: )
卸载重装~~
重装了,现在明白了。原来是用数字优化时清理了一个插件
huanggangpao111
我这个菜鸟我都瞧出来了,需要重装,应该楼主用的是破解版本,然后更新导致的吧
我用下载助手
huanggangpao111 发表于
我这个菜鸟我都瞧出来了,需要重装,应该楼主用的是破解版本,然后更新导致的吧
嗯,你说对极了
Copyright & KaFan & All Rights Reserved.
Powered by Discuz! X3.1( 苏ICP备号 ) GMT+8,

我要回帖

更多关于 idm下载器怎么用 的文章

 

随机推荐