Permalink
Browse files

The first commit

  • Loading branch information...
igr committed Sep 2, 2017
0 parents commit e564d8598a9161193ae75164439f6f89f75b8593
Showing with 21,971 additions and 0 deletions.
  1. +27 −0 dist.bat
  2. +348 −0 dm2-plugins/CDControl/CDControl.c
  3. +4 −0 dm2-plugins/CDControl/CDControl.def
  4. +115 −0 dm2-plugins/CDControl/CDControl.dsp
  5. +29 −0 dm2-plugins/CDControl/CDControl.dsw
  6. +97 −0 dm2-plugins/CDControl/CDControl.rc
  7. +18 −0 dm2-plugins/CDControl/CDControl.txt
  8. +18 −0 dm2-plugins/CDControl/resource.h
  9. +57 −0 dm2-plugins/CloseMonitor/CloseMonitor.c
  10. +4 −0 dm2-plugins/CloseMonitor/CloseMonitor.def
  11. +113 −0 dm2-plugins/CloseMonitor/CloseMonitor.dsp
  12. +29 −0 dm2-plugins/CloseMonitor/CloseMonitor.dsw
  13. +55 −0 dm2-plugins/DM2Plugins.h
  14. +128 −0 dm2-plugins/EasyGamma/EasyGamma.c
  15. +4 −0 dm2-plugins/EasyGamma/EasyGamma.def
  16. +113 −0 dm2-plugins/EasyGamma/EasyGamma.dsp
  17. +29 −0 dm2-plugins/EasyGamma/EasyGamma.dsw
  18. +13 −0 dm2-plugins/EasyGamma/EasyGamma.txt
  19. +144 −0 dm2-plugins/PasteSn/PasteSn.c
  20. +4 −0 dm2-plugins/PasteSn/PasteSn.def
  21. +109 −0 dm2-plugins/PasteSn/PasteSn.dsp
  22. +29 −0 dm2-plugins/PasteSn/PasteSn.dsw
  23. +75 −0 dm2-plugins/PluginsExample/PluginsExample.c
  24. +4 −0 dm2-plugins/PluginsExample/PluginsExample.def
  25. +113 −0 dm2-plugins/PluginsExample/PluginsExample.dsp
  26. +29 −0 dm2-plugins/PluginsExample/PluginsExample.dsw
  27. +233 −0 dm2-plugins/RollWindows/RollWindows.c
  28. +4 −0 dm2-plugins/RollWindows/RollWindows.def
  29. +114 −0 dm2-plugins/RollWindows/RollWindows.dsp
  30. +29 −0 dm2-plugins/RollWindows/RollWindows.dsw
  31. +214 −0 dm2-plugins/VOLControl/VOLControl.c
  32. +4 −0 dm2-plugins/VOLControl/VOLControl.def
  33. +113 −0 dm2-plugins/VOLControl/VOLControl.dsp
  34. +29 −0 dm2-plugins/VOLControl/VOLControl.dsw
  35. +18 −0 dm2-plugins/VOLControl/VOLControl.txt
  36. +238 −0 dm2-plugins/VirtualDesktop/VDArrange.c
  37. +135 −0 dm2-plugins/VirtualDesktop/VDManager.c
  38. +299 −0 dm2-plugins/VirtualDesktop/VirtualDesktop.c
  39. +4 −0 dm2-plugins/VirtualDesktop/VirtualDesktop.def
  40. +172 −0 dm2-plugins/VirtualDesktop/VirtualDesktop.dsp
  41. +29 −0 dm2-plugins/VirtualDesktop/VirtualDesktop.dsw
  42. +39 −0 dm2-plugins/VirtualDesktop/VirtualDesktop.h
  43. +187 −0 dm2-plugins/VirtualDesktop/VirtualDesktop.rc
  44. +137 −0 dm2-plugins/VirtualDesktop/VirtualDesktopOption.c
  45. BIN dm2-plugins/VirtualDesktop/res/VDesk1.ico
  46. BIN dm2-plugins/VirtualDesktop/res/VDesk2.ico
  47. BIN dm2-plugins/VirtualDesktop/res/VDesk3.ico
  48. BIN dm2-plugins/VirtualDesktop/res/VDesk4.ico
  49. BIN dm2-plugins/VirtualDesktop/res/VDesk5.ico
  50. BIN dm2-plugins/VirtualDesktop/res/VDesk6.ico
  51. BIN dm2-plugins/VirtualDesktop/res/VDesk7.ico
  52. BIN dm2-plugins/VirtualDesktop/res/VDesk8.ico
  53. +48 −0 dm2-plugins/VirtualDesktop/resource.h
  54. +236 −0 dm2-plugins/WinEnable/WinEnable.c
  55. +4 −0 dm2-plugins/WinEnable/WinEnable.def
  56. +124 −0 dm2-plugins/WinEnable/WinEnable.dsp
  57. +29 −0 dm2-plugins/WinEnable/WinEnable.dsw
  58. BIN dm2-plugins/WinEnable/WinEnable.ico
  59. +106 −0 dm2-plugins/WinEnable/WinEnable.rc
  60. +20 −0 dm2-plugins/WinEnable/resource.h
  61. +11 −0 dm2/DM2DLL/DLL.def
  62. +165 −0 dm2/DM2DLL/DM2DLL.dsp
  63. +72 −0 dm2/DM2DLL/DM2DLL.rc
  64. +176 −0 dm2/DM2DLL/DllMain.c
  65. +9 −0 dm2/DM2DLL/DllMain.h
  66. +577 −0 dm2/DM2DLL/HookDialog.c
  67. +115 −0 dm2/DM2DLL/HookMsg.c
  68. +74 −0 dm2/DM2DLL/HookProcRet.c
  69. +129 −0 dm2/DM2DLL/ModifySysMenu.c
  70. +2 −0 dm2/DM2DLL/ModifySysMenu.h
  71. BIN dm2/DM2DLL/fav2.ico
  72. +4 −0 dm2/DM2DLL/hook.h
  73. +53 −0 dm2/DM2DLL/hookMouse.c
  74. +16 −0 dm2/DM2DLL/resource.h
  75. BIN dm2/DM2EXE/Align.bmp
  76. +269 −0 dm2/DM2EXE/DM2.c
  77. +66 −0 dm2/DM2EXE/DM2.h
  78. +273 −0 dm2/DM2EXE/DM2EXE.dsp
  79. +897 −0 dm2/DM2EXE/GetSetting.c
  80. +140 −0 dm2/DM2EXE/GetSetting.h
  81. +102 −0 dm2/DM2EXE/MImage.c
  82. +7 −0 dm2/DM2EXE/MImage.h
  83. +146 −0 dm2/DM2EXE/MultiLanguage.c
  84. +11 −0 dm2/DM2EXE/MultiLanguage.h
  85. +135 −0 dm2/DM2EXE/Plugins.c
  86. +58 −0 dm2/DM2EXE/Plugins.h
  87. +84 −0 dm2/DM2EXE/SettingDialog/AboutDlg.c
  88. +489 −0 dm2/DM2EXE/SettingDialog/ActionDlg.c
  89. +215 −0 dm2/DM2EXE/SettingDialog/AdvanceDlg.c
  90. +320 −0 dm2/DM2EXE/SettingDialog/CustomDlg.c
  91. +210 −0 dm2/DM2EXE/SettingDialog/ExceptionDlg.c
  92. +1,089 −0 dm2/DM2EXE/SettingDialog/FavMenuDlg.c
  93. +220 −0 dm2/DM2EXE/SettingDialog/GeneralDlg.c
  94. +763 −0 dm2/DM2EXE/SettingDialog/HotKeyDlg.c
  95. +121 −0 dm2/DM2EXE/SettingDialog/PluginsDlg.c
  96. +440 −0 dm2/DM2EXE/SettingDialog/SettingDlg.c
  97. +55 −0 dm2/DM2EXE/SettingDialog/SettingDlg.h
  98. +242 −0 dm2/DM2EXE/SettingDialog/WinMangerDlg.c
  99. BIN dm2/DM2EXE/TreeDir.ico
  100. BIN dm2/DM2EXE/TreeItem.ico
  101. +161 −0 dm2/DM2EXE/URLCtrl.c
  102. +609 −0 dm2/DM2EXE/dm2.rc
  103. +537 −0 dm2/DM2EXE/dm2WndProc.c
  104. +5 −0 dm2/DM2EXE/dm2WndProc.h
  105. +479 −0 dm2/DM2EXE/float.c
  106. +12 −0 dm2/DM2EXE/float.h
  107. +214 −0 dm2/DM2EXE/resource.h
  108. +375 −0 dm2/DM2EXE/util.c
  109. +26 −0 dm2/DM2EXE/util.h
  110. +170 −0 dm2/DM2EXE/wnddata.c
  111. +34 −0 dm2/DM2EXE/wnddata.h
  112. +44 −0 dm2/dm2.dsw
  113. BIN dm2/dm2.ico
  114. BIN dm2/dm2.jpg
  115. BIN dm2/dm2.psd
  116. BIN dm2/fav2.ico
  117. +97 −0 dm2/global.h
  118. +340 −0 dm2/gpl.txt
  119. +120 −0 dm2/history.txt
  120. +97 −0 dm2/license.txt
  121. BIN dm2/regexp/RegExp.chm
  122. +20 −0 dm2/regexp/regexp.h
  123. BIN dm2/regexp/regexp.lib
  124. +301 −0 dm2/tools.c
  125. +18 −0 dm2/tools.h
  126. +273 −0 language/Chinese.lang
  127. +275 −0 language/Czech.lang
  128. +274 −0 language/English.lang
  129. +273 −0 language/French.lang
  130. +273 −0 language/German.lang
  131. +274 −0 language/Hellenic(Greek).lang
  132. +276 −0 language/Italiano.lang
  133. +270 −0 language/Japanese.lang
  134. +276 −0 language/Nederlands.lang
  135. +274 −0 language/Portuguese(Brazil).Alt.lang
  136. +273 −0 language/Portuguese(Brazil).lang
  137. +263 −0 language/Russian.lang
  138. +278 −0 language/Serbian.lang
  139. +276 −0 language/Slovak.Alt.lang
  140. +274 −0 language/Slovak.Alt2.lang
  141. +278 −0 language/Slovak.lang
  142. +273 −0 language/Spanish.Alt.lang
  143. +273 −0 language/Spanish.Alt2.lang
  144. +273 −0 language/Spanish.lang
  145. +275 −0 language/Svenska.lang
  146. +263 −0 language/Traditional Chinese.Alt.lang
  147. +273 −0 language/Traditional Chinese.lang
  148. +274 −0 language/Turkish.lang
@@ -0,0 +1,27 @@
@echo off
SET version=1.22
echo.
echo DM2 v%version%
echo.
del /Q dist\*
echo [prepare]
copy /Y dm2\Release\* release\
copy /Y dm2\*.txt release\doc\
copy /Y language\*.lang release\language\
echo [release]
cd release
zip -9 -q -r ../dist/dm2-%version%.zip *.*
cd..
echo done.
echo.
echo [source]
zip -9 -q -r dist/dm2-all-%version%.zip release dm2-plugins\*.* dm2\*.* -xi *.ncb *.opt *.plg *\.svn\* dm2\DM2???\Release\* dm2\DM2???\Debug\*
echo done.
echo.
set version=
@@ -0,0 +1,348 @@
#include <windows.h>
#include "../dm2Plugins.h"
#include "resource.h"
#ifdef NDEBUG
#pragma optimize("gsy", on)
#pragma comment(linker, "/ENTRY:DllMain")
#pragma comment(linker, "/IGNORE:4078 /IGNORE:4089")
#pragma comment(linker, "/RELEASE")
#pragma comment(linker, "/merge:.rdata=.data")
#pragma comment(linker, "/merge:.text=.data")
#pragma comment(linker, "/merge:.reloc=.data")
#if _MSC_VER >= 1000
#pragma comment(linker, "/FILEALIGN:0x200")
#endif
#endif
#ifdef NDEBUG
#pragma comment(lib, "msvcrt.lib")
#pragma comment(linker, "/NODEFAULTLIB:LIBC.lib")
#else
#pragma comment(lib, "msvcrtd.lib")
#pragma comment(linker, "/NODEFAULTLIB:LIBCD.lib")
#endif
#define CD_DRIVE_AUTO 0
#define CD_DRIVE_OPEN 1
#define CD_DRIVE_CLOSE 2
static char *ver = "CDControl v0.04";
static char *cmd = "dm2_ext_cmd_cdcontrol";
static char *cmdcmt = "CD-ROM Control (Plugins)";
HWND hServer;
BOOL AutoClose;
int ACTime;
void CD_OpenCloseDrive(int OpenDrive, char cDrive)
{
MCI_OPEN_PARMS op;
MCI_STATUS_PARMS st;
DWORD flags;
char szDriveName[4];
lstrcpy(szDriveName, "X:");
ZeroMemory(&op, sizeof(MCI_OPEN_PARMS));
op.lpstrDeviceType = (LPCSTR) MCI_DEVTYPE_CD_AUDIO;
if(cDrive > 1)
{
szDriveName[0] = cDrive;
op.lpstrElementName = szDriveName;
flags = MCI_OPEN_TYPE | MCI_OPEN_TYPE_ID | MCI_OPEN_ELEMENT | MCI_OPEN_SHAREABLE;
}
else flags = MCI_OPEN_TYPE | MCI_OPEN_TYPE_ID | MCI_OPEN_SHAREABLE;
if (!mciSendCommand(0, MCI_OPEN, flags, (unsigned long)&op))
{
st.dwItem = MCI_STATUS_READY;
if(OpenDrive == CD_DRIVE_OPEN)
{
mciSendCommand(op.wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, 0);
//set auto close.
if(AutoClose) SetTimer(hServer, cDrive, ACTime*1000, NULL);
}
else if(OpenDrive == CD_DRIVE_CLOSE)
{
//if cd door closed auto close stop.
if(AutoClose) KillTimer(hServer, cDrive);
mciSendCommand(op.wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, 0);
}
else if(OpenDrive == CD_DRIVE_AUTO)
{
int n, i = GetTickCount();
mciSendCommand(op.wDeviceID, MCI_SET, MCI_SET_DOOR_OPEN, 0);
if(AutoClose) SetTimer(hServer, cDrive, ACTime*1000, NULL);
n = GetTickCount();
if(n - i < 200)
{
if(AutoClose) KillTimer(hServer, cDrive);
mciSendCommand(op.wDeviceID, MCI_SET, MCI_SET_DOOR_CLOSED, 0);
}
}
mciSendCommand(op.wDeviceID, MCI_CLOSE, MCI_WAIT, 0);
}
}
void CD_OpenCloseAllDrives(int OpenDrives)
{
// Determine All CD Drives and Open (or Close) each one
int n = 0;
UINT nCount = 0;
char szDrive[4];
DWORD dwDriveList = GetLogicalDrives();
lstrcpy(szDrive, "?:\\");
while (TRUE) {
szDrive[0] = 'c'+n;
if (szDrive[0] <= 'z')
{
if(GetDriveType(szDrive) == DRIVE_CDROM)
CD_OpenCloseDrive(OpenDrives, szDrive[0]);
}
dwDriveList >>= 1;
n++;
}
}
LRESULT WINAPI CDCProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_TIMER:
CD_OpenCloseDrive(CD_DRIVE_CLOSE, (char)wParam);
break;
default:
break;
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}
HINSTANCE hPlugin;
char *CDCServer = "CD Control Server";
DWORD WINAPI RunServer(LPVOID lpParameter)
{
MSG msg;
WNDCLASSEX wc;
ZeroMemory(&wc, sizeof(WNDCLASSEX));
wc.cbSize = sizeof(WNDCLASSEX);
wc.lpfnWndProc = CDCProc;
wc.hInstance = hPlugin;
wc.lpszClassName = CDCServer;
if (RegisterClassEx(&wc) == FALSE) {
return FALSE;
}
hServer = CreateWindow(CDCServer, "", 0, -1, -1, 0, 0,
NULL, NULL, hPlugin, NULL);
while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return TRUE;
}
HANDLE hThread;
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch(ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
DWORD tid;
hPlugin = hModule;
hThread = CreateThread(NULL, 0, RunServer, NULL,
NORMAL_PRIORITY_CLASS, &tid);
}
break;
case DLL_PROCESS_DETACH:
DestroyWindow(hServer);
TerminateThread(hThread, TRUE);
CloseHandle(hThread);
break;
}
return TRUE;
}
void ShowAbout(HWND hwnd_dm2)
{
MessageBox(hwnd_dm2, "CDControl plugins v0.04\r--help you Control CD-ROM.\r\rCode by flyfancy. 2007.3", "About",
MB_OK|MB_ICONINFORMATION);
}
void ExecPlugins(HWND hwnd_dm2, char **argv, int argc, BOOL bUnNeed)
{
int nOpenClose; // See #define's above
int nLen;
char cDrive = 0;
char *pDrv;
//get drive control command.
if(argc == 2)
{
if(lstrcmpi(argv[0], "open") == 0)
nOpenClose = CD_DRIVE_OPEN;
else if(lstrcmpi(argv[0], "close") == 0)
nOpenClose = CD_DRIVE_CLOSE;
else
return;
pDrv = argv[1];
}
else if(argc == 1)
{
nOpenClose = CD_DRIVE_AUTO;
pDrv = argv[0];
}
else
return;
//get drive.
if(lstrcmpi(pDrv, "all") == 0)
cDrive = 0;
else
{
//this api have a error can't get all driver some time
//DWORD dwDriveList = GetLogicalDrives();
nLen = lstrlen(pDrv);
CharLower(pDrv);
if(nLen>2) return;
if(nLen == 2 && pDrv[1] != ':') return;
if(isdigit(pDrv[0]))
{
char szRoot[4];
int j = 0, n = 1, i = atoi(pDrv);
if(i < 1 || i > 23)
return;
lstrcpy(szRoot, "?:\\");
while(TRUE)
{
szRoot[0] = 'c'+n;
if (szRoot[0] <= 'z')
{
if(GetDriveType(szRoot) == DRIVE_CDROM)
j++;
if(j == i)
{
cDrive = szRoot[0];
break;
}
}
n++;
}
}
else if((pDrv[0] <= 'c') || (pDrv[0] > 'z')) return;
else cDrive = pDrv[0];
}
//control drive.
if(cDrive == 0)
CD_OpenCloseAllDrives(nOpenClose);
else
CD_OpenCloseDrive(nOpenClose, cDrive);
}
char *pIni;
char *pSec = "Plugins_Settings";
char *pKey = "CD_AutoClose";
char *pKey1 = "CD_ACTime";
INT_PTR CALLBACK CfgDlgProc(HWND hwndDlg, UINT uMsg,
WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_INITDIALOG:
SetWindowText(hwndDlg, ver);
if(AutoClose)
CheckDlgButton(hwndDlg, IDC_CHK_AUTOCLOSE, BST_CHECKED);
EnableWindow(GetDlgItem(hwndDlg, IDC_COMBO_TIME), AutoClose);
{
char szTime[4];
HWND hCombo = GetDlgItem(hwndDlg, IDC_COMBO_TIME);
wsprintf(szTime, "%d", ACTime);
SendMessage(hCombo, WM_SETTEXT, 0, (LPARAM)szTime);
SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)"5");
SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)"10");
SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)"15");
SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)"20");
SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)"30");
SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)"60");
SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)"90");
SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM)"120");
}
return TRUE;
case WM_DESTROY:
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
case IDOK:
{
char szTime[4];
GetDlgItemText(hwndDlg, IDC_COMBO_TIME, szTime, 4);
ACTime = atoi(szTime);
if(ACTime < 5) ACTime = 5;
else if(ACTime > 120) ACTime = 120;
AutoClose = (IsDlgButtonChecked(hwndDlg, IDC_CHK_AUTOCLOSE) == BST_CHECKED);
//write ini
wsprintf(szTime, "%d", AutoClose);
WritePrivateProfileString(pSec, pKey, szTime, pIni);
wsprintf(szTime, "%d", ACTime);
WritePrivateProfileString(pSec, pKey1, szTime, pIni);
}
EndDialog(hwndDlg, IDOK);
break;
case IDCANCEL:
EndDialog(hwndDlg, IDCANCEL);
break;
case IDC_CHK_AUTOCLOSE:
if(IsDlgButtonChecked(hwndDlg, IDC_CHK_AUTOCLOSE) == BST_CHECKED)
AutoClose = TRUE;
else
AutoClose = FALSE;
EnableWindow(GetDlgItem(hwndDlg, IDC_COMBO_TIME), AutoClose);
break;
default:
break;
}
break;
default:
break;
}
return FALSE;
}
void NeedConfig(HWND hwnd_dm2, char *szini)
{
pIni = szini;
DialogBox(hPlugin, (LPCTSTR)IDD_CDC, hwnd_dm2, CfgDlgProc);
}
void InitPlugins(char *szini)
{
AutoClose = (GetPrivateProfileInt(pSec, pKey, 0, szini) != 0);
ACTime = GetPrivateProfileInt(pSec, pKey1, 15, szini);
if(ACTime < 5) ACTime = 5;
else if(ACTime > 120) ACTime = 120;
}
void dm2_get_interface(PFF_PLUGINS ffp)
{
ffp->About = ShowAbout;
ffp->Config = NeedConfig;
ffp->Execute = ExecPlugins;
ffp->InitPlugins = InitPlugins;
ffp->pName = ver;
ffp->pComments = cmdcmt;
ffp->pCmd = cmd;
ffp->PluginsCategory = FFPC_HOTKEY;
ffp->SDKversion = PLUGINSVER;
}
@@ -0,0 +1,4 @@
LIBRARY CDControl
DESCRIPTION "DialogMate2 plugins - CD Control module. code by flyfancy"
EXPORTS dm2_get_interface
Oops, something went wrong.

0 comments on commit e564d85

Please sign in to comment.