-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPrint.cpp
executable file
·97 lines (76 loc) · 2.93 KB
/
Print.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include <modsim.h>
#include <windows.h>
#include <osmod.h>
#include <string.h>
#include <shlobj.h>
#include <shellapi.h>
#define MAX_SIZE 100
void PrintRBP( void )
{
char sProgDir[MAX_SIZE];
char sWorkDir[MAX_SIZE];
// int iret;
TCHAR szPath[_MAX_PATH];
MS_STRING sFilename = "\\Raptor7\\RapPrin70.exe";
SHGetSpecialFolderPath( NULL, szPath, CSIDL_APPDATA, FALSE );
if( strlen( szPath ) < (MAX_SIZE - strlen( sFilename ) - 1))
{
memcpy( sProgDir, szPath, strlen(szPath) + 1 );
memcpy (sWorkDir, szPath, strlen(szPath) + 1 );
strcat( sProgDir, sFilename );
strcat( sWorkDir, "\\raptor7" );
// the following doesn't wait for RapPrin70.exe to finish... use ShellExecuteEx instead
// iret = (int) ShellExecute( NULL, "open", sProgDir, "/p fromRBD.rbp", sWorkDir, SW_SHOWNORMAL);
SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = "open";
ShExecInfo.lpFile = sProgDir;
ShExecInfo.lpParameters = "/p fromRBD.rbp";
ShExecInfo.lpDirectory = sWorkDir;
ShExecInfo.nShow = NULL;
ShExecInfo.hInstApp = NULL;
bool res = ShellExecuteEx(&ShExecInfo);
if( res )
{
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
CloseHandle( ShExecInfo.hProcess );
}
}
}
void ConvertRBP( void )
{
char sProgDir[MAX_SIZE];
char sWorkDir[MAX_SIZE];
TCHAR szPath[_MAX_PATH];
MS_STRING sFilename = "\\Raptor7\\RapPrin70.exe";
SHGetSpecialFolderPath( NULL, szPath, CSIDL_APPDATA, FALSE );
if( strlen( szPath ) < (MAX_SIZE - strlen( sFilename ) - 1))
{
memcpy( sProgDir, szPath, strlen(szPath) + 1 );
memcpy (sWorkDir, szPath, strlen(szPath) + 1 );
strcat( sProgDir, sFilename );
strcat( sWorkDir, "\\Raptor7" );
// the following doesn't wait for RapPrin70.exe to finish... use ShellExecuteEx instead
ShellExecute( NULL, "open", sProgDir, "fromRBD.rbp", sWorkDir, SW_SHOWNORMAL); // {cmc 10/9/08}
/* {cmc 10/9/08}
SHELLEXECUTEINFO ShExecInfo = {0};
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = "open";
ShExecInfo.lpFile = sProgDir;
ShExecInfo.lpParameters = "fromRBD.rbp";
ShExecInfo.lpDirectory = sWorkDir;
ShExecInfo.nShow = NULL;
ShExecInfo.hInstApp = NULL;
bool res = ShellExecuteEx(&ShExecInfo);
if( res )
{
WaitForSingleObject(ShExecInfo.hProcess,INFINITE);
CloseHandle( ShExecInfo.hProcess );
}
*/ //{cmc 10/9/08}
}
}