Şimdi Ara

c/c++ reset kodu

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
1 Misafir - 1 Masaüstü
5 sn
6
Cevap
0
Favori
908
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
Öne Çıkar
0 oy
Sayfa: 1
Giriş
Mesaj
  • arkadaslar ben c/c++ da bilgisatarı yeniden başlatacak/kapatacak reset kodu arıyorum hangisi olursa olsun farketmez kod daha çok borland c/c++ 3.1 uyumlu olursa ve xp dede çalışısa iyi olur



    _____________________________
    Yüce Türk Milleti
    Diline sahip ÇIK
    Unutma başka Türkiye YOK
  • system("RUNDLL32 shell32.dll,SHExitWindowsEx 6");  //reset için 

    system("RUNDLL32 shell32.dll,SHExitWindowsEx 8"); //power-off için


    XP'de deneyemedim henüz sanırım çalışmıyor ama birazdan deneyip buraya yazarım.

    Buraya da bir bakhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/how_to_shut_down_the_system.asp

    Yukarıdaki kodları XP'de çalıştıramadım ama ME' da çalışıyordu doğru hatırlıyorsam.



    < Bu mesaj bu kişi tarafından değiştirildi PHaLaNX. -- 27 Temmuz 2005, 13:22:09 >
    _____________________________




  • xp içinde herhalde win apilerden yararlanmak gerekiyor bununla ilgili birşey bulusan iyi olur
    _____________________________
    Yüce Türk Milleti
    Diline sahip ÇIK
    Unutma başka Türkiye YOK
  • aşağıdaki linkte bir program var Dev C++ ta yazılmış
    belki işine yarar

    http://www.thecodeproject.com/dialog/RathShutdownArticle.asp
    _____________________________
    İYİ DÜŞÜN, İYİ KONUŞ, İYİ DAVRAN
  • quote:

    Orjinalden alıntı: VatooVatoo

    aşağıdaki linkte bir program var Dev C++ ta yazılmış
    belki işine yarar

    http://www.thecodeproject.com/dialog/RathShutdownArticle.asp

    bu bir türlü inmiyor siteye üyeyim
    _____________________________
    Yüce Türk Milleti
    Diline sahip ÇIK
    Unutma başka Türkiye YOK
  • How to Shut Down the System
    The following example uses the ExitWindowsEx function to shut down the system. Shutting down flushes file buffers to disk and brings the system to a condition in which it is safe to turn off the computer. The application must first enable the SE_SHUTDOWN_NAME privilege. For more information, see Privileges.


    BOOL MySystemShutdown()
    {
    HANDLE hToken;
    TOKEN_PRIVILEGES tkp;

    // Get a token for this process.

    if (!OpenProcessToken(GetCurrentProcess(),
    TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
    return( FALSE );

    // Get the LUID for the shutdown privilege.

    LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME,
    &tkp.Privileges[0].Luid);

    tkp.PrivilegeCount = 1; // one privilege to set
    tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;

    // Get the shutdown privilege for this process.

    AdjustTokenPrivileges(hToken, FALSE, &tkp, 0,
    (PTOKEN_PRIVILEGES)NULL, 0);

    if (GetLastError() != ERROR_SUCCESS)
    return FALSE;

    // Shut down the system and force all applications to close.

    if (!ExitWindowsEx(EWX_SHUTDOWN | EWX_FORCE,
    SHTDN_REASON_MAJOR_OPERATINGSYSTEM |
    SHTDN_REASON_MINOR_UPDATE |
    SHTDN_REASON_FLAG_PLANNED))
    return FALSE;

    return TRUE;
    }

    The final parameter in the call to ExitWindowsEx indicates that the system was shut down for a planning update of the operating system. For more information, see System Shutdown Reason Codes.

    Requirements
    Client Requires Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.
    Server Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server.
    Header Declared in Winuser.h; include Windows.h.
    Library Link to User32.lib.
    DLL Requires User32.dll.

    EWX_SHUTDOWN yerine EWX_REBOOT ile reboot edebilirsin. bu örnek interaktif kullanıcı isen geçerli değilsen InitiateSystemShutdown yada InitiateSystemShutdownEx fonksiyonlarını kullanmalısın.
    detaylı bilgi için MS Platform SDK da ExitWindowsEx fonksiyonuna bakmalısın.




  • Yapay Zeka’dan İlgili Konular
    C.S. v1.5 CFG ??
    18 yıl önce açıldı
    Daha Fazla Göster
    
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.