|
Look around function SetSystemPowerState in MSDN. She belongs to the Power Management group, where other PM related stuff in WinXP is documented.
Shutdown can be easily achieved directly with this function, but about the Wake-up feature, I never tried that, so I don't know.
|
|
|
|
|
I managed to figure out the shutdown using the Power Management functions. My real problem now is the wake-up feature. I know I can wakeup the system from poweroff using my BIOS RTC alarm. Also I know (by using the GetPwrCapabilities function) that my system support wakeup on RTC alarm from hibernation but my problem is that I do not know how to setup the wakeup call. Any informations on how to write data to my BIOS or to schedule an event using the power management functions would be appreciated.
Thanks for your time,
|
|
|
|
|
I scanned the OnNow specifications and Windows and found this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndevio/html/onnowapp.asp[^]
Where (at nearly bottom of the page) they write:
The OnNow-capable operating system can ensure that the PC system is in the working state at a scheduled time. To do this, applications can use timer objects to wake the PC from a low power state (assuming sufficient power is available). The operating system will track all timer objects and program the hardware with the next wake-up time when putting the system into the sleep state.
Create, Open, Set, and Cancel capabilities will be provided in "Waitable Timer" objects for use by event-handling applications or by Windows 2000 services. The following is an example:
BOOL SetWaitableTimer(HANDLE hTimer, const LARGE INTEGER *lpDueTime, LONG
lPeriod, PTIMERAPCROUTINE pfnCompletionRoutine, LPVOID
lpArgToCompletionRoutine, BOOL fResume)
|
|
|
|
|
I don't seem to be able to do what I want with that function...
|
|
|
|
|
Well, as I understood the documentation, you simply create a waitable timer to be waked at say 20 minutes, do the power down and windows should take care for the rest.
|
|
|
|
|
Hello,
I'm wondering if someone is familiar with the technique use by many programs today - starting the app before any other app, and pausing windows load (like adaware does).
Any help appreciated,
D>
|
|
|
|
|
to load a program from another, use ShellExecute() (or more deprecated WinExec() ).
to allow a program to be paused, you have to manage threads, with a flag raised by the GUI which is handled by the working thread...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
No,
I know how to launch program, the effect that I'm after is loading my application at windows startup, process tasks, and then allow or shut down the system
Thanks
|
|
|
|
|
See MSDN article Q179365.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Will do,
Thank you
|
|
|
|
|
Hi!
How could i replace for example the first byte (call it b0) of a UInt32 variable?
thx
|
|
|
|
|
zuschauer1980 wrote:
How could i replace for example the first byte (call it b0) of a UInt32 variable?
newVal = (oldVal & 0xffffff00) | (newByteVal & 0xff);
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"
|
|
|
|
|
By "first" do you mean least significant or most significant? Check out the bit-related operators such as AND (&), OR (|), NOT (~), and XOR (^).
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
|
Hi,
I am developing a marker application. Basically allows free-hand drawing with the mouse. When i draw a line, i want the window below also to visible. I am not able to create a transparent Pen for this? i tried BS_HOLLOW, but it doesn't draw at all.
hdc = CreateDC(TEXT("DISPLAY"),NULL,NULL,NULL);
lb.lbColor = rgbCurrent;
lb.lbHatch = NULL;
lb.lbStyle = BS_SOLID;
//hNewPen = CreatePen(PS_SOLID,10,rgbCurrent);
//SetROP2(hdc,R2_MERGEPEN);
hNewPen = ExtCreatePen(PS_GEOMETRIC,10,&lb,0,NULL);
//SelectObject(hdc,CreateBrushIndirect(&lb));
//SetDCBrushColor(hdc,rgbCurrent);
SelectObject(hdc,hNewPen);
MoveToEx(hdc, PrevX, PrevY, NULL);
LineTo(hdc, CurrX, CurrY);
DeleteDC(hdc);
........
Can anyone help?
Hercules
|
|
|
|
|
Hi, I don't remember it very well, but you may search SelectStockObject (NULL_PEN); //NULL_BRUSH
C U later
|
|
|
|
|
Thanks for replying...
But this code is all in Platform SDK, how do i create a NULL_PEN there. I create a BS_HOLLOW(same as BS_NULL) but it doesn't draw the line at all.
Your help will be appreciated!
Hercules
|
|
|
|
|
Can anyone tell me how to show line numbers in the editor in visual studio 6. I've looked and cant find out how.
Regards
Paul
|
|
|
|
|
I didn't think you could do this before VS2003.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Isn't it displayed in the status bar?
Don't try it, just do it!
|
|
|
|
|
I need to download a web page but I prefer not to use CHttpView because I do not need to display anything.
The problem is that in order to get to the page I want I need to login using a form. Using CHttpView I traced the form and found that the information passed is like :
URL: https://url.com/page.asp
PostData: ui=user&pass=pass&other=other
Headers: Content-Type: application/x-www-form-urlencoded
But still, browsing directly to https://url.com/page.asp?ui=user&pass=pass&other=other didn't work.
Is there a way to do this ?
I also would like to keep the session/connection to download other web pages from the same site (using the same cookie or whatever)
|
|
|
|
|
|
I can change the background colors of child controls of a dialog by responding to the WM_CTLCOLORxxx messages
Example:
case WM_CTLCOLORBTN:
hBrushButton = CreateSolidBrush(RGB(255,102,15));
return (int)hBrushButton;
Now I'm looking for a way to change the textcolor as well. This for buttons, labels, listboxes, ...
Thanks in advance,
Ward
http://users.belgacom.net/wardvantichelen
|
|
|
|
|
Check these api's
[SetTextColor],[SetBkColor]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
That helped me.
Thanks!
My code is now the following:
case WM_CTLCOLORSTATIC:
hBrushButton = CreateSolidBrush(RGB(255,102,15));
SetTextColor((HDC) wParam, RGB(255,255,255));
SetBkColor((HDC) wParam, RGB(255,102,15));
return (int)hBrushButton;
This results is a nice orange label with white text.
Greetz,
Ward
See more from me at http://users.belgacom.net/wardvantichelen
|
|
|
|