#include < QObject >
#include < QtGui >
#include < QtCore >
#include "MoiClass.h"
#include < QMessageBox >
#include < QDateTime >
#include "windows.h"
MyDateTime::MyDateTime(){}
QString MyDateTime::toString(){return(dt.toString("dd.MM.yyyy hh:mm:ss"));}
void MyDateTime::setDT(const QDateTime &dt0){dt=dt0;}
Gooo::Gooo()
{
this->setupUi(this);
QObject::connect(pushButton,SIGNAL(clicked()),this,SLOT(ButClick()));
}

void Gooo::ButClick()
{
QDateTime dt;dt=QDateTime::currentDateTime ();
MyDateTime mydt;
MyDateTime mydt1;
mydt=dt;
mydt1=mydt;

QMessageBox::warning(this,"---1",mydt1.toString(),QMessageBox::Save | QMessageBox::Discard| QMessageBox::Cancel,QMessageBox::Save);
UINT oo=WinExec("F:\\WINDOWS\\system32\\calc.exe",SW_SHOW);
QMessageBox::warning(this,"---1",QString::number(oo),QMessageBox::Cancel,QMessageBox::Save);

QString str="F:\\Program Files\\Windows NT\\Accessories\\wordpad.exe";
QString str1="\"C:\\1 ПРИВЕТ С.doc\"";
QString str2="\"C:\\ееее еее ее.71uu\"";

WinExecAndWait32(str+" "+str1,0);

RunProg(str2);

}
bool RunProg(QString str)
{
WCHAR array[1024];
memset(array,'\0',1024);
int col=str.toWCharArray(array);
HINSTANCE ooo=ShellExecute(0, L"open", array, NULL, NULL, SW_SHOW);
if (int(ooo)<=32)
QMessageBox::warning(0,"===","<=32",QMessageBox::Cancel,QMessageBox::Save);
}

bool WinExecAndWait32(QString str,int Visibility)
{
STARTUPINFO sj;
PROCESS_INFORMATION pj;

ZeroMemory( &sj, sizeof(sj) );
sj.cb = sizeof(sj);
ZeroMemory( &pj, sizeof(pj) );

WCHAR array[1024];
memset(array,'\0',1024);
int col=str.toWCharArray(array);

QMessageBox::warning(0,"=str.toWCharArray(array)",QString::number(col),QMessageBox::Cancel,QMessageBox::Save);

QString str00=QString::fromWCharArray(array)+"|";

QMessageBox::warning(0,"QString::fromWCharArray(array,col)",str00,QMessageBox::Cancel,QMessageBox::Save);

if(!CreateProcess(NULL/*L"F:\\WINDOWS\\system32\\calc.exe"*/, array, NULL, NULL, FALSE, 0, NULL, NULL, &sj, &pj))
{
QMessageBox::warning(0,"---1",QString::number(GetLastError() ),QMessageBox::Cancel,QMessageBox::Save);
}
WaitForSingleObject( pj.hProcess, INFINITE );
CloseHandle( pj.hProcess );
CloseHandle( pj.hThread );
}
Хостинг от uCoz