|
I have a CPoint & would like to draw that point on my screen.
How can i convert my points to system coordinates.
Proud To Be an Indian
|
|
|
|
|
Replying to my question would help a lot to answer yours
|
|
|
|
|
I have a point say (x,y) i just want to draw it in my window.. just to see where that point is. .
Proud To Be an Indian
|
|
|
|
|
What's this conversion you're talking about then ?
When you are drawing on a window, all the coordinates are relative to the upper-left corner of the client area of your window.
|
|
|
|
|
If you use a window device context then pixel coords are relative to the top-left corner of that window client area.
On the other hand, if you use a screen device context (for instance via GetDC(NULL) ) then the pixel coords are relative to top-left corner of the screen.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
I think SetPixel wil change the color of the specified pixel.
Proud To Be an Indian
|
|
|
|
|
If the point that you want to draw have a dimension of only one pixel, then changing the color of the specified pixel( say to black color ) will make that pixel to appear as a point isnt it?
if the diameter of the point you want is more than a pixel, you have to follow the way mentioned by Cedric Moonen.
|
|
|
|
|
Hi,
I have HWND of window. How can I terminate the process using HWND?
|
|
|
|
|
pther wrote: How can I terminate the process
Although you can get the process id of window and call TerminateProcess() function, i dont recommand using it.
If the HWND is HANDLE to the main window of that application, seding a WM_CLOSE message will terminate the process.
|
|
|
|
|
But this methos is giving exception after closing the application so couls you tell me like Treminate process using HWND
|
|
|
|
|
Well, then you should fix the problem. Is it one of your application that crashes ?
TerminateProcess will kill the process in a brutal way, sending a WM_CLOSE message is much elegant because it lets the application do some clean-up before exiting.
|
|
|
|
|
pther wrote: Treminate process using HWND
1. GetWindowThreadProcessId() to get the process ID.
2. With this process id callOpenProcess() function with PROCESS_TERMINATE access.
3. Call TerminateProcess().
|
|
|
|
|
You dont need to use of Treminateprocess you must send WM_CLOSE for close a program.
|
|
|
|
|
Dear Friends,
I want to split List control into groups at run time similiar to
Windows VISTA MY Computer view.
i.e. 1) I can expand and collapse the items at run time ?
2) Header of groups should be in user defined color etc.
Any help is highly appreciated.
I am developing the MFC application in Visual Studio 2008 + feature
pack 1.
Thanks,
Subhash Madhukar
|
|
|
|
|
hi
please explain more clear ..
|
|
|
|
|
Hi,
Thanx for reply.
Can u pls provide ur email id. so that I can send the snapshot of my requirment.
Thanks,
Subhash
|
|
|
|
|
hi,
this is basha, i don't how to convert money into alphabets in vc++.
Requirements ( visual c++)
1.it will accept all type money range
( one ,ten ,.......billion,million,etc.......)
2.the code will convert money(Rupees and paise format)
3.while enter the value in textbox,after that we press dot. it will allow only two digit.
|
|
|
|
|
ammaappa wrote: while enter the value in textbox,after that we press dot. it will allow only two digit.
The Ultimate Toolbox Masked Edit has more than you need[^]
ammaappa wrote: 1.it will accept all type money range
( one ,ten ,.......billion,million,etc.......)
2.the code will convert money(Rupees and paise format)
It seems you never want to be a programmer, anyway have a look at this repository[^]
|
|
|
|
|
Sounds like a university project....
Anyway, what have you tried so far ?
|
|
|
|
|
I wrote a program in C++ MFC and create 2 more thread , this program ryn on several computers .
recently I bought a new PC and the program can’t create more then one thread .
The same program work nice on other PCs.
All the PCs run WINDOWS XP PRO.
|
|
|
|
|
Did you read the "How to get an answer to your question" sticky post at the top of this board?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Then try debugging it, you will never learn otherwise.
Also, we can't help if you don't give us any details.
|
|
|
|
|
I need to change printer default settings. I am using DocumentProperties function. Here is my code:
if(!SetDefaultPrinter(ptiSel.sPrinter)) return false;
HANDLE hPrinter;
if(!OpenPrinter(ptiSel.sPrinter.GetBuffer(0),&hPrinter,0)) return false;
DWORD dwSize = DocumentProperties(0,hPrinter,ptiSel.sPrinter.GetBuffer(0),0,0,0);
pDefDEVMODE = (LPDEVMODE) malloc(dwSize);
DocumentProperties(0,hPrinter,ptiSel.sPrinter.GetBuffer(0),pDefDEVMODE,0,DM_OUT_BUFFER);
if(pDefDEVMODE->dmFields & DM_DEFAULTSOURCE)
pDefDEVMODE->dmDefaultSource = ptiSel.wTray;
DWORD res=DocumentProperties(0,hPrinter,ptiSel.sPrinter.GetBuffer(0),pDefDEVMODE,pDefDEVMODE, DM_OUT_BUFFER | DM_IN_BUFFER);
if(res != IDOK) MessageBox(0,_T("Could not set printer settings"),0,MB_ICONERROR);
ClosePrinter(hPrinter);
This code is based on msdn sample (http://support.microsoft.com/kb/167345). Settings are not changed. The second call of DocumentProperties retrieves valid DEVMODE structure, I change it and save back to printer, the function returns IDOK result but does not write settings to printer. Can anybody help me?
|
|
|
|
|