Q
quaver
Unregistered / Unconfirmed
GUEST, unregistred user!
我在窗口枚举函数中是这样写的:<br> if getTopWindow(wHandle)>0 then<br> if GetWindowText(wHandle,winName,SizeOf(winName)) > 0 then<br> begin<br> if IsIconic(wHandle) then ShowWindow(wHandle, SW_RESTORE)<br> else BringWindowToTop(wHandle); <br> setForegroundWindow(wHandle);<br> winInstance:=getWindowLong(wHandle,GWL_HINSTANCE);//GWL_WNDPROC也试过;<br> setLength(winModuleName,200);<br> getModuleFileName(WinInstance,pChar(winModuleName),length(winModuleName));<br> winModuleName:=pchar(winModuleName);<br> listbox1.items.Add('文件名:'+winModuleName+'窗口名:'+StrPas(@winName));<br> end;<br> <br>结果winModuleName取值错误(取不到值或为本程序名),请高手赐教。<br>