|
You need to compare HWND s, not CWnd objects.
if ( p->GetSafeHwnd() == m_combo.GetSafeHwnd() )
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
Homepage | RightClick-Encrypt | 1ClickPicGrabber
"Which comes first, the bug or the stress?" -- Chris Maunder
|
|
|
|
|
Thank you!
Appreciate your help,
ns
|
|
|
|
|
Well,
I did compare the safeHWnds like you said, but it still never says they are equal and never goes into the if. What I want to do is do something after I hit enter in a combobox edit part. SO I was overriding OnCommand:
OnCommand(..)
{
if(LOWORD(wParam==IDOK &&lParam ==0)
{
CWnd* p = GetFocus();
if ( p->GetSafeHwnd() == m_combo.GetSafeHwnd() )
{......
<code> never goes in here when I hit Enter in combo</code>
}
}
}
Appreciate your help,
ns
|
|
|
|
|
On My CDialog I have a CListCtrl and a combobox. When I click on an item in the listCtrl, in the OnItemChanged handler I put in m_combo.SetFocus().
Now while I am holding the selection down in the listCtrl, the focus cursor blinbks in the editbox part of the combobx. As soon as I let the mouse go, the focus shifts back to the listCtrl where the selection I just made gets highlighted. How do I keep the focus on the combo?
Appreciate your help,
ns
|
|
|
|
|
Try replacing the m_combo.SetFocus() in the OnItemChanged() handler with PostMessage (WM_COMMAND, CMD_SET_FOCUS_TO_COMBO) . Then write a handler for the hidden CMD_SET_FOCUS_TO_COMBO command which simply does m_combo.SetFocus() .
This should allow the OnItemChanged() to complete normally and then cause focus to be set to the combo box.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
Damn, it feels good to be hacking again.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I tried your slick trick, but couldnt convince the focus to stay put. It momentarily flickers in the editpart of the combo but then returns to the listctrl and highlights the item I selected....
Appreciate your help,
ns
|
|
|
|
|
Try calling GotoDlgCtrl (GetDlgItem (IDC_MyCombo)) .
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
stubborn thing - still no luck! Thanks for trying though.....
Appreciate your help,
ns
|
|
|
|
|
Does anyone know if it is possible to place the vertical scrollbar within the tree control on the left-hand side of the window, rather than the right (while still displaying left-to-right text)?
Dave
|
|
|
|
|
I don't know if it's possible to retrieve the scrollbars provided by the tree control to set the SBS_LEFTALIGN style (I once read a discussion about, but I don't remember the conclusion...)
However, you could always do the following:
a) make the tree control big enough to be without scroll bars (you need to calc the "ideal height" for it anyway - but that's no big problem)
b) create your own scroll bar with SBS_LEFTALIGN
c) set the correct clipping style for the parent (I think it should be WS_CLIPCHILDREN)
d) handle the scroll events by moving the tree control's y position
e) Handle selection changes correctly, so the selection is always inside the tree
---
f) TVM_GETITEMRECT will prove invaluable for all these tasks
g) if you expect a horizontal scrollbar as well, you should implement it on your own in a similar way. it looks dead ugly otherwise
Yeah, a lot of work (and I don't really see the benefit of an left-aligned scrollbar over it's "non-standardness". But you decide )
If you go to war, you will destroy a great country a stoned greek chick to the richest man of the world
sighist | Agile Programming | doxygen
|
|
|
|
|
I didn't think it was easy...
The reason i wanted one was because i have two tree controls next to each other and i'm drawing lines between them - the scrollbar is sort of in the way.
Dave
|
|
|
|
|
I need to redistribute SAPI5.1 speech files [^]for my program (OS's other than XP).
It looks like I can only use the .msm files.
In plain english (MSDN was no help to me) how do I deploy these files with my app setup?
I am currently using InnoSetup[^] 3.0
But does this mean I must use Visual Studio Installer?
and if so, does it automatically install the .msm files?thanks, this is all new to me.
Later, JoeSox www.joeswammi.com It's not easy facin' up when your whole world is black Rolling Stones
|
|
|
|
|
Hi there,
I have an app here that already initializes COM via a call to CoInitializeEx(NULL, COINIT_MULTITHREADED). I have recently added drag and drop support, and am calling AfxOleInit() some time after the call to CoInitializeEx(). This works on my development machine no problem, but on another machine AfxOleInit()'s call to CoInitialize() fails with RPC_E_CHANGED_MODE. I don't understand why it works on my first machine, though I realize the failure on the second machine is due to the fact that it was initialized to MTA and now we are trying to use STA.
Any ideas? Surely you can use COM as well as drag and drop in a single application, right???
Thanks,
swine
[b]yte your digital photos with [ae]phid [p]hotokeeper - www.aephid.com.
|
|
|
|
|
I'm currently working on a programming project that requires the use of graphics. I'm using Dev-C++'s V.4 compiler and borland's graphical interface, whick makes use of a header file called <winbgim.h>. I am trying to interact between the graphics window and a seperate input/output screen. I'm using the input/output screen to get info from the user and the graphics window to display results in graphical format. My problem is this: within five seconds of program execution, the graphics window becomes inactive, but the program will continue to feed information through the input/output screen. When the program is finished execution and terminated, and the graphics screen will once again become active and will display the results of what was happening during program execution when it was inactive.
I'm looking for any function or command which will set the graphics windows active each time I want to display results to it (i'm going to have to switch back and forth from the graphics window and input/output module). If there is no such function or command, please give me some advice of what my alternatives are.
Deadline is soon, and I'm sweating. Any type of help will be well appreciated.
-------------------------------------
- Mike Ware
- "The Programmer's Domain"
- http://www1.brinkster.com/warenet
-------------------------------------
|
|
|
|
|
can anybody advice me how to wrap text in CEdit control, if "Multiline" style is selected.
|
|
|
|
|
|
dudic wrote:
can anybody advice me how to wrap text in CEdit control, if "Multiline" style is selected.
To force a new line use a \n, otherwise text wraps itself at the end of each line.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
I have a dialog based app that runs fine on my development machine. Problem starts when I install the release exe on another machine. The main dialog window fails to create and returns -1 in DoModal(). Any help would be appreciated.
Thanks,
Sterling
srunion@evokesoft.com
|
|
|
|
|
|
Alpha windows problem, need help!
I had download the code from:
http://www.codeproject.com/gdi/pxalphablend.asp
I've put controls on the dummy dialog. I can press a button on the dialog, just can't see it. Can anyone direct me to some help on how to make any controls appear on this dialog?
My OS is Win2000
VC 6
|
|
|
|
|
I've created a CStatic control in my View window like this:-
CRect rect (m_rectGraph.left, m_rectGraph.bottom, m_xChar * 6, yChar);<br />
m_wndLevel1Static.Create(_T("???"), WS_CHILD|WS_VISIBLE|SS_LEFT, rect,this);<br />
Now I need to move it to another area in the View window. I've tried SetWindowPos and MoveWindow but I can't be using them right because either it will not compile or it aborts when I run it.
Am I using the wrong function, or can any one offer a quick example?
Thanks for any help,
Ali
|
|
|
|
|
MoveWindow should work fine.. Are you trying to move it before it gets created? Maybe post your move code..
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hi everybody, help me
Why the following code draws a black color instead a transparent color
hBitmap - handle of a bitmap
crTransparent - a transparent color
CSize sz(0, 0);
int nRetValue;
BITMAP csBitmapSize;
nRetValue = ::GetObject(hBitmap, sizeof(csBitmapSize), &csBitmapSize);
sz.cx = (DWORD)csBitmapSize.bmWidth;
sz.cy = (DWORD)csBitmapSize.bmHeight;
CImageList img;
img.Create(sz.cx, sz.cy, ILC_COLORDDB | ILC_MASK, 1, 1);
img.Add(CBitmap::FromHandle(hBitmap), crTransparent);
HICON hIcon = img.ExtractIcon(0);
pDC->DrawState(pt, sz, hIcon, DSS_NORMAL, (CBrush*)NULL);
Best regards,
Eugene Pustovoyt
|
|
|
|