Sharewareluncher.c
上传用户:sales84
上传日期:2007-01-11
资源大小:864k
文件大小:36k
- #include <userdlg.h>
#include <cpl.h>
#include <dde.h>
#include "resource.h"
#include "sharewareluncher.h"
#include "time1.h"
#include "tab.h"
#define MYWM_EXEACT (WM_USER+112)
#define RUN_MIN 0
#define RUN_UNINSTALL 1
#define RUN_CLOSE 2
#define RUN_EXE 3
typedef struct tagcool
{
int idx;
- }COOLITEM,*LPCOOLITEM;
HDDEDATA CALLBACK DdeCallBack(UINT uType,UINT uFmt,HCONV hConv,HSZ hsz1,HSZ hsz2,HDDEDATA hData,DWORD dwData1,DWORD dwData2);
void ExeAction(LPSTR);
int Runit(BOOL);
void MakeShortcut(void);
void Uninstall(BOOL bSysOnly);
void MakeUninstallLnk(BOOL);
void Getcmd(void);
BOOL CALLBACK APIENTRY QuitProc(HWND hWnd,UINT uMsg,UINT wParam,LONG lParam);
BOOL VRHD(void);
void RegCancelSubst(void);
BOOL CancelSubst(void);
extern int CutCmdLine(LPSTR s);
HINSTANCE hInst;
HBITMAP hbmMain,hbmSysButton,hbmAct,hbmClock,hbmBkg;
RECT Size;
BUTTONPOS bsSys[]={{0,206,8,16,14,0,0,TRUE},{1,240,8,16,14,16,0,TRUE}};
BUTTONPOS bsSysOrg[]={{0,206,8,16,14,206,8,TRUE},{1,240,8,16,14,240,8,TRUE}};
BUTTONPOS bsAct[]={{0,24,209,45,21,0,0,TRUE},{1,88,209,45,21,0,21,TRUE},{2,154,209,45,21,0,42,TRUE}};
BUTTONPOS bsActPushed[]={{0,24,209,45,21,45,0,TRUE},{1,88,209,45,21,45,21,TRUE},{2,154,209,45,21,45,42,TRUE}};
BUTTONPOS bsActOrg[]={{0,24,209,45,21,24,209,TRUE},{1,88,209,45,21,88,209,TRUE},{2,154,209,45,21,154,209,TRUE}};
char szErrr[300];
extern char szErr[256];
BOOL bInTarget=FALSE,bHold=FALSE,bHoldInAct=FALSE,InReady=TRUE,bInAct=FALSE;
int i,iSysNo=-1,nActNo=-1,iActNo=-1;
HMENU hmenu;
HMENU hmenuTrackPopup;
BOOL bSetAuto=FALSE,bRunMin=FALSE;
DWORD dwThreadId=0,dwKlockId=1;
extern APPINFO aiAppInfo[50];
HWND hMainWnd;
BOOL bMined=FALSE,bQuit=FALSE,bDlgRuned=FALSE;
TIMERINFO ti[10];
extern int nAlarmEveryHour,nDlgflag;
extern int nAppNum;
extern BOOL bSheet;
extern HWND hSheetWnd;
extern HBITMAP hbmHHour[3],hbmLHour[10],hbmHMin[6],hbmLMin[10];
extern HBITMAP hbmHSec[6],hbmLSec[10],hbmClockBkg;
HANDLE hTimeSecWnd;
BOOL bHelp=FALSE,bVerChanged=FALSE;
/////////flag of vrhd////////
BOOL IsVRHD=FALSE; //=true,drive a: is virtual floppy disk
/////DDE diclare///////////
DWORD idInst=0;
char szDdeTitle[]="sharewareluncher";
HSZ hszAppName;
HCONV hConv;
char szCommand[300];
int nRunflag;
//////////////////////////
extern HWND hBaseWnd;
extern HWND hListAppWnd,hAddWnd;
char szRunCommand[300];
BOOL bAddExe=FALSE,bCreateLink=FALSE;
char cmd[MAX_PATH];
///////cool menu//////////
DRAWITEMSTRUCT dis;
COOLITEM ci[50];
int nOldSel=-1,nSel=-1;
HICON hicon[50];
HWND hQuitWnd=NULL; //标记“退出”对话框已显示,不能显示多个相同对话框
BOOL InitApplication(HINSTANCE hInstance)
{
WNDCLASS wc;
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = (long (FAR PASCAL*)())MainWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPICON));
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL;//"NINJA"; // Name of menu resource in .RC file.
wc.lpszClassName = "MyApp"; // Name used in call to CreateWindow.
return (RegisterClass(&wc));
}
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
HWND hWnd;
hWnd = CreateWindowEx(
0,//WS_EX_TOOLWINDOW,
"MyApp",
"共享软件程序发射器",
WS_POPUP,//|WS_SIZEBOX,
(Size.right-265)/2,
(Size.bottom-240)/2,
265,// Default width.
240,// Default height.
NULL,
NULL,// Use the window class menu.
hInstance,
NULL
);
if (!hWnd)
return (FALSE);
//ShowOwnedPopups(hWnd,TRUE);
if(bRunMin)
ShowWindow(hWnd,SW_MINIMIZE);
else
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return (TRUE);
}
#pragma argsused
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hNull,LPSTR lpCmdLine, int nCmdShow)
{
MSG msg;
hInst=hInstance;
if(strcmp(lpCmdLine,"