|
From the MSDN:
<br />
CWnd::OnTimer<br />
The framework calls this member function after each interval specified in the SetTimer member function used to install a timer.<br />
whitesky
|
|
|
|
|
|
Hi all,
I am drawing a Circle in mouse clicked event in CDialog. and when i move the mouse if the mouse entered inside the Circle the Mouse Icon must change to CROSS ie IDC_CROSS or else it should retain its original behavior (ie) IDC_ARROW.
I want to detect that wheather the mouse is inside the Circle or Not to change my Mouse Pointer.
Please help me out. Give a small program using IntersectRect(...) API.
uday.
|
|
|
|
|
I would use a region (CRgn class) that corresponds with the circle and use CRgn::PtInRegion() to check if the mouse is in the circle.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Hi,
Please give a bit of code so that i can use it. its very urgent.
thanks and regards
uday.
|
|
|
|
|
Use highscool math (Pythagoras' Theorem).
i.e.
bool IsPointInCircle(int cx, int cy, int cr, int x, int y)
{
int xp = x-cx;
int yp = y-cy;
return (xp*xp+yp*yp)<=(cr*cr);
}
cx = circle center x.
cx = circle center y.
cr = circle radius.
x = x coordinate of point to test.
y = y coordinate of point to test.
Steve
-- modified at 2:02 Friday 7th July, 2006
|
|
|
|
|
Hi steve,
Any method like CRect.IntersectRect(...) usage is used please let me know any usage.
uday.
|
|
|
|
|
As mentioned above you can use the CRgn class:
CRgn rgn;<br />
rgn.CreateEllipticRgn(left, top, right, bottom);<br />
<br />
if (rgn.PtInRegion(point))<br />
{<br />
...<br />
}
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
I have declared an array of size 200 for a structure with character as well as integer members.I want to know how to reinitialize the array values to NULL in such a way that the old values should get deleted.
Eg:Group grp[200]; where Group is a structure.
|
|
|
|
|
Can't you just use memset() or ZeroMemory() ?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I need to copy all content of one projevct to another so to modifier what i need.
|
|
|
|
|
|
I create a new project but i want to copy others forms from a old project to the new, what to do
|
|
|
|
|
Form? Do you mean a dialog? You just want to copy the dialog or the controls in it too, with member variables if any, attached to those and message handlers for those controls and the dialog itself? What is the logic behind your question?
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
I need to copy a dialogs with all these codes
|
|
|
|
|
There is no such copy-paste operation which will perform this task. You will need to redo the thing.
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
you create empty prject after that, you add exist project to.
All code, resource will be added.
Huynhnb
.: Your success is also me :.
|
|
|
|
|
how we can restrict the dialog.
what i mean is when we move the dialog to end of the screen.ok, no problem.if we further move i will move to out of screen.how to avoid that,
thank u in advance,
vasu.
|
|
|
|
|
SendMessage(DM_REPOSITION);
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
please tell some examples then i understand easily,
thank u for ur reply,
vasu
|
|
|
|
|
Handle the WM_MOVE message of your dialog. Just add the following line in that function.
SendMessage(DM_REPOSITION);
Does this solve your problem?
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
I have Subclassed a Window using the SetWindowLong function. Now, I would like to UnSubclass it. Is there any way to UnSubclass a Window?
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
<marquee behavior="alternate" scrollamount="5" scrolldelay="50">
|
|
|
|
|
Did you use GetWindowLong() to save the previous window procedure? If so, just put the old one back again.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
use SetWindowLong with pointer to original window procedure.
-Saurabh
|
|
|
|
|
I reversed a dll in asm to my liking. I want to keep the dll's integrity and make the midifications at run-time.
I've been looking all over for a more intermediate tutorial for such a method of gaining access to another program. I have worked with C++ quite a bit in the past, but only for very simple things and mostly console based. I am starting to get a hang of the Windows API only recently and I need a little help figureing this out.
I have created an application that (as far as I can tell) successfully loads a dll into a process. I am not all too familiar with how these libraries work, but my assumption is that a process has to call methods from the dll. I just want to be clear on how it works, so here is where my stupid question comes in: Am I supposed to create the program to inject the dll, then access the dll from my injector program? Or is there a way to make the dll run code as soon as it is injected?
All the tutorials I have found on this subject have way too much extra stuff in them for me to tell what exactly is going on. I understand that I need to read up on how dlls are implemented so if anyone could direct me to a tutorial that would give me the knowledge for what I want to do, I would appreciate it.
This is the current code I am using to inject:
void Inject(HWND hWnd, char* strDll )<br />
{<br />
GetWindowThreadProcessId(hWnd, &pId);<br />
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pId);<br />
LPVOID lpRemoteAddress = VirtualAllocEx(hProcess, NULL, strlen(strDll), MEM_RESERVE|MEM_COMMIT, PAGE_READWRITE);<br />
WriteProcessMemory(hProcess, lpRemoteAddress, (LPVOID)strDll, strlen(strDll), NULL);<br />
CreateRemoteThread(hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA"), lpRemoteAddress, 0, NULL);<br />
}
I took the dll from a source I found for injecting into a task manager and ignorantly tried to inject it using my code. I received no errors, but it was to no avail. This is why I assume I need something executing the code in my injector. Am I right about that?
Thanks for any help or links, it would be much appreciated.
-- modified at 0:45 Friday 7th July, 2006
|
|
|
|