|
Thank you very much for every post
written in this thread.
That's what I wanted and expected!
_________<br />
I'm made in C++... and I'm proud of it!
|
|
|
|
|
I did not test the code, which is why I qualified my statement with "I assume." Whether it worked as intended or not, I've no clue.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I totaly agree with you, just wanted to make it clear for the original poster that the code, as it was, wasn't of any help, thus this was corrected.
Thanks again, and regards,
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
I want to find the windowhandle of a dialog application minimized to the system tray.
enumwindow does not find the window, since the window is not visible.
what should I do?
gtz,
Niko
|
|
|
|
|
u can use spy++ from visual studio tools to find any window handle. even minimized. if u know class and caption.
for example. i'be minimized icq. so it doesnot enumarated. but i can c it in this tool.
how to do it programatically. i think use FindWindow with known class and caption
|
|
|
|
|
The window is not minimized to the taskbar but to the systemtray. enumwindows finds minized windows to the taskbar but not when they are minimized to the tray.
I use enumwindows instead of findwindow since it is more stable. I guess both functions do the same thing.
yes, spy++ does find my window. How does spy++ finds its windows?
|
|
|
|
|
systemtray, taskbar - its not a big reason. in both cases main windows are hided.
i won't dispute about stability, but as i said: use findwindow to get handle.
u've caption and u've class, or u dont've? its quite complete info to use this function.
or i dont understand your question.
|
|
|
|
|
Yes, i have the caption.
with enumwindows:
- I find the window when its visible on screen.
- I don't find the window when it is minimized to the tray.
it is simply not listed when using the callback func.
|
|
|
|
|
u dont listen to me.
theme is closed.
|
|
|
|
|
I guess you don't understand the problem.
thank you for your help anyway
|
|
|
|
|
p.s.
// i had outlook in system tray.
HWND hwndOutlook = ::FindWindow(NULL, "Inbox - Microsoft Outlook");
// i got valid handle for this window.
|
|
|
|
|
Using spy++ and find a class of the program. This is safer in my view, 'coz the caption may be changed by a program behaviour or other program.
HWND hWindows = FindWindow("ProgClass", NULL)
_________<br />
I'm made in C++... and I'm proud of it!
|
|
|
|
|
I think you are still confused between a minimized window and a hidden window.
4apai wrote:
// i got valid handle for this window.
Of course, because it was minimized, not hidden.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
ok. lets determine what window should call hidden and what should be call minimized? it looks like demagogy but as i see its necessary.
i want to hear your oppinion!
|
|
|
|
|
EnumWindows() will enumerate all top-level windows on the screen, while EnumDesktopWindows() will enumerate all top-level windows on a desktop.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
...AND...If the system Tray OWNS the minimized window, then you can get the window handle of the system tray and try to enumerate the child windows of it.
One of them is probably the window you want.
|
|
|
|
|
HI,
i have a button with only image no caption on it.
with ID (IDC_BTN_PLAY)
I want that when i place i mouse on that button
or when mouse goes on that button a tool tip
appear " Play button" ;
how i will do that ...
any sample .
thanx
Regards.
|
|
|
|
|
Do this:
messagemap:
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipNotify)
in .h file:
afx_msg BOOL OnToolTipNotify(UINT id, NMHDR *pNMHDR,LRESULT *pResult);
function implementation something like this:
BOOL PbmFlexListViewer::OnToolTipNotify(UINT id, NMHDR *pNMHDR, LRESULT *pResult){<br />
CString tooltiptext2display;<br />
tooltiptext2display = "";<br />
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR; <br />
UINT nID = pNMHDR->idFrom;<br />
if(pTTT->uFlags & TTF_IDISHWND){<br />
nID = ::GetDlgCtrlID((HWND)nID);<br />
switch(nID){<br />
case IDC_PBM_DOWN: tooltiptext2display.Format(IDS_MOVE_ROW_DOWN_PBM);<br />
break;<br />
case IDC_PBM_UP: tooltiptext2display.Format(IDS_MOVE_ROW_UP_PBM);<br />
break;<br />
case IDC_FLEX_NEW_ITEM: tooltiptext2display.Format(IDS_ADD_NEW_ITEM);<br />
break;<br />
case IDC_BUTTON_PRINT: tooltiptext2display.Format(IDS_PBM_FLEXLIST_PRINT);<br />
break;<br />
case IDC_STATIC_ROW_COL:tooltiptext2display.Format(IDS_TOOLTIP_FLEXLIST_STATICCURRENTCELL);<br />
break;<br />
default: tooltiptext2display = "";<br />
break;<br />
}
strcpy(pTTT->szText, tooltiptext2display);<br />
return(TRUE);<br />
}
else{ return FALSE; }
}
DON'T FORGET in OnInitDialog or constructor:
EnableToolTips(true);
good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
|
hallo.
i need your help.
i want to list sessions on a remote terminal server. i use next code:
HANDLE hServer = WTSOpenServer("WMWareComputer");
// hServer is set to NULL;
DWORD dwError = GetLastError();
// dwError is set to 5 (Access Denied)
As i undersatnd i've insufficient access rights on a remote computer.
in documentation i find that i need to have QUERY_INFORMATION access rights to view this specific information.
How can i change access rights?
in the next case i get following results:
HANDLE hServer = WTSOpenServer("RemoteComputer");
// hServer is initialized with a real value, smth like 0x04548343;
DWORD dwError = GetLastError();
// dwError is set to 0 (all is ok)
BOOL bRet = WTSEnumerateSessions(hServer, 0, 1, &wtsSessionInfo, &dwCount);
// bRet is true. all is ok.
// But dwCount is 0. but i know for sure that there're some sessions.
and one more. when i execute those code on specified machines directly, they return good results.
what do i do wrang?
waiting for your ideas, discussions...
|
|
|
|
|
its me again
i found where can i set user access rights on terminal server. and set full control for everyone. but still've the same problem.
what can be wrong?
|
|
|
|
|
What did GetLastError() return from the WTSEnumerateSessions() and did WTSEnumerateSessions() return a non-zero value?
|
|
|
|
|
after enumaratesessions :
GetLastError return 0.
and the result is true (non-zero);
all is ok. looks like it must be so. but it it shioldn't.
|
|
|
|
|
I am sorry I do not know more about your specific problem.
I was trying to help you rule out obvious mistakes, and I only ever enumerated sessions on the local server.
|
|
|
|
|
thx anyway.
thats the way people solve problems here. nobody know everything. everyone know only some specific part.
4apai
There're no impossible tasks. There're tasks that required infinite period of execution time.
|
|
|
|