約 5,369,152 件
https://w.atwiki.jp/my-sql/pages/113.html
HOME 関数 日付と時刻関数 STR_TO_DATE STR_TO_DATE STR_TO_DATE(str,format) DATE_FORMAT() 関数と逆の働きをする。文字列 str と形式文字列 format を取り、DATETIME 型の値を返す。 str に指定した日付、時刻、または日付時刻の値が、format に指定した形式で返される。format に使用できる指定子については、DATE_FORMAT() 関数の説明にある表を参照。他の文字はいずれも、解釈されずに文字どおり受け取られる。 str に誤った日付、時刻、または日付時刻が含まれている場合、STR_TO_DATE() は NULL を返す。 mysql SELECT STR_TO_DATE( 03.10.2003 09.20 , %d.%m.%Y %H.%i ) - 2003-10-03 09 20 00 mysql SELECT STR_TO_DATE( 10rap , %crap ) - 0000-10-00 00 00 00 mysql SELECT STR_TO_DATE( 2003-15-10 00 00 00 , %Y-%m-%d %H %i %s ) - NULL STR_TO_DATE() は MySQL 4.1.1 以降で使用できる。
https://w.atwiki.jp/storyteller/pages/466.html
SIMPLE2000シリーズ Vol.31 THE 地球防衛軍 part19-187 187 名無しさん@お腹いっぱい。 sage 2005/11/07(月)18 23 30ID eupQXyfN ついでに地球防衛軍と地球防衛軍IIも書いたんで置いておく。 EDFとは「The EarthDefenseForce」すなわち連合地球軍の略称である。 世界全土の平和維持活動を目的として、国家の枠組みをこえて組織された超法規軍。それがEDFである。 主人公は、EDFの隊員の一人だ。基本的には命令に従い、各地で戦うことになる。 しかし、彼(彼女)が他の隊員と決定的に違う点。それは・・・ THE地球防衛軍 2017年、世界は蟻の酸に包まれた・・・ 突如現れたエイリアン。奴らが使う生物兵器、甲殻虫は蟻にそっくりだった。 壊滅的な被害を受ける世界。減り行く人類。 EDF極東支部でも、苦しい戦いが展開されていた。 しかし、他の地域と違う点がたった一つ。 この地域には「人類最強の戦士」が居たのだ・・・ 並み居る蟻やUFOを叩き潰す人類最強の戦士こと主人公。 仲間を酸だぁぁー!で失いながらも、たった一人(か二人)で孤独な戦いを続けていく。 黒蟻に赤蟻、巨大UFO、果ては40mはあろうかという巨大生物・・・それらを次々と屠っていく。 遂に敵軍の母船が日本に乗り込んできたが、主人公はこれをも撃墜する。 母船を失ったことで、エイリアンどもは撤退を開始。 たった一人の男が、戦況を覆した。
https://w.atwiki.jp/sampleisbest/pages/194.html
開発環境 Microsoft Visual C++ 2010 Express (SP1) 実行環境 Microsoft Windows XP Home Edition (SP3) プロジェクトの種類 Win32 プロジェクト プロジェクト名 ImgView2 アプリケーションの種類 Windows アプリケーション 追加のオプション 空のプロジェクト 文字セット Unicode 画像表示(エクスプローラの並び順) ImgView2.cpp // Unicode #include Windows.h #include CommCtrl.h #include shimgdata.h #include stdio.h #include string #include vector #include "resource.h" using namespace std; #define WIDTH(rect) ((rect).right - (rect).left) #define HEIGHT(rect) ((rect).bottom - (rect).top) #define SAFE_RELEASE(p) { if(p) { (p)- Release(); (p)=NULL; } } #define APP_NAME TEXT("ImgView2") typedef vector wstring VecStr; // 関数プロトタイプ宣言 void CreateFileList(LPCTSTR pszPath); BOOL GetFileList(HWND hExplorer, LPCTSTR pszFileName); BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam); BOOL IsImgFile(LPCTSTR pszPath); LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); BOOL OnCommand(HWND hWnd, WPARAM wParam); void OnDelete(HWND hWnd); void OnDropFiles(HWND hWnd, WPARAM wParam); void OnSizeNormal(HWND hWnd); void OnSizeAdjust(HWND hWnd); void OnExecute(void); void OnPaint(HWND hWnd); void GetImage(HWND hWnd); BOOL MyGetFileTime(LPSYSTEMTIME pSystemTime, LPCTSTR pszFileName); // 外部変数構造体 static struct { TCHAR szBaseDir[MAX_PATH];// 基準ディレクトリ VecStr vsFileName;// ファイル名配列 VecStr size_type idxCurr;// 現在の位置 IShellImageDataFactory *pImgDatFac;// 画像データファクトリ IShellImageData *pImgDat;// 画像データ SIZE sizeImg;// 画像サイズ SIZE sizeDst;// 出力サイズ HWND hListView;// エクスプローラのリストビュー } g; //============================================================================== int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow) { // プログラム引数 LPTSTR pszCmdLine = GetCommandLine(); int argc; LPTSTR *argv = CommandLineToArgvW(pszCmdLine, argc); if (2 = argc) { CreateFileList(argv[1]); } // ウィンドウクラスの登録 WNDCLASSEX wcx; ZeroMemory( wcx, sizeof wcx); wcx.cbSize= sizeof wcx; wcx.style= CS_HREDRAW | CS_VREDRAW; wcx.lpfnWndProc= WndProc; wcx.hInstance= hInstance; wcx.hCursor= LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW)); wcx.hbrBackground= (HBRUSH)(COLOR_WINDOW + 1); wcx.lpszClassName= APP_NAME; if (RegisterClassEx( wcx) == 0) { return 0; } // ウィンドウの作成 HWND hWnd = CreateWindowEx( WS_EX_ACCEPTFILES, APP_NAME, APP_NAME, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL); if (hWnd == NULL) { return 0; } ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); // メッセージループ MSG msg; HACCEL hAccTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDR_MAIN)); while (GetMessage( msg, NULL, 0, 0)) { if (TranslateAccelerator(msg.hwnd, hAccTable, msg) == 0) { TranslateMessage( msg); DispatchMessage( msg); } } return msg.wParam; } //------------------------------------------------------------------------------ void CreateFileList(LPCTSTR pszPath) { TCHAR szDrive[_MAX_DRIVE]; TCHAR szDir[_MAX_DIR]; TCHAR szFName[_MAX_FNAME]; TCHAR szExt[_MAX_EXT]; TCHAR szFileName[_MAX_PATH]; g.vsFileName.clear(); g.idxCurr = -1; errno_t er = _wsplitpath_s(pszPath, szDrive, szDir, szFName, szExt); swprintf_s(g.szBaseDir, L"%s%s", szDrive, szDir); swprintf_s(szFileName, L"%s%s", szFName, szExt); HWND hExplorer = NULL; while (hExplorer = FindWindowEx(NULL, hExplorer, L"ExploreWClass", NULL)) { GetFileList(hExplorer, szFileName); if (0 = g.idxCurr) { break; } } if (g.idxCurr == -1) { g.vsFileName.clear(); g.vsFileName.push_back(pszPath); g.idxCurr = 0; } } //------------------------------------------------------------------------------ BOOL GetFileList(HWND hExplorer, LPCTSTR pszFileName) { // リストビュー g.hListView = NULL; BOOL br = EnumChildWindows(hExplorer, EnumWindowsProc, 0); if (g.hListView == NULL) return FALSE; // 対象となるリストビューのプロセスハンドルを得る DWORD dwProcId = 0; GetWindowThreadProcessId(g.hListView, dwProcId); HANDLE hProc = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_READ | PROCESS_VM_WRITE, FALSE, dwProcId); if (hProc == NULL) return FALSE; // 他プロセス空間にメモリを確保 LPTSTR pbuf = (LPTSTR)VirtualAllocEx(hProc, NULL, MAX_PATH, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); LPLVITEM plvi = (LPLVITEM)VirtualAllocEx(hProc, NULL, sizeof (LVITEM), MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); // 行数 int nRowNum = ListView_GetItemCount(g.hListView); VecStr size_type idx = 0; // ListView_GetItemText LVITEM lvi; ZeroMemory( lvi, sizeof (LVITEM)); lvi.iSubItem= 0; lvi.mask= LVIF_TEXT; lvi.pszText= pbuf; lvi.cchTextMax= MAX_PATH; for (int nRow = 0; nRow nRowNum; nRow++) { lvi.iItem = nRow; WriteProcessMemory(hProc, plvi, lvi, sizeof (LVITEM), NULL); BOOL br = SendMessage(g.hListView, LVM_GETITEM, 0, (LPARAM)plvi); if (br) { TCHAR szText[MAX_PATH]; ReadProcessMemory(hProc, pbuf, szText, MAX_PATH, NULL); if (IsImgFile(szText)) { g.vsFileName.push_back(szText); if (wcscmp(szText, pszFileName) == 0) { g.idxCurr = idx; } idx++; } } } VirtualFreeEx(hProc, plvi, 0, MEM_RELEASE); VirtualFreeEx(hProc, pbuf, 0, MEM_RELEASE); CloseHandle(hProc); return TRUE; } //------------------------------------------------------------------------------ BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam) { TCHAR szBuf[256]; int nr = GetClassName(hWnd, szBuf, _countof(szBuf)); if (wcscmp(szBuf, WC_LISTVIEW) == 0) {// L"SysListView32" g.hListView = hWnd; return FALSE;// 打ち切り } BOOL br = EnumChildWindows(hWnd, EnumWindowsProc, lParam); return TRUE;// 続行 } //------------------------------------------------------------------------------ BOOL IsImgFile(LPCTSTR pszPath) { static LPCTSTR ext[] = {L".jpg", L".jpeg", L".gif", L".png"}; TCHAR szExt[_MAX_EXT]; _wsplitpath_s(pszPath, NULL, 0, NULL, 0, NULL, 0, szExt, _MAX_EXT); for (int n = 0; n _countof(ext); n++) { if (_wcsicmp(ext[n], szExt) == 0) { return TRUE; } } return FALSE; } //============================================================================== LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_PAINT OnPaint(hWnd); return 0; case WM_COMMAND if (OnCommand(hWnd, wParam)) { return 0; } break; case WM_DROPFILES OnDropFiles(hWnd, wParam); DragFinish((HDROP)wParam); return 0; case WM_CREATE CoInitialize(NULL); CoCreateInstance(CLSID_ShellImageDataFactory, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS( g.pImgDatFac)); GetImage(hWnd); return 0; case WM_DESTROY SAFE_RELEASE(g.pImgDat); SAFE_RELEASE(g.pImgDatFac); CoUninitialize(); PostQuitMessage(0); return 0; } return DefWindowProc(hWnd, uMsg, wParam, lParam); } //------------------------------------------------------------------------------ BOOL OnCommand(HWND hWnd, WPARAM wParam) { switch (LOWORD(wParam)) { case ID_RIGHT case ID_DOWN g.idxCurr++; if (g.vsFileName.size() = g.idxCurr) { g.idxCurr = 0; } break; case ID_LEFT case ID_UP if (g.idxCurr = 0) { g.idxCurr = g.vsFileName.size(); } g.idxCurr--; break; case ID_ENTER ShowWindow(hWnd, IsZoomed(hWnd) ? SW_SHOWNOACTIVATE SW_MAXIMIZE); break; case ID_SIZE_NORMAL OnSizeNormal(hWnd); // あえてスルー case ID_SIZE_ADJUST OnSizeAdjust(hWnd); break; case ID_EXECUTE OnExecute(); break; case ID_DELETE OnDelete(hWnd); break; case ID_ESCAPE DestroyWindow(hWnd); return TRUE; default return FALSE; } GetImage(hWnd); InvalidateRect(hWnd, NULL, FALSE);// ちらつき防止のため背景消去しない return TRUE; } //------------------------------------------------------------------------------ void OnDelete(HWND hWnd) { if (g.vsFileName.empty()) return; TCHAR szPath[MAX_PATH];// \0 2つで終わる要あり swprintf_s(szPath, L"%s%s%c", g.szBaseDir, g.vsFileName[g.idxCurr].c_str(), L \0 ); SHFILEOPSTRUCT fo; ZeroMemory( fo, sizeof fo); fo.hwnd= hWnd; fo.wFunc= FO_DELETE; fo.pFrom= szPath; fo.fFlags= FOF_ALLOWUNDO; SHFileOperation( fo); } //------------------------------------------------------------------------------ void OnDropFiles(HWND hWnd, WPARAM wParam) { HDROPhDrop; TCHARszPath[MAX_PATH]; hDrop = (HDROP)wParam; DragQueryFile(hDrop, 0, szPath, _countof(szPath)); CreateFileList(szPath); GetImage(hWnd); InvalidateRect(hWnd, NULL, FALSE);// ちらつき防止のため背景消去しない } //------------------------------------------------------------------------------ void OnSizeNormal(HWND hWnd) { if (g.pImgDat == NULL) return; g.sizeDst = g.sizeImg; RECT rcWorkArea;// タスクバーを除くデスクトップ領域 RECT rcWnd;// ウィンドウ領域 RECT rcClt;// クライアント領域 SIZE size;// ウィンドウ領域とクライアント領域の差分 SystemParametersInfo(SPI_GETWORKAREA, 0, rcWorkArea, 0); GetWindowRect(hWnd, rcWnd); GetClientRect(hWnd, rcClt); size.cx = WIDTH(rcWnd) - WIDTH(rcClt); size.cy = HEIGHT(rcWnd) - HEIGHT(rcClt); // デスクトップ領域からはみ出す場合、ウィンドウを左上方向に移動する if (rcWorkArea.right rcWnd.left + g.sizeDst.cx + size.cx) { rcWnd.left = 0; } if (rcWorkArea.bottom rcWnd.top + g.sizeDst.cy + size.cy) { rcWnd.top = 0; } // 最大クライアント領域に収める if (rcWorkArea.right - size.cx g.sizeDst.cx) { g.sizeDst.cx = rcWorkArea.right - size.cx; } if (rcWorkArea.bottom - size.cy g.sizeDst.cy) { g.sizeDst.cy = rcWorkArea.bottom - size.cy; } // アスペクト比の調整 if (g.sizeImg.cx g.sizeImg.cy * g.sizeDst.cx / g.sizeDst.cy) { g.sizeDst.cx = g.sizeDst.cy * g.sizeImg.cx / g.sizeImg.cy; } else { g.sizeDst.cy = g.sizeDst.cx * g.sizeImg.cy / g.sizeImg.cx; } // ウィンドウ位置のセット rcWnd.right = g.sizeDst.cx + size.cx; rcWnd.bottom = g.sizeDst.cy + size.cy; SetWindowPos(hWnd, NULL, rcWnd.left, rcWnd.top, rcWnd.right, rcWnd.bottom, SWP_NOZORDER); } //------------------------------------------------------------------------------ void OnSizeAdjust(HWND hWnd) { if (g.pImgDat == NULL) return; RECT rc; SetRect( rc, 0, 0, g.sizeDst.cx, g.sizeDst.cy); AdjustWindowRectEx( rc, WS_OVERLAPPEDWINDOW, FALSE, 0); SetWindowPos(hWnd, NULL, 0, 0, WIDTH(rc), HEIGHT(rc), SWP_NOZORDER | SWP_NOMOVE); } //------------------------------------------------------------------------------ void OnExecute(void) { if (g.vsFileName.empty()) return; TCHAR szFile[MAX_PATH]; TCHAR szParams[MAX_PATH]; GetModuleFileName(NULL, szFile, MAX_PATH); swprintf_s(szParams, L"\"%s%s\"", g.szBaseDir, g.vsFileName[g.idxCurr].c_str()); SHELLEXECUTEINFO ei; ZeroMemory( ei, sizeof ei); ei.cbSize= sizeof ei; ei.nShow= SW_SHOWNORMAL; ei.fMask= SEE_MASK_NOCLOSEPROCESS; ei.lpFile= szFile; ei.lpParameters= szParams; ShellExecuteEx( ei); } //------------------------------------------------------------------------------ void OnPaint(HWND hWnd) { PAINTSTRUCT ps; HDC hdc = BeginPaint(hWnd, ps); if (g.pImgDat == NULL) goto Exit; RECT rcClt; GetClientRect(hWnd, rcClt); // 画像とクライアント領域のアスペクト比を比較し // アスペクト比を維持したままクライアント領域に収める if (g.sizeImg.cx g.sizeImg.cy * rcClt.right / rcClt.bottom) { g.sizeDst.cx = rcClt.bottom * g.sizeImg.cx / g.sizeImg.cy; g.sizeDst.cy = rcClt.bottom; } else { g.sizeDst.cx = rcClt.right; g.sizeDst.cy = rcClt.right * g.sizeImg.cy / g.sizeImg.cx; } RECT rcDst; rcDst.left= (rcClt.right - g.sizeDst.cx) / 2; rcDst.top= (rcClt.bottom - g.sizeDst.cy) / 2; rcDst.right= rcDst.left + g.sizeDst.cx; rcDst.bottom= rcDst.top + g.sizeDst.cy; // 画像描画 RECT rcTmp; SetRect( rcTmp, 0, 0, g.sizeImg.cx, g.sizeImg.cy); g.pImgDat- Draw(hdc, rcDst, rcTmp); // 余白塗り潰し HBRUSH hbr = (HBRUSH)(COLOR_WINDOW + 1); if (rcClt.left rcDst.left) { CopyRect( rcTmp, rcClt); rcTmp.right = rcDst.left; FillRect(hdc, rcTmp, hbr); } if (rcClt.top rcDst.top) { CopyRect( rcTmp, rcClt); rcTmp.bottom = rcDst.top; FillRect(hdc, rcTmp, hbr); } if (rcDst.right rcClt.right) { CopyRect( rcTmp, rcClt); rcTmp.left = rcDst.right; FillRect(hdc, rcTmp, hbr); } if (rcDst.bottom rcClt.bottom) { CopyRect( rcTmp, rcClt); rcTmp.top = rcDst.bottom; FillRect(hdc, rcTmp, hbr); } Exit EndPaint(hWnd, ps); } //------------------------------------------------------------------------------ void GetImage(HWND hWnd) { SAFE_RELEASE(g.pImgDat); if (g.vsFileName.empty()) { SetWindowText(hWnd, APP_NAME); return; } // 画像ファイルの読み込み TCHAR szBuf[512]; LPCTSTR pszFileName = g.vsFileName[g.idxCurr].c_str(); swprintf_s(szBuf, L"%s%s", g.szBaseDir, pszFileName); HRESULT hr = g.pImgDatFac- CreateImageFromFile(szBuf, g.pImgDat); if (SUCCEEDED(hr)) { hr = g.pImgDat- Decode(SHIMGDEC_DEFAULT, 0, 0); } if (SUCCEEDED(hr)) { hr = g.pImgDat- GetSize( g.sizeImg); } if (FAILED(hr) || g.sizeImg.cx = 0 || g.sizeImg.cy = 0) { SAFE_RELEASE(g.pImgDat); g.sizeImg.cx = g.sizeImg.cy = 0; } // ファイル更新日時の取得 SYSTEMTIME st; MyGetFileTime( st, szBuf); // タイトルバー swprintf_s(szBuf, L"%s [%d/%d] %d/%02d/%02d %02d %02d %02d (%dx%d) - %s", pszFileName, g.idxCurr + 1, g.vsFileName.size(), st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, g.sizeImg.cx, g.sizeImg.cy, APP_NAME); SetWindowText(hWnd, szBuf); } //------------------------------------------------------------------------------ BOOL MyGetFileTime(LPSYSTEMTIME pSystemTime, LPCTSTR pszFileName) { HANDLE hFile = CreateFile(pszFileName, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { return FALSE; } FILETIME ftCreation; FILETIME ftLocal; GetFileTime(hFile, ftCreation, NULL, NULL); FileTimeToLocalFileTime( ftCreation, ftLocal); FileTimeToSystemTime( ftLocal, pSystemTime); CloseHandle(hFile); return TRUE; } resource.h #define ID_SIZE_ADJUST100 #define ID_SIZE_NORMAL101 #define ID_EXECUTE102 #define IDR_MAIN128 #define ID_ENTER129 #define ID_ESCAPE130 #define ID_LEFT131 #define ID_UP132 #define ID_RIGHT133 #define ID_DOWN134 #define ID_DELETE135 ImgView2.rc // resource script #include windows.h #include "resource.h" // アクセラレータ IDR_MAIN ACCELERATORS BEGIN VK_RETURN,ID_ENTER,VIRTKEY// 0x0D VK_ESCAPE,ID_ESCAPE,VIRTKEY// 0x1B VK_LEFT,ID_LEFT,VIRTKEY// 0x25 VK_UP,ID_UP,VIRTKEY// 0x26 VK_RIGHT,ID_RIGHT,VIRTKEY// 0x27 VK_DOWN,ID_DOWN,VIRTKEY// 0x28 VK_DELETE,ID_DELETE,VIRTKEY// 0x2E "1",ID_SIZE_ADJUST,VIRTKEY// 0x31 VK_NUMPAD1,ID_SIZE_ADJUST,VIRTKEY// 0x61 "2",ID_SIZE_NORMAL,VIRTKEY// 0x32 VK_NUMPAD2,ID_SIZE_NORMAL,VIRTKEY// 0x62 "3",ID_EXECUTE,VIRTKEY// 0x33 VK_NUMPAD3,ID_EXECUTE,VIRTKEY// 0x63 END
https://w.atwiki.jp/sampleisbest/pages/304.html
開発環境 Microsoft Visual C++ 2013 実行環境 Microsoft Windows 8.1 (64bit) プロジェクトの種類 Win32 プロジェクト プロジェクト名 ImgView3 アプリケーションの種類 Windows アプリケーション 追加のオプション 空のプロジェクト, SDLチェック エクスプローラーの並び順の取得は別途研究 ImgView3.cpp #include Windows.h #include CommCtrl.h #include shimgdata.h #include stdio.h #include map #include string #include vector #include "resource.h" using namespace std; #define WIDTH(rect) ((rect).right - (rect).left) #define HEIGHT(rect) ((rect).bottom - (rect).top) #define SAFE_RELEASE(p) { if(p) { (p)- Release(); (p)=NULL; } } #define APP_NAME TEXT("ImgView3") typedef vector wstring VecStr; typedef multimap ULONGLONG, wstring MapStr; // 関数プロトタイプ宣言 void CreateFileList(LPCTSTR pszPath); BOOL IsImgFile(LPCTSTR pszPath); LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); BOOL OnCommand(HWND hWnd, WPARAM wParam); void OnDelete(HWND hWnd); void OnDropFiles(HWND hWnd, WPARAM wParam); void OnSizeNormal(HWND hWnd); void OnSizeAdjust(HWND hWnd); void OnExecute(void); void OnPaint(HWND hWnd); void GetImage(HWND hWnd); BOOL MyGetFileTime(LPSYSTEMTIME pSystemTime, LPCTSTR pszFileName); // 外部変数構造体 static struct { TCHAR szBaseDir[MAX_PATH];// 基準ディレクトリ VecStr vsFileName;// ファイル名配列 VecStr size_type idxCurr;// 現在の位置 IShellImageDataFactory *pImgDatFac;// 画像データファクトリ IShellImageData *pImgDat;// 画像データ SIZE sizeImg;// 画像サイズ SIZE sizeDst;// 出力サイズ HWND hListView;// エクスプローラのリストビュー } g; //============================================================================== int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow) { // プログラム引数 LPTSTR pszCmdLine = GetCommandLine(); int argc; LPTSTR *argv = CommandLineToArgvW(pszCmdLine, argc); if (2 = argc) { CreateFileList(argv[1]); } // ウィンドウクラスの登録 WNDCLASSEX wcx; ZeroMemory( wcx, sizeof wcx); wcx.cbSize = sizeof wcx; wcx.style = CS_HREDRAW | CS_VREDRAW; wcx.lpfnWndProc = WndProc; wcx.hInstance = hInstance; wcx.hCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW)); wcx.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wcx.lpszClassName = APP_NAME; if (RegisterClassEx( wcx) == 0) { return 0; } // ウィンドウの作成 HWND hWnd = CreateWindowEx( WS_EX_ACCEPTFILES, APP_NAME, APP_NAME, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL); if (hWnd == NULL) { return 0; } ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); // メッセージループ MSG msg; HACCEL hAccTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDR_MAIN)); while (GetMessage( msg, NULL, 0, 0)) { if (TranslateAccelerator(msg.hwnd, hAccTable, msg) == 0) { TranslateMessage( msg); DispatchMessage( msg); } } return msg.wParam; } //------------------------------------------------------------------------------ void CreateFileList(LPCTSTR pszPath) { TCHAR szDrive[_MAX_DRIVE]; TCHAR szDir[_MAX_DIR]; TCHAR szFName[_MAX_FNAME]; TCHAR szExt[_MAX_EXT]; TCHAR szFileName[_MAX_PATH]; TCHAR szPath[_MAX_PATH]; g.vsFileName.clear(); g.idxCurr = -1; errno_t er = _wsplitpath_s(pszPath, szDrive, szDir, szFName, szExt); swprintf_s(g.szBaseDir, L"%s%s", szDrive, szDir); swprintf_s(szFileName, L"%s%s", szFName, szExt); swprintf_s(szPath, L"%s*.*", g.szBaseDir); // ファイル一覧を取得し更新日時の昇順でソート WIN32_FIND_DATA wfd; HANDLE hFindFile = FindFirstFile(szPath, wfd); DWORD dwMask = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_HIDDEN; MapStr list; do { if (wfd.dwFileAttributes dwMask) { continue; } FILETIME ft = wfd.ftLastWriteTime; ULONGLONG qw = (ULONGLONG(ft.dwHighDateTime) 32) + ft.dwLowDateTime; list.insert(make_pair(qw, wfd.cFileName)); } while (FindNextFile(hFindFile, wfd)); FindClose(hFindFile); // 配列に転記 VecStr size_type idx = 0; for (MapStr iterator it = list.begin(); it != list.end(); it++) { g.vsFileName.push_back(it- second); if (wcscmp(it- second.c_str(), szFileName) == 0) { g.idxCurr = idx; } idx++; } } //------------------------------------------------------------------------------ BOOL IsImgFile(LPCTSTR pszPath) { static LPCTSTR ext[] = { L".jpg", L".jpeg", L".gif", L".png" }; TCHAR szExt[_MAX_EXT]; _wsplitpath_s(pszPath, NULL, 0, NULL, 0, NULL, 0, szExt, _MAX_EXT); for (int n = 0; n _countof(ext); n++) { if (_wcsicmp(ext[n], szExt) == 0) { return TRUE; } } return FALSE; } //============================================================================== LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_PAINT OnPaint(hWnd); return 0; case WM_COMMAND if (OnCommand(hWnd, wParam)) { return 0; } break; case WM_DROPFILES OnDropFiles(hWnd, wParam); DragFinish((HDROP)wParam); return 0; case WM_CREATE CoInitialize(NULL); CoCreateInstance(CLSID_ShellImageDataFactory, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS( g.pImgDatFac)); GetImage(hWnd); return 0; case WM_DESTROY SAFE_RELEASE(g.pImgDat); SAFE_RELEASE(g.pImgDatFac); CoUninitialize(); PostQuitMessage(0); return 0; } return DefWindowProc(hWnd, uMsg, wParam, lParam); } //------------------------------------------------------------------------------ BOOL OnCommand(HWND hWnd, WPARAM wParam) { switch (LOWORD(wParam)) { case ID_RIGHT case ID_DOWN g.idxCurr++; if (g.vsFileName.size() = g.idxCurr) { g.idxCurr = 0; } break; case ID_LEFT case ID_UP if (g.idxCurr = 0) { g.idxCurr = g.vsFileName.size(); } g.idxCurr--; break; case ID_ENTER ShowWindow(hWnd, IsZoomed(hWnd) ? SW_SHOWNOACTIVATE SW_MAXIMIZE); break; case ID_SIZE_NORMAL OnSizeNormal(hWnd); // あえてスルー case ID_SIZE_ADJUST OnSizeAdjust(hWnd); break; case ID_EXECUTE OnExecute(); break; case ID_DELETE OnDelete(hWnd); break; case ID_ESCAPE DestroyWindow(hWnd); return TRUE; default return FALSE; } GetImage(hWnd); InvalidateRect(hWnd, NULL, FALSE);// ちらつき防止のため背景消去しない return TRUE; } //------------------------------------------------------------------------------ void OnDelete(HWND hWnd) { if (g.vsFileName.empty()) return; TCHAR szPath[MAX_PATH];// \0 2つで終わる要あり swprintf_s(szPath, L"%s%s%c", g.szBaseDir, g.vsFileName[g.idxCurr].c_str(), L \0 ); SHFILEOPSTRUCT fo; ZeroMemory( fo, sizeof fo); fo.hwnd = hWnd; fo.wFunc = FO_DELETE; fo.pFrom = szPath; fo.fFlags = FOF_ALLOWUNDO; SHFileOperation( fo); } //------------------------------------------------------------------------------ void OnDropFiles(HWND hWnd, WPARAM wParam) { HDROPhDrop; TCHARszPath[MAX_PATH]; hDrop = (HDROP)wParam; DragQueryFile(hDrop, 0, szPath, _countof(szPath)); CreateFileList(szPath); GetImage(hWnd); InvalidateRect(hWnd, NULL, FALSE);// ちらつき防止のため背景消去しない } //------------------------------------------------------------------------------ void OnSizeNormal(HWND hWnd) { if (g.pImgDat == NULL) return; g.sizeDst = g.sizeImg; RECT rcWorkArea;// タスクバーを除くデスクトップ領域 RECT rcWnd;// ウィンドウ領域 RECT rcClt;// クライアント領域 SIZE size;// ウィンドウ領域とクライアント領域の差分 SystemParametersInfo(SPI_GETWORKAREA, 0, rcWorkArea, 0); GetWindowRect(hWnd, rcWnd); GetClientRect(hWnd, rcClt); size.cx = WIDTH(rcWnd) - WIDTH(rcClt); size.cy = HEIGHT(rcWnd) - HEIGHT(rcClt); // デスクトップ領域からはみ出す場合、ウィンドウを左上方向に移動する if (rcWorkArea.right rcWnd.left + g.sizeDst.cx + size.cx) { rcWnd.left = 0; } if (rcWorkArea.bottom rcWnd.top + g.sizeDst.cy + size.cy) { rcWnd.top = 0; } // 最大クライアント領域に収める if (rcWorkArea.right - size.cx g.sizeDst.cx) { g.sizeDst.cx = rcWorkArea.right - size.cx; } if (rcWorkArea.bottom - size.cy g.sizeDst.cy) { g.sizeDst.cy = rcWorkArea.bottom - size.cy; } // アスペクト比の調整 if (g.sizeImg.cx g.sizeImg.cy * g.sizeDst.cx / g.sizeDst.cy) { g.sizeDst.cx = g.sizeDst.cy * g.sizeImg.cx / g.sizeImg.cy; } else { g.sizeDst.cy = g.sizeDst.cx * g.sizeImg.cy / g.sizeImg.cx; } // ウィンドウ位置のセット rcWnd.right = g.sizeDst.cx + size.cx; rcWnd.bottom = g.sizeDst.cy + size.cy; SetWindowPos(hWnd, NULL, rcWnd.left, rcWnd.top, rcWnd.right, rcWnd.bottom, SWP_NOZORDER); } //------------------------------------------------------------------------------ void OnSizeAdjust(HWND hWnd) { if (g.pImgDat == NULL) return; RECT rc; SetRect( rc, 0, 0, g.sizeDst.cx, g.sizeDst.cy); AdjustWindowRectEx( rc, WS_OVERLAPPEDWINDOW, FALSE, 0); SetWindowPos(hWnd, NULL, 0, 0, WIDTH(rc), HEIGHT(rc), SWP_NOZORDER | SWP_NOMOVE); } //------------------------------------------------------------------------------ void OnExecute(void) { if (g.vsFileName.empty()) return; TCHAR szFile[MAX_PATH]; TCHAR szParams[MAX_PATH]; GetModuleFileName(NULL, szFile, MAX_PATH); swprintf_s(szParams, L"\"%s%s\"", g.szBaseDir, g.vsFileName[g.idxCurr].c_str()); SHELLEXECUTEINFO ei; ZeroMemory( ei, sizeof ei); ei.cbSize = sizeof ei; ei.nShow = SW_SHOWNORMAL; ei.fMask = SEE_MASK_NOCLOSEPROCESS; ei.lpFile = szFile; ei.lpParameters = szParams; ShellExecuteEx( ei); } //------------------------------------------------------------------------------ void OnPaint(HWND hWnd) { PAINTSTRUCT ps; HDC hdc = BeginPaint(hWnd, ps); if (g.pImgDat == NULL) goto Exit; RECT rcClt; GetClientRect(hWnd, rcClt); // 画像とクライアント領域のアスペクト比を比較し // アスペクト比を維持したままクライアント領域に収める if (g.sizeImg.cx g.sizeImg.cy * rcClt.right / rcClt.bottom) { g.sizeDst.cx = rcClt.bottom * g.sizeImg.cx / g.sizeImg.cy; g.sizeDst.cy = rcClt.bottom; } else { g.sizeDst.cx = rcClt.right; g.sizeDst.cy = rcClt.right * g.sizeImg.cy / g.sizeImg.cx; } RECT rcDst; rcDst.left = (rcClt.right - g.sizeDst.cx) / 2; rcDst.top = (rcClt.bottom - g.sizeDst.cy) / 2; rcDst.right = rcDst.left + g.sizeDst.cx; rcDst.bottom = rcDst.top + g.sizeDst.cy; // 画像描画 RECT rcTmp; SetRect( rcTmp, 0, 0, g.sizeImg.cx, g.sizeImg.cy); g.pImgDat- Draw(hdc, rcDst, rcTmp); // 余白塗り潰し HBRUSH hbr = (HBRUSH)(COLOR_WINDOW + 1); if (rcClt.left rcDst.left) { CopyRect( rcTmp, rcClt); rcTmp.right = rcDst.left; FillRect(hdc, rcTmp, hbr); } if (rcClt.top rcDst.top) { CopyRect( rcTmp, rcClt); rcTmp.bottom = rcDst.top; FillRect(hdc, rcTmp, hbr); } if (rcDst.right rcClt.right) { CopyRect( rcTmp, rcClt); rcTmp.left = rcDst.right; FillRect(hdc, rcTmp, hbr); } if (rcDst.bottom rcClt.bottom) { CopyRect( rcTmp, rcClt); rcTmp.top = rcDst.bottom; FillRect(hdc, rcTmp, hbr); } Exit EndPaint(hWnd, ps); } //------------------------------------------------------------------------------ void GetImage(HWND hWnd) { SAFE_RELEASE(g.pImgDat); if (g.vsFileName.empty()) { SetWindowText(hWnd, APP_NAME); return; } // 画像ファイルの読み込み TCHAR szBuf[512]; LPCTSTR pszFileName = g.vsFileName[g.idxCurr].c_str(); swprintf_s(szBuf, L"%s%s", g.szBaseDir, pszFileName); HRESULT hr = g.pImgDatFac- CreateImageFromFile(szBuf, g.pImgDat); if (SUCCEEDED(hr)) { hr = g.pImgDat- Decode(SHIMGDEC_DEFAULT, 0, 0); } if (SUCCEEDED(hr)) { hr = g.pImgDat- GetSize( g.sizeImg); } if (FAILED(hr) || g.sizeImg.cx = 0 || g.sizeImg.cy = 0) { SAFE_RELEASE(g.pImgDat); g.sizeImg.cx = g.sizeImg.cy = 0; } // ファイル更新日時の取得 SYSTEMTIME st; MyGetFileTime( st, szBuf); // タイトルバー swprintf_s(szBuf, L"%s [%d/%d] %d/%02d/%02d %02d %02d %02d (%dx%d) - %s", pszFileName, g.idxCurr + 1, g.vsFileName.size(), st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, g.sizeImg.cx, g.sizeImg.cy, APP_NAME); SetWindowText(hWnd, szBuf); } //------------------------------------------------------------------------------ BOOL MyGetFileTime(LPSYSTEMTIME pSystemTime, LPCTSTR pszFileName) { HANDLE hFile = CreateFile(pszFileName, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { return FALSE; } FILETIME ftLastWrite; FILETIME ftLocal; GetFileTime(hFile, NULL, NULL, ftLastWrite); FileTimeToLocalFileTime( ftLastWrite, ftLocal); FileTimeToSystemTime( ftLocal, pSystemTime); CloseHandle(hFile); return TRUE; } resource.h #define ID_SIZE_ADJUST100 #define ID_SIZE_NORMAL101 #define ID_EXECUTE102 #define IDR_MAIN128 #define ID_ENTER129 #define ID_ESCAPE130 #define ID_LEFT131 #define ID_UP132 #define ID_RIGHT133 #define ID_DOWN134 #define ID_DELETE135 ImgView3.rc // resource script #include windows.h #include "resource.h" // アクセラレータ IDR_MAIN ACCELERATORS BEGIN VK_RETURN,ID_ENTER,VIRTKEY// 0x0D VK_ESCAPE,ID_ESCAPE,VIRTKEY// 0x1B VK_LEFT,ID_LEFT,VIRTKEY// 0x25 VK_UP,ID_UP,VIRTKEY// 0x26 VK_RIGHT,ID_RIGHT,VIRTKEY// 0x27 VK_DOWN,ID_DOWN,VIRTKEY// 0x28 VK_DELETE,ID_DELETE,VIRTKEY// 0x2E "1",ID_SIZE_ADJUST,VIRTKEY// 0x31 VK_NUMPAD1,ID_SIZE_ADJUST,VIRTKEY// 0x61 "2",ID_SIZE_NORMAL,VIRTKEY// 0x32 VK_NUMPAD2,ID_SIZE_NORMAL,VIRTKEY// 0x62 "3",ID_EXECUTE,VIRTKEY// 0x33 VK_NUMPAD3,ID_EXECUTE,VIRTKEY// 0x63 END
https://w.atwiki.jp/storytellermirror/pages/332.html
SIMPLE2000シリーズ Vol.31 THE 地球防衛軍 part19-187 187 名無しさん@お腹いっぱい。 sage 2005/11/07(月)18 23 30ID eupQXyfN ついでに地球防衛軍と地球防衛軍IIも書いたんで置いておく。 EDFとは「The EarthDefenseForce」すなわち連合地球軍の略称である。 世界全土の平和維持活動を目的として、国家の枠組みをこえて組織された超法規軍。それがEDFである。 主人公は、EDFの隊員の一人だ。基本的には命令に従い、各地で戦うことになる。 しかし、彼(彼女)が他の隊員と決定的に違う点。それは・・・ THE地球防衛軍 2017年、世界は蟻の酸に包まれた・・・ 突如現れたエイリアン。奴らが使う生物兵器、甲殻虫は蟻にそっくりだった。 壊滅的な被害を受ける世界。減り行く人類。 EDF極東支部でも、苦しい戦いが展開されていた。 しかし、他の地域と違う点がたった一つ。 この地域には「人類最強の戦士」が居たのだ・・・ 並み居る蟻やUFOを叩き潰す人類最強の戦士こと主人公。 仲間を酸だぁぁー!で失いながらも、たった一人(か二人)で孤独な戦いを続けていく。 黒蟻に赤蟻、巨大UFO、果ては40mはあろうかという巨大生物・・・それらを次々と屠っていく。 遂に敵軍の母船が日本に乗り込んできたが、主人公はこれをも撃墜する。 母船を失ったことで、エイリアンどもは撤退を開始。 たった一人の男が、戦況を覆した。
https://w.atwiki.jp/childreninfksm_en/pages/68.html
Neskomu Inawashiro Nesukomu Inawashiro provide the bargain-basement information of the condominiums, single-family houses, land and other real estate for sale and rent of the town and villag in Urabandai, Bandai-highland, Aizu-highland, called like Inawashiro-city, Kitashiobara-village, Bandai-city, Kato-city information.http //nescom.inawasiro.com/ Iiheya-Net http //www.eheya.net/fukushima/aizu/7408/ Asera,Co.Ltd This is the intermediate site of the real estate in Inawashiro/Bandai-highland in Fukushima. http //www.asera.co.jp/ Stack,Co.Ltd We have managed and operated "land flat villa Rhododendron" for over 30 years in Inawashiro and Bandai-hightland, Fukushima. http //www.inakanet.jp/ptn/stack.html
https://w.atwiki.jp/iwannabethewiki/pages/4140.html
製作者 Fapost DL先↓ http //www.mediafire.com/download/vuwb1kv4wjrw1d0/I_wanna_trial_the_simple_needle_v1.1.zip
https://w.atwiki.jp/hellgate_london/pages/615.html
Sword Unique Template [部分編集] blankimgプラグインエラー:画像URLまたは画像ファイル名を指定してください。 Category Unique Item Class Templar Type Sword Item Level Require Level Damage Type Speed Shield Overload Interrupt Strength Critical Chance Critical Damage Range Phase Attack Strength Equip Cost Modification Inherent Attributes Shield Overload Special Attributes ※上記に画像がないときはアイテム名.jpgでアップロードしてください。 [部分編集] Special Attributes 固定 Affix名 効果 [部分編集] ・追加画像 関連ページ Template
https://w.atwiki.jp/shintarot/pages/9.html
There was a long wash stand just before the athletic ground. It, seen from above, looks like a house centipede that has many symmetrical faucets instead of legs. At about six or seven, the members of soccer club often went there to wash their legs. He put the scuffs on the back of the house centipede, turned a faucet upwards to drink water. Then, when the gymnasium came into view, it struck him that he had left the scuffs on the back of house centipede. He was to go back toward the house centipede when a scuff floated up straight. The heel drew a circle around the tiptoe. The report of a machine gun continued while the scuff was rotating, then ceased. The scuff fell feebly. The sea shaking shone in broad daylight. The warmth of the sands covered Hikari s whole body. What’s your name? The cheerful man of a stand smiled at the girl, handing her an ice cream. The girl looked up at him with her vague face while a voice came from the side, He asks your name. Just respond, My name is… . Encouraged by her mother, the girl responded to him, My name is Kazuko. Oh, Kazuo. The man with his larger smile replaced a boy s name with her name. Looking at T-shirt and shorts she was putting on, he mistook her for a boy probably. The smiling face of the girl proved that she was satisfied for some reason. Hikari wished to feel nostalgic for the days of her girlhood. However, she had no memory. A hook-shaped wooden pier emerged. It broadened at its corner. The satellite photograph of the murder scene on Google Earth shocked millions of people who felt an urge to inspect it. The man has been felled. Blood has spread beside him. The other seemed to look down at the man and to stand aghast. Local police expressed its view in great tumult, It s not a murder. It s a dog. It became clear that the shadow in the satellite photograph who seemed to be looking down at the man was a dog nuzzling up against its owner. A golden retriever which enjoyed swimming for a while jumped at owner on the pier. The dog shook body to remove water. Surprised at too much water splash, owner fell down to the ground. Water caused blackish browning of the floor slabs. It made people mistake it for blood. It was the circumstances. She was wondering what was the matter. Although the light brown building on a hill came in sight, the way to it was not easily found. She should not be late for appointment that is to be made once a month. She ran up the slope overgrown with short grass. PREV / NEXT Waterfall 1 / 2 / 3 / 4 / 5 / 6 / 7 / 8 / 9
https://w.atwiki.jp/unity3dfan/pages/23.html
Animated Sprite ▶Spirte ▶押すとデフォルトスプライトのインスペクターが表示される。ディスプレイに表示されるデフォルトスプライトをこれでかえられる。 AnimLib – アニメーションライブラリの選択 Clip – どのクリップを使うか選択。 Play automatically – アニメーションを自動再生する Create collider - チェックすると自動でボックスコリジョンをつける. 例)コリジョンが必要ないアニメからスタートして、「攻撃」などのコリジョンが必要なアニメにだけコリジョンをつける・・・といった切り替えが自動でされるわけではありません。 ?ちょっと意味がよくわからない Create collider - Ticking this will automatically create and animate a box collider. You should tick this if any of the animation clips you play for this sprite will need a collider. For example, if you start at a default idle animation which doesn t need colliders, and you could potentially play an attack animation which needs a collider, you should tick this here so no dynamic allocations will be performed.