|
Since the progress control is owned by your "main dialog class," good design dictates that only that dialog should interact with the progress control. If some other class needs to interact with the control, it should send/post a message to the owning dialog class, or the owning dialog class should have a public method, that others can call, for setting the control's position.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
I am trying to figure out if the current desktop is the desktop that my interactive service is running on, and I came across the GetInputDesktop function exported by user32.dll. It appears to always return 0 if either the login screen or screen saver or a fast user switching terminal services desktop is active. So, I simply compare the returned HDESK value of that to the value returned by GetThreadDesktop and I have my answer. But since GetInputDesktop is undocumented, I'm wondering if there is another way to get at this information, or if anyone knows anything more specific about the GetInputDesktop function.
Thanks much.
sarah
|
|
|
|
|
|
Yes, GetThreadDesktop is documented. However, GetInputDesktop is not. That is the function I'm curious about.
|
|
|
|
|
My bad. Thread and Input just look so much alike!
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Never worked with this, but there's a documented OpenInputDesktop(), which (quote) "retrieves a handle to the desktop that receives user input. The input desktop is a desktop on the window station associated with the logged-on user."
Would that be of help?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Wat function do i call to get a bool parameter indicating that my window has the focus or not?
/\|-||\/|/\|)
|
|
|
|
|
Use GetFocus() for this.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
GetFocus returns a handle of the window but how can i know that this is the window i want or not?
/\|-||\/|/\|)
|
|
|
|
|
if (GetFocus() == GetDlgItem(IDC_MY_WINDOW)) {
}
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
it didnt work
/\|-||\/|/\|)
|
|
|
|
|
because you don't use it properly...
post your code
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
if (Lp.checkcon2() && (GetFocus() == GetDlgItem(IDD_AUTOMATIC)))
forget about Lp.checkcon2() it is always true
/\|-||\/|/\|)
|
|
|
|
|
hum, what about GetFocus() == m_hWnd ??
moreover, are you sure that GetDlgItem() doesn't return NULL ?!
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
i received this error message
error C2446: '==' : no conversion from 'struct HWND__ *' to 'class CWnd *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
error C2230: '==' : indirection to different types
Error executing cl.exe.
maybe it doesnt work when this is not the main dialog?
/\|-||\/|/\|)
|
|
|
|
|
GetDlgItem() is returning NULL
WHY?
/\|-||\/|/\|)
|
|
|
|
|
Halawlaws wrote:
WHY?
Because no such control having an id IDD_AUTOMATIC exists at the point in which GetDlgItem() is being called.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
Why would that surprise you?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Halawlaws wrote:
if (Lp.checkcon2() && (GetFocus() == GetDlgItem(IDD_AUTOMATIC)))
I've yet to figure out why people do this and then complain that it does not work.
To figure out exactly which part of the above statement is not working, break it up into manageable pieces, like:
CWnd *pWnd1 = GetFocus();
if (pWnd1 != NULL)
{
CWnd *pWnd2 = GetDlgItem(IDD_AUTOMATIC);
if (pWnd2 != NULL)
{
if (pWnd1 == pWnd2)
...
}
} At this point, you should know the return value of GetFocus() and GetDlgItem() and whether they are equal or not.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Halawlaws wrote:
...but how can i know that this is the window i want or not?
Because you already have a handle to that window. Just compare the two.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
what is it?
/\|-||\/|/\|)
|
|
|
|
|
GetFocus() returns a handle that you can compare with the your window's handle.
If it is, your window has the focus.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
|
|
|
|
|
Hi
I got a package of dlls, some compiled as:
- "MFC Extension DLL (using shared MFC DLL)"
- and other as "Regular DLL using shared MFC DLL"
I want to compile myown application which uses those DLLs, in "Use MFC in a Static Library" mode.
but i'm getting the following linking errors:
Linking...
msvcrt.lib(MSVCRT.dll) : error LNK2005: "public: int __thiscall type_info::operator==(class type_info const &)const " (??8type_info@@QBEHABV0@@Z) already defined in libcmt.lib(typinfo.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: __setmbcp already defined in libcmt.lib(mbctype.obj)
msvcrt.lib(MSVCRT.dll) : warning LNK4006: "public: int __thiscall type_info::operator==(class type_info const &)const " (??8type_info@@QBEHABV0@@Z) already defined in libcmt.lib(typinfo.obj); second definition ignored
msvcrt.lib(MSVCRT.dll) : warning LNK4006: __setmbcp already defined in libcmt.lib(mbctype.obj); second definition ignored
Creating library Release/IFL_Sample.lib and object Release/IFL_Sample.exp
nafxcw.lib(nolib.obj) : warning LNK4098: defaultlib "mfc42.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
nafxcw.lib(nolib.obj) : warning LNK4098: defaultlib "mfcs42.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
libcmt.lib(crt0init.obj) : warning LNK4098: defaultlib "msvcrt.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
Release/IFL_Sample.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.
Thanks in advance!
Yael
|
|
|
|