|
1. Create a class (CListCtrlExtra) derived from CListCtrl;
2. Map the WM_HSCROLL event. See int the 'nSBCode' variable the types of mouse click;
3. Send a mensagem to your Class, like 'GetOwner()->PostMessage (WM_MSG, 0)'. Define the WM_MSG as WM_USER + 1000;
4. In your class, map the message WM_MSG and take the event.
Hope to help you.
Cris.
|
|
|
|
|
Who can use MsTTS SDK 5.0 ????? Help me !
I don't know whether or not SDK 5.0 can deal with phonetic symbols ???????? I want to use SDK 5.0 to speak Vietnamese but don't know exactly how can !
|
|
|
|
|
How can I dynamically load the icon to use for my window? Say the icon is in the res folder and is called icon.ico. I have looked for this but everything seems to talk about loading resources from within the exe.
Thanks,
Steve
|
|
|
|
|
I use...
<br />
m_hIcon = (HICON)LoadImage(NULL, filename, IMAGE_ICON, 16, 16, LR_LOADFROMFILE);<br />
Blade[DMS]
|
|
|
|
|
Ok, that part makes sense. But....where would I implement this? I am using a MFC app created with the wizard. The window is based on the CHtmlView class. My first thought is in the main window's PreCreateWindow, is that right?
|
|
|
|
|
Hello everyone!!
I'm using OnDrawItem in a Form to draw some objects.
I would like to know how can i recall that function after pressing a button (since the button is owner draw, i would like the user to notice when he is pressing a button).
What i really want is to get the LPDRAWITEMSTRUCT struct.
How can i do this?
Thank you for your time
|
|
|
|
|
OnDrawItem() is passed a pointer to a DRAWITEMSTRUCT . Check the itemAction and itemState members to see if the button is currently pressed. Here's[^] the MSDN link.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I've never done ownerdrawn buttons, but isn't that what ODS_SELECTED or ODA_SELECT is for...?
If not...I guess you could just check the state of the left mouse button inside DrawItem() , assuming when you press down on a button OnDrawItem() is fired off
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Here's the background on the problem: we have a rather large ANSI (_MBCS) MFC application that needs to support Unicode character entry in a single edit control (not throughout the entirety of the application). We would much rather find a solution that won't require changing the application over to _UNICODE, and so I've been investigating creating a CEdit-based control that will accept Unicode input (either from the clipboard, or from an IME).
Here's where we are: we have a solution for rendering the Unicode fonts/characters and a solution for storing the edit buffer as a wide string. I've overridden both the CEdit::Create and CWnd::Create so that ::CreateWindowExW is ultimately called instead of the ::CreateWindowEX macro. This all seems to work fine, and my understanding is that I now have a wide-character/Unicode edit window. Unfortunately, I still do not get Unicode character codes in my OnChar handler like I would if the application was compiled with _UNICODE.
Here are the questions: Have I done something fundamentally wrong in creating a Unicode window in an ANSI application? Or will I simply never get Unicode character codes in WM_CHAR unless compiled as _UNICODE? Any help or insight would be GREATLY appreciated.
As always, thanks in advance.
[code snippet of Create functions; apologies for the formatting:]
BOOL CFTEdit::Create (DWORD dwStyle,
const RECT &rect,
CWnd *pParentWnd,
UINT nID)
{
return (Create (_T("EDIT"), NULL, dwStyle, rect, pParentWnd, nID));
}
BOOL CFTEdit::Create (LPCTSTR lpszClassName,
LPCTSTR lpszWindowName,
DWORD dwStyle,
const RECT &rect,
CWnd *pParentWnd,
UINT nID,
CCreateContext *pContext)
{
CREATESTRUCT cs;
CComBSTR bstrClassName = lpszClassName;
CComBSTR bstrWindowName = lpszWindowName;
cs.dwExStyle = 0;
cs.lpszClass = lpszClassName;
cs.lpszName = lpszWindowName;
cs.style = dwStyle | WS_CHILD;
cs.x = rect.left;
cs.y = rect.top;
cs.cx = rect.right - rect.left;
cs.cy = rect.bottom - rect.top;
cs.hwndParent = pParentWnd->GetSafeHwnd ();
cs.hMenu = (HMENU)nID;
cs.hInstance = AfxGetInstanceHandle ();
cs.lpCreateParams = (LPVOID)pContext;
if (!PreCreateWindow (cs))
{
PostNcDestroy();
return FALSE;
}
AfxHookWindowCreate (this);
HWND hWnd = ::CreateWindowExW (cs.dwExStyle, (BSTR)bstrClassName,
(BSTR)bstrWindowName, cs.style, cs.x, cs.y, cs.cx, cs.cy,
cs.hwndParent, cs.hMenu, cs.hInstance, cs.lpCreateParams);
if (!AfxUnhookWindowCreate ())
PostNcDestroy ();
if (hWnd == NULL)
return FALSE;
ASSERT(hWnd == m_hWnd);
return TRUE;
}
Rob Whapham
Managing Software Engineer
AMX, Corp.
http://www.amx.com/
|
|
|
|
|
ummmmm i could be wrong (usually am) but when u compile the app without the _UNICODE #def different libraries get linked in so whatever u do during the running of the app u are still fundamentally a non-unicode app
"even if my world is weird it's my world" biz stuff about me
|
|
|
|
|
I have a Dialog application that mainly has
20 static windows that are created at runtime using the create command .
Periodically I update the text in the text boxes by performing a
SetWindowtext(updatedstring) for the Static windows . I find that I am not able to view the changed values in the static windows.
Now when I minimize and maximize the Dialog the contents are updated ? Why is this happenning ? what Am i doing wrong ?
|
|
|
|
|
I have not tried it, but it seems that you should try to use "invalidate();"
Hope this helps...
|
|
|
|
|
Because you draw, but you didn't force Windows to redraw your screen. Use Invalidate() or InvalidateRect(NULL) to do that after painting
|
|
|
|
|
Is there any way to see if a computer is a member of a domain, and if it is and there's multible domains, which domain(s) it can log on to?
I'm only coding for Win2k/XP...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
|
I have been looking at those functions, but if there are more than one domain on the network, I can enumerate all of them, but I can't see which the computer can log on to
I mean, if you have domain1, domain2 and domain3. Domain1 and domain2 trust each other.
Now we have a workstation which is in domain1, but it can also log on to domain2 because of the trust.
If I use the net* functions to enumerate the domains, I get all 3 domains but I only want domain1 and domain2...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
ooooooo
i knew it would get icky with the security stuff
"even if my world is weird it's my world" biz stuff about me
|
|
|
|
|
Otherwise it would just be boring
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
You'll have to use some of the other APIs to check Machine / User access directly on the domains you are concerned with across the trust. If that doesn't get you deep enough, there are always the Authorization[^] APIs, but those are more for use deeper into the security model of NT/2k/XP.
It's pretty sticky and gooey when you dig into the network security aspects of NT/2k/XP.
|
|
|
|
|
Ok, so I am looking at the MSDN Library for July 1999 and I see this: BUG: CHtmlView Does Not Repaint Correctly in AppWizard MDI APP. Well this is very similar to the problem I was having, if I launched a new window with window.open in my html and closed the new window before it was done loading I had the same repaint problems. But I'm not using a MDI app. So I just added the WS_CLIPCHILDREN style like the article says and it fixes my problem . My question is, will this style affect anything else? Remember, I'm not using a MDI app.
Thanks,
Steve
|
|
|
|
|
I have use SetParent api function to set a application' main form as the child of another application's main form. The api returns TRUE. But the child window dosen't update UI until I minimize and restore the parent window. Anyone can tell me why? Thanks a lot.
bill
|
|
|
|
|
From MSDN:
Windows 2000: When you change the parent of a window, you should
synchronize the UISTATE of both windows. For more information, see
WM_CHANGEUISTATE and WM_UPDATEUISTATE. Maybe this is the problem.
rechi
|
|
|
|
|
|
|
When editing the parent dialog's properties, check Clip Children style.
rechi
|
|
|
|