|
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
|
|
|
|
|
Mmm - not without some help on the server side, I suspect. HTTP's not really targeted at opening a file, updating it and closing it again.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Do you have access to the file via a UNC path rather than HTTP? If not, then FTPing the file back and forth is likely going to be your only recourse.
"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 use a ListBox to show actions performed by the program. While running, the contents becomes greater than the frame of the ListBox . I don't know how to make the ListBox to show its last lines, in order to show the user the last actions performed by the program.
In VC++6, please...
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Use the message LB_SETTOPINDEX...
Hope thie helps!
|
|
|
|
|
Thank you!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Use the LB_SETTOPINDEX message (or the ListBox_SetTopIndex macro), or the LB_SETCURSEL message (or the ListBox_SetCurSel macro) if you want to select the item (LB_SETSEL to select multiple items) that has been added to the end of the list.
Regards,
--Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year." -Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer." -Fred Brooks
|
|
|
|
|
Thanks!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Another option, although slightly less appealing, is to send the listbox a LB_INSERTSTRING message with 0 as the index.
"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
|
|
|
|
|
This will reverse the order of the messages?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
RomTibi wrote: This will reverse the order of the messages?
Of course it will, hence my opening remark.
"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
|
|
|
|
|
Thanks! I finally used your advice.
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Hi all,
I have a struct a bit like this, which is the header to a file on disk:-
struct Header
{
short a;
short b;
short c;
float floatvalue;
}
I read the header from the disk like this:-
ReadFile(hFile,&header,sizeof(Header),&bytesRead,NULL);
Once I'd done that, the values in a,b,c are as expected, but the floatvalue is not.
However, if I adjust the struct so that instead of float, I have BYTE[4] as follows:-
struct Header
{
short a;
short b;
short c;
BYTE floatvalue[4];
}
And then after reading the header as before, I do:-
float f;
memcpy(&f,header.floatvalue,sizeof(float));
Then f contains the value expected.
I don't understand why the first version didn't work. Can anyone enlighten me please?
Thanks
Jon
|
|
|
|
|
Maybe take a look at this[^], i hope it explains what you need explained.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|