Click here to Skip to main content
15,923,374 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CDocTemplate Constructor Asserts Pin
#realJSOP7-Jan-07 13:55
professional#realJSOP7-Jan-07 13:55 
GeneralRe: CDocTemplate Constructor Asserts Pin
#realJSOP7-Jan-07 14:24
professional#realJSOP7-Jan-07 14:24 
GeneralRe: CDocTemplate Constructor Asserts Pin
PJ Arends7-Jan-07 14:55
professionalPJ Arends7-Jan-07 14:55 
GeneralRe: CDocTemplate Constructor Asserts Pin
Michael Dunn7-Jan-07 18:48
sitebuilderMichael Dunn7-Jan-07 18:48 
GeneralRe: CDocTemplate Constructor Asserts Pin
#realJSOP7-Jan-07 23:25
professional#realJSOP7-Jan-07 23:25 
QuestionDetecting doubleclick on a desktop window - part 2. Pin
PatrykDabrowski7-Jan-07 10:43
PatrykDabrowski7-Jan-07 10:43 
AnswerRe: Detecting doubleclick on a desktop window - part 2. Pin
PatrykDabrowski7-Jan-07 12:03
PatrykDabrowski7-Jan-07 12:03 
AnswerRe: Detecting doubleclick on a desktop window - part 2 - solution? Pin
PatrykDabrowski7-Jan-07 16:37
PatrykDabrowski7-Jan-07 16:37 
Finally I've found a way to filter-out all icons connected WM_LMOUSEDBLCLK messages. My MouseProc() now looks like this:

HOOKTEST2DLL_API LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lParam)
{
MOUSEHOOKSTRUCT *mhs=(MOUSEHOOKSTRUCT *)lParam;
LVHITTESTINFO pinfo;

if(nCode < 0) // do not process the message
{
return CallNextHookEx(m_hhook, nCode, wParam, lParam);
}
else
{
if((nCode==HC_ACTION) && (wParam==WM_LBUTTONDBLCLK))
{
if(mhs->hwnd==m_hwnd_desktop) //==0x10094
{
pinfo.pt=mhs->pt;
if(SendMessage(m_hwnd_desktop,LVM_HITTEST,0,(LPARAM)&pinfo)==-1)
{
PostThreadMessage(m_appthreadid,WM_APP+1,mhs->pt.x,mhs->pt.y);
m_mouseproc_counter++;
}
}
}

return CallNextHookEx(m_hhook, nCode, wParam, lParam);
}
}

It seems to be fine, I'm getting WM_APP+1 messages only when I double-click on desktop window and not on any desktop iconSmile | :)

Well, this leads me to another question:

4) How to find in a system-friendly and Windows compatible way this 'magic' window handle 0x00010094? Using Spy++ I could find out the class name and window name. My current code looks like this:

HWND h1=::FindWindowEx(NULL,NULL,"Progman","Program Manager");
HWND h2=::FindWindowEx(h1,NULL,"SHELLDLL_DefView",NULL);
m_hwnd_desktop=::FindWindowEx(h2,NULL,"SysListView32",NULL);

...and it's working fine, but that's strange that a single line:
m_hwnd_desktop=::FindWindowEx(NULL,NULL,"SysListView32","ListView");

...does NOT work (returns NULL). Is this method 'safe and compatible'?


Pat.
AnswerRe: Detecting doubleclick on a desktop window - part 2. Pin
Naveen7-Jan-07 16:55
Naveen7-Jan-07 16:55 
QuestionMultithreading? Help! Pin
Yonggoo7-Jan-07 8:37
Yonggoo7-Jan-07 8:37 
AnswerRe: Multithreading? Help! Pin
PJ Arends7-Jan-07 9:12
professionalPJ Arends7-Jan-07 9:12 
QuestionUsing Resource ID's [modified] Pin
BlitzPackage7-Jan-07 7:45
BlitzPackage7-Jan-07 7:45 
AnswerRe: Using Resource ID's Pin
PJ Arends7-Jan-07 9:13
professionalPJ Arends7-Jan-07 9:13 
GeneralRe: Using Resource ID's Pin
BlitzPackage7-Jan-07 10:01
BlitzPackage7-Jan-07 10:01 
Questionhooking a function Pin
shaderx7-Jan-07 6:59
shaderx7-Jan-07 6:59 
AnswerRe: hooking a function Pin
Dominik Reichl7-Jan-07 7:48
Dominik Reichl7-Jan-07 7:48 
Questionsign bit Pin
ikbahrian7-Jan-07 5:00
ikbahrian7-Jan-07 5:00 
AnswerYes. Pin
CPallini7-Jan-07 5:28
mveCPallini7-Jan-07 5:28 
AnswerRe: sign bit Pin
Stephen Hewitt7-Jan-07 11:37
Stephen Hewitt7-Jan-07 11:37 
QuestionLink Problem Pin
ytubis7-Jan-07 3:38
ytubis7-Jan-07 3:38 
AnswerRe: Link Problem Pin
CPallini7-Jan-07 4:58
mveCPallini7-Jan-07 4:58 
QuestionKeep a window "Always on Top" Pin
Astricks6-Jan-07 21:25
Astricks6-Jan-07 21:25 
AnswerRe: Keep a window "Always on Top" Pin
Dominik Reichl6-Jan-07 22:55
Dominik Reichl6-Jan-07 22:55 
GeneralRe: Keep a window &quot;Always on Top Pin
Astricks6-Jan-07 23:35
Astricks6-Jan-07 23:35 
GeneralRe: Keep a window &quot;Always on Top Pin
Dominik Reichl6-Jan-07 23:45
Dominik Reichl6-Jan-07 23:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.