|
Yes, I can do that. The problem is that I then have to call _TrackMouseEvent again immediately to set up the mouse handler and it causes some bad flickering in the control. I might look into that a little more, though.
|
|
|
|
|
We had the same issue with some snapping windows done here. What we did was on the WM_MOUSELEAVE, we used the GetCursorPos() and WindowFromPoint() functions and checked who the parent of that window was. If it was the window the TrackMouseEvent was used on, we setup a new one for the button. When it leaves the button you will have to check again that its not on the parent or another child window of the parent etc...
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Yeah, thanks, that's exactly what I ended up doing last night, execpt I used GetCursorPos(), GetWindowRect(), and the PtInRect() function of CRect to check if the cursor position was inside the client rectangle.
Thanks for the help. I got it to work without flicker by overriding the OnEraseBackground() method and immediately returning TRUE, which I should have done a while ago, anyway.
|
|
|
|
|
Arrrggghh!
I'm having trouble with InsertItem(), for an CTreeCtrl object. The following gives me an Assertion Error, twice on each iteration of the for loop.
CdlgABC* dlgABC = new CdlgABC(this);
for(int j=0; j<i; j++)
dlgABC->m_tree.InsertItem(dlgABC->m_strArray.GetAt(j), TVI_ROOT, TVI_SORT);
dlgABC.DoModal();
Any clues as to what to check out, would be greatly appreciated.
Thanks!!
BW
{insert witty/thought-provoking saying here}
|
|
|
|
|
Before DoModal your CTreeCtrl isn't associated with Win32 HWND. It can't do anything, especially invoke InsertItem. Put your code in CYourDlg::OnInitDialog.
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
...and slowly, painfully the pieces come together.
Thanks for your help!
BW
{insert witty/thought-provoking saying here}
|
|
|
|
|
Hi everyone,
Does anybody know of an easy way to change the dropdown arrow on a Combobox to a user-defined icon? I guess it will need some sort of owner-drawn implementation? Are there any examples that anyone knows of?
Thanks in advance for your help...
Steve
|
|
|
|
|
I run the console application (ie. ipconfig) from another process and need to read ipconfig's text output.
Is it possible or not?
Thanks,
Marek.
|
|
|
|
|
|
Hello there,
I tried to make my dialog like Windows Media player skins by using CRgn ...
But i don't know to do it
Could you show me source code how to do this ?
Or can you help me ???
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
|
Hello Chris and thanks for the article
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I have two charachter string.I want to check if first one exist in second one.With which C library functiom or win32 API I can do it?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
|
Thnaks.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Hi, I have created an MDI using CFormView. I have 2 forms. CMyProjView is the 1st form containing user inputs. The second form is activated using a button handler.
How to access data stored in CMyProjDoc from the second form?
I tried this in OnInitialUpdate() of CForm2
CMyProjDoc * pDoc = (CMyProjDoc*) GetDocument();
m_Variable = pDoc->data[i];
m_EditBox.Format("%.2f",m_Variable);
but I get an Assertion failure.
Any suggestions?
Thanks
|
|
|
|
|
Where exactly you're getting assertion failure?
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
The form is created in CMyProjApp::InitInstance and a call to OnInitialUpdate() is made.
The failure occurs when I execute the project; i.e. immediately
|
|
|
|
|
Look at the call stack and check where exactly are you getting the assert.
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
As Title.
It's said that "The system associates a window station with a process when the process is created" in MSDN.
but in what case does a process not associate a window station?
hi
|
|
|
|
|
From MSDN:
"A window station is a secure object that contains a clipboard, a set of global atoms and a group of desktop objects. The interactive window station assigned to the logon session of the interactive user also contains the keyboard, mouse, and display device. The interactive window station is visible to the user and can receive input from the user. All other window stations are noninteractive, which means that they cannot be made visible to the user, and cannot receive user input"
Johndotcom wrote:
but in what case does a process not associate a window station?
AFAIR, service processes under NT 3.5 had no winstation, but they've changed in NT 4.0. Why are you asking?
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
A window station in the MS terminology is a virtual window station in which processes are run in a separate address space, and by the way are not visible to your current session (even in the task manager).
In fact MS introduced window stations along with desktops. The system can have many window stations. Each window stations can have many desktops.
The interactive window station, yours , is window station named "winsta0" with default desktop named "default".
Wat are window stations for ? for instance to circumvant current NT limits such like the total amount of GDI objects per session.
If you need to know more about this, do a search with "winsta0",
And I swallow a small raisin.
|
|
|
|
|
StephaneRodriguez wrote:
virtual window station in which processes are run in a separate address space
Processes are executed in separate address spaces, with winstations or not.
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
You're right, but this precision is unnecessary,
And I swallow a small raisin.
|
|
|
|
|
I want to use file mapping and this is my code:
<br />
HANDLE hSearchedFile,hMap;<br />
LPVOID pFile,charSearch;<br />
LPCTSTR fName = strName.GetBuffer();<br />
<br />
hSearchedFile = CreateFile(fName,GENERIC_READ,0,<br />
NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);<br />
<br />
hMap = CreateFileMapping(hSearchedFile,NULL,PAGE_READONLY,0,0,NULL);<br />
<br />
if(hMap==NULL)<br />
AfxMessageBox("Could not create file-mapping object");<br />
<br />
pFile = MapViewOfFile(hMap,FILE_MAP_READ,20,0,0);<br />
<br />
<br />
if(pFile==NULL)<br />
AfxMessageBox("Could not map view of file.");<br />
hSearchedFile is always 0xffffffff but hMap and pFile are always NULL.I don't know whats the problem with my code.Any idea?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|