Toon posts:

Progje maken (auto shutdown)

Pagina: 1
Acties:
  • 124 views sinds 30-01-2008

Verwijderd

Topicstarter
Na lang zoeken naar een programma dat automatische windows xp afsluit op een aangegeven tijdstip, heb ik maar besloten om er zelf een te gaan maken. Ik heb alleen een heel klein beetje ervaring met Visual Basic, dus het moet daar in gebeuren.

Waar moet het aan voldoen?
* Moet simpel zijn
* Moet kunnen hiden in taskbar
* En moet tijd in kunnen stellen, dus niet zo'n aftel meter

Ik zou heel graag willen beginnen, maar helaas weet ik niet waar. Ik heb de layout al gemaakt in VB, maar nu de coding nog. Wie zou me kunnen helpen?

  • paulmadejong
  • Registratie: Maart 2001
  • Laatst online: 23-04 16:04
Ik heb een progje waarmee je kan aftellen maar zoals je zegt ben je daar niet naar opzoek. Ik zal eens kijken of ik dat kan veranderen. Meanwhile, probeer eens deze site " www.planet-source-code.com !!! :) :)
edit:

btw ik weet niet of dit progje het ook in winxp werkt omdat ik die niet heb :( :( :( :(

MacBook Pro 14" 2021


  • Aars
  • Registratie: November 2000
  • Laatst online: 16-01 13:59
http://www.barefootinc.com/asdownload.htm
Met dit programmaatje kan je precies hetzelfde doen, je kan hem ook laten afsluiten als je de pc al x aantal uur niet meer gebruikt hebt.

Alleen komt er bij mij op het eind te staan, u kunt nu de computer afsluiten, dus heb ik er nog niks aan ;(

-


Verwijderd

Topicstarter
Op dinsdag 02 oktober 2001 22:17 schreef paulmadejong het volgende:
Ik heb een progje waarmee je kan aftellen maar zoals je zegt ben je daar niet naar opzoek. Ik zal eens kijken of ik dat kan veranderen. Meanwhile, probeer eens deze site " www.planet-source-code.com !!! :) :)
edit:

btw ik weet niet of dit progje het ook in winxp werkt omdat ik die niet heb :( :( :( :(
Als je het zo kan veranderen, dan die goed is, zou ik je echt ongelovelijk dankbaar zijn!

  • The - DDD
  • Registratie: Januari 2000
  • Laatst online: 17-08 22:44
Onder een klein voorbehoudje, het volgende geld voor Windows NT 3.1 en hoger. Aangezien XP ook NT is, lijkt me dit wel een bestaande api functie in XP.
InitiateSystemShutdown
The InitiateSystemShutdown function initiates a shutdown and optional restart of the specified computer.

BOOL InitiateSystemShutdown(
LPTSTR lpMachineName, // pointer to name of computer to shut down
LPTSTR lpMessage, // pointer to message to display in
// dialog box
DWORD dwTimeout, // time to display dialog box
BOOL bForceAppsClosed, // force applications closed flag
BOOL bRebootAfterShutdown // reboot flag
);

Parameters
lpMachineName
Pointer to the null-terminated string that specifies the network name of the computer to shut down. If lpMachineName is NULL or points to an empty string, the function shuts down the local computer.
lpMessage
Pointer to a null-terminated string that specifies a message to display in the shutdown dialog box. This parameter can be NULL if no message is required.
dwTimeout
Specifies the time (in seconds) that the dialog box should be displayed. While this dialog box is displayed, the shutdown can be stopped by the AbortSystemShutdown function.
If dwTimeout is not zero, InitiateSystemShutdown displays a dialog box on the specified computer. The dialog box displays the name of the user who called the function, displays the message specified by the lpMessage parameter, and prompts the user to log off. The dialog box beeps when it is created and remains on top of other windows in the system. The dialog box can be moved but not closed. A timer counts down the remaining time before a forced shutdown. If the user logs off, the system shuts down immediately. Otherwise, the computer is shut down when the timer expires.

If dwTimeout is zero, the computer shuts down without displaying the dialog box, and the shutdown cannot be stopped by AbortSystemShutdown.

bForceAppsClosed
Specifies whether applications with unsaved changes are to be forcibly closed. If this parameter is TRUE, such applications are closed. If this parameter is FALSE, a dialog box is displayed prompting the user to close the applications.
bRebootAfterShutdown
Specifies whether the computer is to restart immediately after shutting down. If this parameter is TRUE, the computer is to restart. If this parameter is FALSE, the system flushes all caches to disk, clears the screen, and displays a message indicating that it is safe to power down.
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, callGetLastError.

Remarks
To shut down the local computer, the calling process must have the SE_SHUTDOWN_NAME privilege. To shut down a remote computer, the calling process must have the SE_REMOTE_SHUTDOWN_NAME privilege on the remote computer. By default, users can enable the SE_SHUTDOWN_NAME privilege on the computer they are logged onto, and administrators can enable the SE_REMOTE_SHUTDOWN_NAME privilege on remote computers.

Common reasons for failure include an invalid or inaccessible computer name or insufficient privilege.

QuickInfo
Windows NT: Requires version 3.1 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winreg.h.
Import Library: Use advapi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.

See Also
System Shutdown Overview, System Shutdown Functions, AbortSystemShutdown
Uit de MSDN...

Oh ja, als je een beetje bekend bent met VB komt dit:
code:
1
2
Public Declare Function InitiateSystemShutdown Lib "advapi32.dll"
Alias "InitiateSystemShutdownA" (ByVal lpMachineName As String, ByVal lpMessage As String, ByVal dwTimeout As Long, ByVal bForceAppsClosed As Long, ByVal bRebootAfterShutdown As Long) As Long

je wel bekend voor. Dat komt namelijk uit de apiviewer, die bij Visual Studio zit.

Verwijderd

Op dinsdag 02 oktober 2001 22:21 schreef Aars het volgende:
http://www.barefootinc.com/asdownload.htm
Met dit programmaatje kan je precies hetzelfde doen, je kan hem ook laten afsluiten als je de pc al x aantal uur niet meer gebruikt hebt.

Alleen komt er bij mij op het eind te staan, u kunt nu de computer afsluiten, dus heb ik er nog niks aan ;(
hey heb je winxp zoja moet je ff googlen het kan echt uit ben nu echt kapot ik ga slapen :Z :z :O

  • elevator
  • Registratie: December 2001
  • Niet online

elevator

Officieel moto fan :)

Op dinsdag 02 oktober 2001 22:12 schreef izoman het volgende:
Wie zou me kunnen helpen?
task scheduler + %systemroot%\system32\shutdown.exe + een batchfile ?

  • Soultaker
  • Registratie: September 2000
  • Laatst online: 15:34
Mooie scriptrequest zeg. Waarom is deze topic nog open?

Ik zie het nut van een applicatie niet, trouwens. Voor dit soort dingen is de taakplanner (en 'at' onder Windows NT/2000) uitgevonden.

Voor het feitelijke shutdown commando: googlen op rundll en shutdown.

  • D2k
  • Registratie: Januari 2001
  • Laatst online: 31-08 10:19

D2k

Soultaker: ben net thuis :+
<hr>
Hoi,
deze thread gaat dicht :)
Dit is wat wij noemen een scriptrequest en die mogen hier niet.
P&W is gericht op het zelf maken van dingen en in het oplossen van problemen die daarbij kunnen ontstaan.
Kijk bijvoorbeeld eens op www.hotscripts.com of in de P&W faq.
Zie voor discussies: [topic=411717/1/25]

Doet iets met Cloud (MS/IBM)

Pagina: 1

Dit topic is gesloten.