|
See also StrToInt function [^].
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
[My articles]
|
|
|
|
|
The easiest way is to search Google for "CString to int".
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
How can I distinguish between a hardware CDROM unit and a virtual one? I tried GetDriveType() but it doesn't ditinguish a DaemonTools Virtual unit from a real one.
In VC++ please...
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Erm, that's kinda the POINT of things like daemontools. They spend a lot of effort to NOT be distinguishable. As far as the operating system is concerned it is a CDROM drive. Only at the deep driver level does it make a detour to look at a file on the hard disk, rather than a physical cd.
Iain,
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Thanks! It's over my actual possibilities.
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Such applications *normally* use a rootkit[^] to show itself to the OS as a Optical disk drive (or whatever it wants to appear to be). So, you'll have to write application that will detect a rootkit and find if it actually is hiding itself to provide a virtual disk drive capability.
There may be some X application that may not be using a rootkit. So, I don't see a "generic" approach to figure out this stuff.
A crude way is to note down the registry entries and folders all such applications create and look out if there's anything of that present in the machine. But if there were multiple drives (including actual optical drives), ...
Yours is an ambitious project, sir.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks! It's over my possibilities.
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
I have to show the Pointer position on the Windows XP screen without over-write any information on the screen (like the mouse without using any GUI). Is there any way to do that or I have to use interrupt 33h? If in the latter case, how I do that in VC++ codes to call interrupt 33h?
Thanks for any help
modified on Monday, February 9, 2009 3:58 PM
|
|
|
|
|
THA2000 wrote: If in the latter case, how I do that in VC++ codes to call interrupt 33h? Most interrupts are not allowed/possible in Windows.
What exactly is it that you are after? Are you writing a console or a GUI application?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I think I better off with the console because I would like to show the pointer moving around PC monitor
- I do not want to use any interrupt, but when the pointer moving I do not want it erasing any thing on the screen (like the mouse movements). Certailly, I have to provide the coordination to display the pointer ... but I do not know how to do it.
Can you help
|
|
|
|
|
Member 5928368 wrote: I think I better off with the console because I would like to show the pointer moving around PC monitor
The latter does not require the former. For what reason do you have to have a console application?
Member 5928368 wrote: ...but when the pointer moving I do not want it erasing any thing on the screen (like the mouse movements).
I'm not sure what you are saying here, but the mouse does not normally erase anything as it moves around on the screen.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Yes, you are right! Sorry my statement were not clear enough, I would like to display the pointer on the monitor (as the mouse) which not erase any thing when it pass over!
To do the above mentioned, even with VC++ console or MFC or any thing within VC6.0, then it will be oK for me!
For now, I do not know how to do that
|
|
|
|
|
THA2000 wrote: To do the above mentioned, even with VC++ console or MFC or any thing within VC6.0, then it will be oK for me!
The simplest way is to create a dialog-based applicaton, call SetCapture() , and then respond to the WM_MOUSEMOVE message. When you are done, be sure and call ReleaseCapture() .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Thank for the suggestion, but I am not sure that I can display my pointer as I wish? Let say I would like to display my pointer (not the mouse position) at the top-left sreen then at the bottom-right of the screen (1280 x 800 resolution) ... what can I do?
Thanks in-advanced
|
|
|
|
|
THA2000 wrote: Let say I would like to display my pointer (not the mouse position) at the top-left sreen then at the bottom-right of the screen (1280 x 800 resolution) ... what can I do?
Call SetCursorPos() .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
It works beautifully, however I wonder that: Can I not use the Dialog base? Because I still have the dialog apprearing on the screen, by any chance we don't have to do that?
Anyway, thanks a lot for help
|
|
|
|
|
Your best bet is to just try it and see.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Try searching for these:
FindWindow(<string>) (MFC)
CLSID_ActiveDesktop (COM)
CreateDC("DISPLAY",NULL,NULL,NULL) (MFC)
though I'm also not sure what exactly you're looking for (an interrupt for mouse movement?), the first will get you an HWND to whatever window you want ("progman" is the top level window), from which you can get almost any information you need... the second lets you adjust the desktop, and the third is involved in painting the screen, in case you wanted to capture the screen.
If your window has focus, maybe handle the ON_WM_MOUSEMOVE event (MFC)
...
I also remember capturing the mouse coordinates with a simple DJGPP graphics library circa 2000, so there're probably other ways of doing THAT.
|
|
|
|
|
As I just mentionned (in other reply) that I do not want to use any interrupt (but I am not sure do I need it or not) to show the pointer moving around the monitor screen without erasing any thing on it (as the mouse movement)
Can we do it. If Yes, then how I do it & is there any sample available
Can you help me
|
|
|
|
|
Hello,
I was hoping someone could provide an explanation on how to open a new dialog window and close the old dialog window with a click of a button. I can create a new dialog window using:
SecondDlg myDialog;
myDialog.DoModal();
However, I have two windows on the monitor when all I want is the recently opened window. I've tried EndDialog(IDCANCEL) and DestroyWindow(), but this just seems to close both window when the OK or CANCEL button is selected.
void CVetDent_11Dlg::OnBnClickedButton1()
{
// TODO: Add your control notification handler code here
SecondDlg myDialog;
myDialog.DoModal();
EndDialog(IDCANCEL);
Thanks
|
|
|
|
|
Why not hide the first dialog (using...errrm...ShowWindow[^]) before the second dialog's DoModal ? That way, you'll only have one dialog on the screen at once, so it looks like the first dialog's been destroyed
As you've found, you can't just have DoModal then EndDialog , or vice versa, as a) DoModal blocks, and b) EndDialog terminates the current message handler.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks Stuart,
That seem to do the trick. Solution code:
ShowWindow(SW_HIDE);
SecondDlg myDialog;
myDialog.DoModal();
EndDialog(IDCANCEL);
|
|
|
|
|
Reece Peterson wrote: I was hoping someone could provide an explanation on how to open a new dialog window and close the old dialog window with a click of a button.
In the button-click handler of SecondDlg, call EndDialog() with an argument that denotes what button was clicked. Back in the main window, do something like:
SecondDlg myDialog;
int nResult = myDialog.DoModal();
if (nResult == 1)
{
ThirdDlg myDialog;
myDialog.DoModal();
}
else if (nResult == 2)
{
FourthDlg myDialog;
myDialog.DoModal();
} By chance are you trying to implement some sort of "wizard?"
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
|
I have a simple ascii text file on a particular path. So
its at www.website.com/temp/notepad.txt
And the file has a few lines of data. Is there a sample
project anywhere that shows me how to access that file and
read it and make changes to it and close it on the server
side? I can download the file, do what I want to do and
reupload it with changes, but Im trying to find a way to be
efficient and just make the changes on the server side.
Is this possible?
Any response any one can give me will be greatly appreciated.
Sincerely,
Danielle Brina
|
|
|
|