[問題] winsock設定callback function
開發平台(Platform): (Ex: VC++, Gcc, Linux, ...)
win 7
額外使用到的庫(Library Used) (Ex: OpenGL, ...)
winsock
問題(Question):
想要用console寫出evnet-driven的程式, 取得hwnd後欲用setwindowlong或
setclasslong來設定callback function的位置, 但都得到錯誤的代碼...
有沒有前輩有經驗可以分享一下
餵入的資料(Input):
ex:
DWORD dword = SetWindowLong (hwnd, GWL_WNDPROC, (LONG_PTR) WndProc);
if(dword == 0) {
cerr << "setlong: failed\n";
} else {
if(dword == GWL_WNDPROC) {
cerr << "setlong: same\n";
} else cerr << "setlong: not same\n";
}
預期的正確結果(Expected Output):
GWL_WNDPROC
錯誤結果(Wrong Output):
0
程式碼(Code): (請善用置底文標色功能)
as above
補充說明(Supplement):
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.195.13.236
→
01/05 01:51, , 1F
01/05 01:51, 1F
→
01/05 01:56, , 2F
01/05 01:56, 2F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章
11
38