Popis funkcií WinAPI.h

 

-----------------------------------------------------------------

Všetké funkcie sú zakonpovaná do headeru WinAPI.h WinAPI.h


#include "WinAPI.h" //https://www.diallix.net/programing/163-module

int _cdecl main (void) 
{
  ::Diall_WinApi::WinApi::GetInstance()->SystemIntegrity(::Diall_WinApi::Privilege::ENABLE); 
//SetAttrib// ::Diall_WinApi::WinApi::GetInstance()->SetAttrib(L"c:\\diallix",::Diall_WinApi::FileAttribute::HIDDEN); //---------//
//IsAdminExec// bool result = ::Diall_WinApi::WinApi::GetInstance()->IsAdminExec(); if(result == true) { ::std::cout << "Program running with Admin. privileges!\n"; } else ::std::cout << "Program running without Admin. privileges!\n"; //----------//
//ClearConsole// ::Diall_WinApi::WinApi::GetInstance()->ClearConsole(); ::std::cout << "Hello from clean Window!\n"; //-----------//
//ExecuteFile// ::Diall_WinApi::WinApi::GetInstance()->ExecuteFile("c:\\diallix.exe", "", ::Diall_WinApi::SelfWindow::HIDE); ::Diall_WinApi::WinApi::GetInstance()->ExecuteFile("c:\\diallix.exe", "", ::Diall_WinApi::SelfWindow::SHOW); ::Diall_WinApi::WinApi::GetInstance()->ExecuteFile("c:\\diallix.exe", "\\myarg", ::Diall_WinApi::SelfWindow::SHOW); //----------//
//IsConnection// bool isconnect = ::Diall_WinApi::WinApi::GetInstance()->IsConnection(); if(isconnect) { ::std::cout<< "System is connected to internet\n"; } else ::std::cout<< "System is not connected to internet\n"; //-----------//
//CreateFolder// ::Diall_WinApi::WinApi::GetInstance()->CreateFolder("c:\\diallix\\diall"); //------------//
//CreateFile// //Function create hidden file// char * file = "c:\\myfile.txt"; ::std::string buffer = "HelloWord"; int size = sizeof(buffer); ::Diall_WinApi::WinApi::GetInstance()->CreateFile(file, (char*)buffer.c_str(), buffer.size()); //---------//
//TruncateFile// ::Diall_WinApi::WinApi::GetInstance()->TruncateFile("c:\\myfile.txt"); //------------//
//FileExists// bool isexists = ::Diall_WinApi::WinApi::GetInstance()->FileExists("c:\\diallix.exe"); if(isexists) { ::std::cout << "File esixts!\n"; } else ::std::cout << "File not esixts!\n"; //----------//
//GetFileSizeD// long filesize = ::Diall_WinApi::WinApi::GetInstance()->GetFileSizeD("c:\\myfile.txt"); cout << filesize << ::std::endl; //-----------//
//ToLower// char input1[] = "AHojSvet"; char * tolower = ::Diall_WinApi::WinApi::GetInstance()->ToLower(input1); ::std::cout << tolower << ::std::endl; //-------//
//DownloadFiles// ::Diall_WinApi::WinApi::GetInstance()->DownloadFiles("https:\\www.domain.net\\file.txt", "c:\\file.txt"); //------------//
//ImageLoad// ::Diall_WinApi::WinApi::GetInstance()->ImageLoad(IDB_BITMAP1, 0); //--------//
//AddExceptionFirewall// ::Diall_WinApi::WinApi::GetInstance()->AddExceptionFirewall("c:\\diallix.exe", "Diallix Sostware"); //-------------------//
//UploadToFTPServer// char * ftp = "ftp.diallix.net"; char * user = "diallix.net"; char * password = "123"; char * filepath = "c:\\diallix.net"; char * locationonftp = "/ClipBoard/lclip"; ::Diall_WinApi::WinApi::GetInstance()->UploadToFTPServer(ftp, user, password, filepath, locationonftp); //-----------------//
//CurrentTime// ::std::cout <<::Diall_WinApi::WinApi::GetInstance()->CurrentTime(); ::std::cout <<"\n"; //----------//
//GetFileExt// ::std::cout <<::Diall_WinApi::WinApi::GetInstance()->GetFileExt("c:\\decrxpt.exe"); ::std::cout <<"\n"; //----------//
//GetComputerName// ::std::cout << ::Diall_WinApi::WinApi::GetInstance()->GetComputerName(); ::std::cout <<"\n"; //---------------//
//GetSystemVersionInfo// int version = ::Diall_WinApi::WinApi::GetInstance()->GetSystemVersionInfo();
char * versionname = "";
switch(version) { case 81: versionname = "Win. 8.1"; break; case 8: versionname = "Win. 8"; break; case 7: versionname = "Win. 7"; break; case 1: versionname = "Win. Vista"; break; case 10: versionname = "Win. 10"; break; case 51: versionname = "Win. xp"; break; default: versionname = "Uknown"; break; }
::std::cout << versionname; //---------------//
//DeleteSelf// ::Diall_WinApi::WinApi::GetInstance()->DeleteSelf(); //--------//

//DeleteSelf// ::Diall_WinApi::WinApi::GetInstance()->CreateRestrePoint("Diallix programs Install"); //--------//


//GetFilename//
::std::cout << ::Diall_WinApi::WinApi::GetInstance()GetFileExt("c:\\a\\diallix.exe");
//--------//


//DStartProcess//
::Diall_WinApi::WinApi::GetInstance->StartProcess("c:\\diallixagent.exe");
//--------//



return 0;
}