FRANCISCO BRITO Posted August 4, 2004 Report Share Posted August 4, 2004 eu gostaria de saber se tem algum comando que dá para desligar um pc pelo programa de vb .Eu gostaria de fazer isso no meu gerenciador de tempo de lan house !!se alguém souber poste ai ! valeu Quote Link to comment Share on other sites More sharing options...
0 Decio Posted August 4, 2004 Report Share Posted August 4, 2004 você pode fazer isso com a API ExitWindows do Windows:'In general sectionConst EWX_LOGOFF = 0Const EWX_SHUTDOWN = 1Const EWX_REBOOT = 2Const EWX_FORCE = 4Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As LongPrivate Sub Form_Load() 'KPD-Team 1998 'URL: http://www.allapi.net/ 'E-Mail: [email protected] msg = MsgBox("This program is going to reboot your computer. Press OK to continue or Cancel to stop.", vbCritical + vbOKCancel + 256, App.Title) If msg = vbCancel Then End 'reboot the computer ret& = ExitWindowsEx(EWX_FORCE Or EWX_REBOOT, 0)End Sub Quote Link to comment Share on other sites More sharing options...
0 William Rodrigues Posted August 4, 2004 Report Share Posted August 4, 2004 Boa Decio Abraços,William Rodrigues Quote Link to comment Share on other sites More sharing options...
0 Fabson Posted August 4, 2004 Report Share Posted August 4, 2004 pode ser utilizado com qualquer versao do windows ? Quote Link to comment Share on other sites More sharing options...
0 Decio Posted August 4, 2004 Report Share Posted August 4, 2004 Segundo as informações do Site Api-Guide, esta API funciona para todas as versões do Windows.No meu caso eu testei no Windows 2000 e funcionou.A unica observação é que a fonte do micro tem que ser padrão ATX , é claro , pois caso contrário , não tem como o micro ser desligado. Quote Link to comment Share on other sites More sharing options...
0 FRANCISCO BRITO Posted August 5, 2004 Author Report Share Posted August 5, 2004 VALEU PELA DICA !!!!!! NUNCA VI TANTOS CARAS LEGAIS JUNTOS.NÃO SABIA COMO USAR A API DO WINDOWS . MAS CONSEGUI ENTENDER AGORA , AQUELES CÓDIGOS SÃO COLOCADOS EM UM BOTÃO OU FORM LOAD OU COISAS DESTE TIPO .....VALEU . DEU CERTO!OBRIGADO !!!!ABRAÇOS!!!ESPERO FICAR BOM COMO VOÇES PARA COLABORAR TAMBÉM !!! Quote Link to comment Share on other sites More sharing options...
0 Fabson Posted August 5, 2004 Report Share Posted August 5, 2004 Legal !Amigo Décio, se não for pedir muito, poderia passar o endereco desse site de APIsDesde já obrigado. Quote Link to comment Share on other sites More sharing options...
0 lxl_igor_lxl Posted August 5, 2004 Report Share Posted August 5, 2004 eu conheco esse não sei se vai te ajudar muitohttp://www.mentalis.org/index2.shtml Quote Link to comment Share on other sites More sharing options...
0 FRANCISCO BRITO Posted August 5, 2004 Author Report Share Posted August 5, 2004 http://www.allapi.net/ta ai o site fabson.falo.......... Quote Link to comment Share on other sites More sharing options...
0 Decio Posted August 5, 2004 Report Share Posted August 5, 2004 se não for pedir muito, poderia passar o endereco desse site de APIsNosso amigo FRANCISCO BRITO respondeu a sua pergunta.Entre no site e baixe uma versão do API-GUIDE que com certeza você tera uma boa fonte de pesquisa.o site que o lxl_igor_lxl indicou também é legal.Vale uma visita. Quote Link to comment Share on other sites More sharing options...
0 Fabson Posted August 6, 2004 Report Share Posted August 6, 2004 Agradeço ... a atenção dos amigos ...Até mais Quote Link to comment Share on other sites More sharing options...
0 William Rodrigues Posted August 6, 2004 Report Share Posted August 6, 2004 Agradeço ... a atenção dos amigos ...Até mais Beleza brother...Qualquer coisa é só falar Abraços,William Rodrigues Quote Link to comment Share on other sites More sharing options...
Question
FRANCISCO BRITO
eu gostaria de saber se tem algum comando que dá para desligar um pc pelo programa de vb .Eu gostaria de fazer isso no meu gerenciador de tempo de lan house !!
se alguém souber poste ai !

valeu
Link to comment
Share on other sites
11 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.