|
RickEastes wrote:
I am in the process of finding a way to link a VC.NET app to older MFC DLL's.
i'd be totally shocked if that was possible. they've changed a lot of stuff in the new MFC (like CString). there are new interfaces etc..
but, if you do find a way, please be sure to write an article about it.
-c
Aiei i ea eio aoa i e eio e aigoa
|
|
|
|
|
;PI struggled when I try to view what's in the windows queue but there is no visual studio utility for it. I will appreciate if someone can point to me if someone has implement a tool like this.
Jerry Gao
|
|
|
|
|
which queue are you referring to?
-c
Aiei i ea eio aoa i e eio e aigoa
|
|
|
|
|
sorry for confusion. I mean windows messages queue.
|
|
|
|
|
How does TaskManager get the Image Name? If I iterate thru all windows using EnumWindows then I can get to the Handle for each window. Using the Handle I can get the processID using GetWindowThreadProcessId(hwnd, &wndPid);
I can also get access to the ModuleName and GetWindowText. But none of these are the same as the Image Name we see on Task Manager. Is there a way to get the Image name from either the Handle to the Window or the ProcessID?
Thanks.
|
|
|
|
|
#include <windows.h>
#include <stdio.h>
#include <Psapi.h>
#pragma comment (lib,"psapi.lib")
int main(int argc, char* argv[])
{
HANDLE hProc;
char szProcessName [80];
HMODULE ahMod [10];
DWORD dwNeeded,dwPid;
if(argc != 2)
{
printf("Usage: %s [pid]\n",argv[0]);
return 0;
}
dwPid = atol(argv[1]);
hProc = OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,FALSE,dwPid);
if (hProc)
{
if (EnumProcessModules(hProc,ahMod,sizeof(ahMod),&dwNeeded))
{
if(GetModuleBaseName(hProc,ahMod[0],szProcessName,sizeof(szProcessName)))
printf("%s\n",szProcessName);
else
printf("%s\n","Not found");
}
CloseHandle (hProc);
}
return 0;
}
|
|
|
|
|
I've got a property sheet with several property pages. I have hidden "Cancel", "Help" and "Apply". When the user clicks on "OK" I save settings and exit. However, when the user hits the Enter key, the application exits as though I clicked on "OK".
How do I change the focus to be a button in each property page so that the Enter key actually does something other than killing the app?
Thanks,
Albert
|
|
|
|
|
have you tried PreTranslateMessage()?
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
I think you can overwrite the OnOK function, so that it will do nothing, instead calling the default OnOK function of the basic class.
Also, overwrite OnCancel function, so that "esc" button will not end your program.
|
|
|
|
|
Check out PSN_QUERYINITIALFOCUS .
Shog9
|
|
|
|
|
Hi.
I would like to is it possible to pass a reference and/or a pointer of an element in a linked list as function parameter? For example:
-----
std::list<int> intList;
for (int i = 0; i < 5; ++i)
intList.push_back(i);
std::list<int>::iterator iNumList = intList.begin();
// Traverse to element #4
for (int j = 0; j < 3; ++j
++iNumList;
// Now I want to pass element #4 (interger 4) to a function.
// Is it possible to point a reference or pointer to iNumList?
myFunction(iNumList);
...
void myFunction(int *pNumber)
{
...
*pNumber = 0;
...
}
-----
Thanks,
Kuphryn
|
|
|
|
|
Use &*iNumList or change the myFunction parameter to int & and use *iNumList
Tomasz Sowinski -- http://www.shooltz.com
Free your mind and your ass will follow.
|
|
|
|
|
|
I'm working on putting some animated goodness into my Settlers of Catan freeware port (http://www.settlers3d.net). Specifically, I'm trying to hide player information until the mouse passes over it, at which point the player info zooms out from the right and stays there until the button gets the WM_MOUSELEAVE message and then it zooms back left.
The problem is that I have a couple of owner draw buttons inside my main player info button. Whenever the mouse cursor moves over these buttons, even though it is still within the player button client area, Windows sends a WM_MOUSELEAVE message and my control zooms back to the left. I've tried commenting out all mouse-handling messages within these child owner-draw buttons to no avail. I still get the WM_MOUSELEAVE message. Anyone know how to prevent this from happening?
I suspect that I'm screwed, but maybe there are some decent workarounds.
|
|
|
|
|
when u get the wm_mouseleave message cant u check to see where it is on the screen or what window its still over and decide from there?
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
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
|
|
|
|