|
Please tell us all the name of your program so we know never to use it.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
You cannot do this in a normal windows program. You might be able to do this by running all your code in a device driver (Ring 0). Note that I said might. There are non maskable interupts on PCs, and windows wasn't designed for drivers to mask interupts for very long. Odds are very good that you will see many unwanted side effects no matter how you work things.
You need a real time OS, on hardware designed for this. Windows XP/NT is not. Windows CE is, maybe. Learn something about real time operating systems, and the problems they face. Decide which is for you. Until you understand this subject (which is very large) you cannot ask the right questions.
|
|
|
|
|
Why in the name of God do you want to stop the user from interaction with the computer? That would be the worst thing a developer can do...
The way you get most CPU cicles is to set the priority to REALTIME. (more that a system process). Even that is not a wise thing to do.
And the best and fastest way to get access to information on api's is to take a peek in MSDN[^].
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
hi,
When i copiled a sample source code from code project, it shows the following compile time error.
"fatal error C1189: #error : incorrect <rpcndr.h> version. Use the header that matches with the MIDL compiler"
how could i resolve it?
please help me
harish
|
|
|
|
|
Does that show up as a -compiler- error or a linker error?
|
|
|
|
|
Hi,
I would like to write a program shutdown/Reboot/standby/lock/ Remote PC in vc++.
I have not any idea to do this.I would like to know that how to start to do this.Please help me?
rajesh
|
|
|
|
|
are you sure you can do that from a remote PC ?
i think you must have at least a daemon in the PC you want to act on...
TOXCCT >>> GEII power
|
|
|
|
|
Hi,
Have a look @ InitiateSystemShutdown InitiateSystemShutdownEx function @ msdn
It will work.
Sujan
|
|
|
|
|
You can do it using WMI . Or If u have 2000 or Xp system try this way ( non programmatic ofcoure)
cmd> wmic
cmd>/node:"Type the IP or systemname"
cmd>/user:"Type the administrator user name"
cmd>/pwd:"****"
cmd>os shutdown ( or something similar to this ..pls check mdsn for it )
wmic is the command line tool of WMI . You can use WMI to do thesame programmaticaly .
Dharani Babu S
|
|
|
|
|
My application is coded in MFC and it is completed and also
i have prepared the istallation wizard for that application using install express5.0.
Now my problem is i need to make my application as an evaluation copy. So when the application is installed in any system it should work only for 30 days. after that the application should expire even though the system time and date is changed by the user.
How to do this.? Should it be done by writing the code in my application or it can be handled in install express only?
Please give me an idea to start.
vidya
|
|
|
|
|
add a key in the register, so then, if the user uninstall the program, or if he changes the system time, you'll be able to detect if the version if out of date.
TOXCCT >>> GEII power
|
|
|
|
|
but how do you check for the date ..day by day....?
I am not getting how to validate it everyday?
incase user delete the registry ...what happens?
i am not getting the logic...for that.
vidya
|
|
|
|
|
You cannot stop all these attacks. Don't try, it is a waste of your time. Thieves WILL steal your application if they want to. Nothing you can do about it.
Make your focus on keeping the honest people honest. You want to remind them just often enough that this is an evaluation copy and they need to buy it, but not so often they are annoyed enough that they quit using the program instead of buying it.
If you print, make sure print outs have a header "This was printed by an evaluation version of FOO, please register it".
Even after your timeout expires, don't make the program expire completely, just make some functions less useful.
Last, what is your plan for users who install a program intending to check it out latter, and latter comes 6 months from then? Remember, your goal is to allow the honest users to make an honest evaluation before they buy your program. Theives won't buy your program no matter what you do to them.
|
|
|
|
|
Hi
For this to work you will have to write some amount of data in the permanent storage, say harddisk.
The algorithm goes like this
1. At the time of installing the application, Retrive the current date and time and number of days remainig (30), store it. (secretly)
2. Retrieve the current date and time, if it is equal to the stored value do nothing continue.
else
subtract both and get the value and change the stored date to this. Take the absolute value of the result. Substract this from the number of days remaining and make the result number of days remaining.
check if number of days is equal to zero...
if yes quit dont start the application.
Hope this would help you
Regards
Shiraz
The Best Relligion is Science.
Once you understand it, you will know God.
|
|
|
|
|
Hi Everybody,
How to change the Background Color of view in SDIapplication. I tired CtlColor(), pDC->SetBkCOlor(). Nothing seems to work. Actually I want to convert my SDI application into to Console application and for this I want to change the Background color to Black and font color to White. Any Idea of how to do this.
Thanks in Advance.
bbye.
If you have faith in the cause and
the means and in God, the hot
Sun will be cool for you.
|
|
|
|
|
|
Thanks Sujan your sample worked. Great!!!.
bbye
|
|
|
|
|
Hy,
You mas't handle WM_ERASEBKGND window message fill client area whith black color,
then override OnPaint function on you CView delivered class.
|
|
|
|
|
well the easiest way to do this is to set the brush to the color you want in the PrecreateWindow message..... change the brush and the color changes to whatever brush you use.
for your particular use... just add this line in your view's PrecreateWindow message..
cs.lpszClass = AfxRegisterWndClass(CS_DBLCLKS|CS_HREDRAW|CS_VREDRAW,AfxGetApp()->LoadCursor(IDC_ARROW),CreateSolidBrush(RGB(0,0,0)));
this will do it... change the parameters of the RGB macro in CreateSolidBrush to whatever color u want.
hope this will help.
nutkase....
|
|
|
|
|
CFDlink.exe->This is the name of the exe.
1)When I double click the CFDlink.exe in Windows 2000.The CFDlink GUI is opens and I clicked the
File->Open the application is not hanged.
2) But when I rename the CFDlink.exe to CFDlink_org.exe.And I double click the CFDlink_org.exe in Windows 2000.The CFDlink GUI opens & then I click the File->Open, then the CFDlink_org GUI hanged.
3)I not faced any such problem in Windows XP.Please let me know why such problem is occurs only in Windows 2000?
|
|
|
|
|
Hiya people,im looking for some help im in the middle of coding a window manager in vc++ this has been going okay,but i realised i could well be doing this the hard way,okay i made two listbox's one listbox stored all the title's of the descktop windows so that you can select basicaly select a window by its title and destroy or minimize it whatever the case maybe,the second list box was invisible and disabled and this was holding the handles to the windows that i recived with the EnumWindowsProc callback func,my intention was that it looked tidier not being able to see the text version of the handle to the window, so when i selected the title of the window from the first listbox that i wanted to perform an operation on,it would automaticaly match the title to the parent window's handle in the second listbox so that i could grab it and pass it too another api func.
i was wondering if i can use an array to store the handles to the windows but i would somehow need to be able to make reference to them from the title of the parent window i would like to close,
so to clear things up im a bit unsure about..
do arrays have to be static and store data that dosent change?
and what if you dont know the agsact size of an array?
does all this have to be predefined.
well thanks for your help i hope i painted a half decent picture,i just dont want to do this the wrong way! thanks
|
|
|
|
|
I think you should look into EnumChildWindows and EnumWindows. (look on MSDN or here on CP)
Keeping handles for a long time is not smart. If you keep handles, try to keep them very locally.
Hope this helps.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix
|
|
|
|
|
Hello,
You can use a std::map<std::string, HANDLE> as an associative array to store the window handles...
Listboxes have a way of storing a 32 bit value with the item you inserted. MFC's CListBox provides SetItemData() for this purpose...
Multiply it by infinity and take it beyond eternity and you'll still have no idea about what I'm talking about.
|
|
|
|
|
Thankyou for your comments ill look into your advice!
|
|
|
|
|
I have a dialog that I have an edit box on. The dialog is named: IDD_OPENGLDIALOG_DIALOG and the edit control is named IDC_EDIT1. I am getting 'constant' error when I try to run the following code. I have tried many variations and I still get this error. Please help!
CString holder1,holder2,holder3,holder4,holder5,holder6,holder7;
holder1 += IDD_OPENGLDIALOG_DIALOG.IDC_EDIT1;
Thanks,
Chris
|
|
|
|