JunkBox_Win_Lib 1.5.3
Loading...
Searching...
No Matches
WinTools.cpp
Go to the documentation of this file.
1
6//
7#include "..\stdafx.h"
8
9#include "WinTools.h"
10
11
12using namespace jbxl;
13using namespace jbxwl;
14
15
17// Uicode
18
20// 変換
21// locale が正しくないと,日本語の変換は失敗する.
22//
23
24Buffer jbxwl::String2Buffer(CString str)
25{
26 Buffer buf = make_Buffer(CStringA(str).GetLength());
27
28 copy_b2Buffer(CStringA(str).GetBuffer(), &buf, CStringA(str).GetLength());
29 return buf;
30}
31
32
33
34Buffer jbxwl::tc2Buffer(TCHAR* tchar, int size)
35{
36 if (size<0) size = LDATA;
37 Buffer buf = make_Buffer(size);
38
39#ifdef _UNICODE
40 //setlocale(LC_ALL, ".UTF8");
41
42 size_t len;
43 int err = wcstombs_s(&len, (char*)buf.buf, buf.bufsz, tchar, _TRUNCATE);
44
45 if (err!=0) clear_Buffer(&buf);
46 else buf.vldsz = (int)Min(len-1, strlen((char*)buf.buf));
47 buf.state = err;
48#else
49 copy_s2Buffer(tchar, &buf);
50#endif
51
52 return buf;
53}
54
55
56Buffer jbxwl::ts2Buffer(LPCTSTR str, int size)
57{
58 if (size<0) size = (int)tcslen(str);
59
60#ifdef _UNICODE
61 //setlocale(LC_ALL, ".UTF8");
62
63 Buffer buf = make_Buffer((size+1)*4);
64 size_t len;
65
66 int err = wcstombs_s(&len, (char*)buf.buf, buf.bufsz, str, _TRUNCATE);
67 if (err!=0) clear_Buffer(&buf);
68 else buf.vldsz = (int)Min(len-1, strlen((char*)buf.buf));
69 buf.state = err;
70#else
71 Buffer buf = make_Buffer(size);
72 copy_b2Buffer((char*)str, &buf, size);
73#endif
74
75 return buf;
76}
77
78
79CString jbxwl::mbs2ts(char* str)
80{
81 CString buf = _T("");
82 if (str==NULL) return buf;
83
84#ifdef _UNICODE
85 //setlocale(LC_ALL, ".UTF8");
86 TCHAR tchar[SBUFSZ];
87 size_t len = 0;
88 size_t size = strlen(str);
89 int err = -1;
90
91 if (size + 1 > SBUFSZ) {
92 TCHAR tchar_recv[RECVBUFSZ];
93 if (size + 1 > RECVBUFSZ) {
94 size_t ptchar_sz = (size + 1) * sizeof(TCHAR);
95 TCHAR* ptchar = (TCHAR*)malloc(ptchar_sz);
96 err = mbstowcs_s(&len, ptchar, ptchar_sz, str, size);
97 if (err == 0) buf = ptchar;
98 ::free(ptchar);
99 }
100 else {
101 err = mbstowcs_s(&len, tchar_recv, RECVBUFSZ, str, size);
102 if (err == 0) buf = tchar_recv;
103 }
104 }
105 else {
106 err = mbstowcs_s(&len, tchar, SBUFSZ, str, size);
107 if (err == 0) buf = tchar;
108 }
109#else
110 buf = (LPTSTR)str;
111#endif
112
113 return buf;
114}
115
116
117//
118// 要 free. NULL は絶対に返ってこない
119//
120/*
121inline char* ts2mbs(LPCTSTR str)
122{
123 Buffer buf = ts2Buffer(str);
124 return (char*)buf.buf;
125}
126*/
127
128
136int jbxwl::copy_ts2Buffer(LPCTSTR str, Buffer* buf)
137{
138 if (buf==NULL) return -1;
139 int cc = 0;
140
141#ifdef _UNICODE
142 char* mbstr = ts2mbs(str);
143 copy_s2Buffer(mbstr, buf);
144 ::free(mbstr);
145 cc = buf->vldsz;
146#else
147 cc = copy_s2Buffer((char*)str, buf);
148#endif
149
150 return cc;
151}
152
153
161int jbxwl::cat_ts2Buffer(LPCTSTR str, Buffer* buf)
162{
163 if (buf==NULL) return -1;
164 int cc = 0;
165
166#ifdef _UNICODE
167 char* mbstr = ts2mbs(str);
168 cat_s2Buffer(mbstr, buf);
169 ::free(mbstr);
170 cc = buf->vldsz;
171#else
172 cc = cat_s2Buffer((char*)str, buf);
173#endif
174
175 return cc;
176}
177
178
179
180
182// UTF-8, s-Jis
183
184
185Buffer jbxwl::utf8_to_sjis_byStr(CString str)
186{
187 Buffer buf = init_Buffer();
188 if (str.IsEmpty()) return buf;
189
190 buf = utf8_to_sjis(CStringA(str).GetBuffer(), CStringA(str).GetLength());
191
192 return buf;
193}
194
195
196Buffer jbxwl::utf8_to_sjis(void* ptr, size_t len)
197{
198 // utf-8 -> unicode
199 int len_unic = MultiByteToWideChar(CP_UTF8, 0, (LPCCH)ptr, (int)len, NULL, 0);
200 wchar_t* buf_unic = new wchar_t[len_unic];
201 MultiByteToWideChar(CP_UTF8, 0, (LPCCH)ptr, (int)len + 1, buf_unic, len_unic);
202
203 // unicode -> sjis
204 int len_sjis = WideCharToMultiByte(CP_THREAD_ACP, 0, buf_unic, -1, NULL, 0, NULL, NULL);
205 Buffer buf_sjis = make_Buffer(len_sjis);
206 WideCharToMultiByte(CP_THREAD_ACP, 0, buf_unic, len_unic, (LPSTR)buf_sjis.buf, len_sjis, NULL, NULL);
207
208 delete buf_unic;
209
210 buf_sjis.vldsz = len_sjis;
211 return buf_sjis;
212}
213
214
215
216Buffer jbxwl::sjis_to_utf8_byStr(CString str)
217{
218 Buffer buf = init_Buffer();
219 if (str.IsEmpty()) return buf;
220
221 buf = sjis_to_utf8(CStringA(str).GetBuffer(), CStringA(str).GetLength());
222
223 return buf;
224}
225
226
227Buffer jbxwl::sjis_to_utf8(void* ptr, size_t len)
228{
229 // sjis -> unicode
230 int len_unic = MultiByteToWideChar(CP_THREAD_ACP, 0, (LPCCH)ptr, (int)len, NULL, 0);
231 wchar_t* buf_unic = new wchar_t[len_unic];
232 MultiByteToWideChar(CP_THREAD_ACP, 0, (LPCCH)ptr, (int)len + 1, buf_unic, len_unic);
233
234 // unicode -> utf-8
235 int len_utf8 = WideCharToMultiByte(CP_UTF8, 0, buf_unic, -1, NULL, 0, NULL, NULL);
236 Buffer buf_utf8 = make_Buffer(len_utf8);
237 WideCharToMultiByte(CP_UTF8, 0, buf_unic, len_unic, (LPSTR)buf_utf8.buf, len_utf8, NULL, NULL);
238
239 delete buf_unic;
240
241 buf_utf8.vldsz = len_utf8;
242 return buf_utf8;
243}
244
245
246
248// File
249
250unsigned long int jbxwl::file_size_t(LPCTSTR fn)
251{
252 struct _stat stbuf;
253 _tstat(fn, &stbuf);
254 return stbuf.st_size;
255}
256
257
258BOOL jbxwl::file_exist_t(LPCTSTR fn)
259{
260 BOOL ret = FALSE;
261 if (fn==NULL) return FALSE;
262
263#ifdef _UNICODE
264 FILE* fp = tfopen(fn, _T("rb"));
265 if (fp!=NULL) {
266 ret = TRUE;
267 fclose(fp);
268 }
269#else
270 ret = file_exist((char*)fn);
271#endif
272
273 return ret;
274}
275
276
277CString jbxwl::get_file_name_t(LPCTSTR str)
278{
279 CString buf = _T("");
280
281#ifdef _UNICODE
282 char* mbstr = ts2mbs(str);
283 char* fn = get_file_name(mbstr);
284 buf = mbs2ts(fn);
285 ::free(mbstr);
286#else
287 char* fn = get_file_name((char*)str);
288 buf = (LPTSTR)fn;
289#endif
290
291 return buf;
292}
293
294
295CString jbxwl::make_file_path_t(LPCTSTR str)
296{
297 CString buf = _T("");
298
299#ifdef _UNICODE
300 char* mbstr = ts2mbs(str);
301 //char* pn = make_file_path(mbstr);
302 char* pn = get_file_path(mbstr);
303 buf = mbs2ts(pn);
304 ::free(mbstr);
305 ::free(pn);
306#else
307 //char* pn = make_file_path((char*)str);
308 char* pn = get_file_path((char*)str);
309 buf = (LPTSTR)pn;
310 ::free(pn);
311#endif
312
313 return buf;
314}
315
316
317CString jbxwl::cut_file_extension_t(LPCTSTR str)
318{
319 CString buf = _T("");
320
321#ifdef _UNICODE
322 char* mbstr = ts2mbs(str);
323 char* pn = cut_file_extension(mbstr); // 要free
324 buf = mbs2ts(pn);
325 ::free(mbstr);
326 ::free(pn);
327#else
328 char* pn = cut_file_extension((char*)str);
329 buf = (LPTSTR)pn;
330 ::free(pn);
331#endif
332
333 return buf;
334}
335
336
337
338tList* jbxwl::get_dir_files_t(LPCTSTR dirn)
339{
340 tList* lp = NULL;
341 tList* ln = NULL;
342
343 WIN32_FIND_DATA FindFileData;
344 HANDLE hFind;
345 CString dirstr = dirn;
346
347 if (dirstr.Right(1)!="\\") dirstr += _T("\\*");
348 hFind = FindFirstFile((LPCTSTR)dirstr, &FindFileData);
349 if (hFind!=INVALID_HANDLE_VALUE) {
350 Buffer tmp;
351 do {
352 char* fn = ts2mbs(FindFileData.cFileName);
353 if (strcmp(".", fn) && strcmp("..", fn)) {
354 tmp = ts2Buffer(dirn);
355 if (tmp.buf[tmp.vldsz-1]!='\\') cat_s2Buffer("\\", &tmp);
356 cat_ts2Buffer(FindFileData.cFileName, &tmp);
357 ln = add_tList_node_str(ln, NULL, tmp.buf);
358 if (lp==NULL) lp = ln;
359 free_Buffer(&tmp);
360 }
361 ::free(fn);
362 } while (FindNextFile(hFind, &FindFileData));
363
364 FindClose(hFind);
365 }
366 return lp;
367}
368
369
370tList* jbxwl::get_dir_files_rcsv_t(LPCTSTR dirn)
371{
372 tList* lp = get_dir_files_t(dirn);
373 if (lp==NULL) return NULL;
374
375 tList* lt = dup_tList(lp);
376 while (lt!=NULL) {
377 tList* lc = get_dir_files_rcsv_t(mbs2ts((char*)lt->ldat.val.buf));
378 if (lc!=NULL) add_tList_end(lp, lc);
379 lt = lt->next;
380 }
381 del_tList(&lt);
382
383 return lp;
384}
385
386
387tList* jbxwl::read_index_tList_file_t(LPCTSTR fn, char cc)
388{
389 char* pathstr = NULL;
390 if (fn!=_T("")) pathstr = ts2mbs(fn);
391
392 tList* lt = read_index_tList_file(pathstr, cc);
393 freeNull(pathstr);
394
395 return lt;
396}
397
398
399
401// Tools
402
403CString jbxwl::numbering_name_t(LPCTSTR fmt, int n)
404{
405 TCHAR fname[LNAME];
406
407 sntprintf(fname, LNAME-1, fmt, n);
408 CString ret = fname;
409 return ret;
410}
411
412
413CString jbxwl::get_tstr_param_tList(tList* lt, char* key, LPCTSTR dflt)
414{
415 Buffer buf = buffer_key_tList(lt, key, 1);
416 if (buf.buf!=NULL) {
417 CString ret = mbs2ts((char*)buf.buf);
418 free_Buffer(&buf);
419 return ret;
420 }
421 return (CString)dflt;
422}
423
424
425
427// locale
428
430{
431 CString locale = LoadString_byID(IDS_STR_LOCALE);
432 _tsetlocale(LC_ALL, (LPCTSTR)locale);
433 return;
434}
435
436
437void jbxwl::setSystemLocale(LPCTSTR locale)
438{
439 _tsetlocale(LC_ALL, locale);
440 return;
441}
442
443
445{
446 CString locale = LoadString_byID(IDS_STR_LOCALE);
447 return locale;
448}
449
450
451
453// User
454
455// Lib
456#pragma comment(lib, "userenv.lib")
457#pragma comment(lib, "imagehlp.lib")
458
459
461{
462 HANDLE token;
463 DWORD size = (DWORD)LMESG;
464 TCHAR dirn[LMESG];
465 CString ret = _T("");
466
467 OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token);
468 BOOL rslt = GetUserProfileDirectory(token, dirn, &size);
469
470 if (rslt && size<=LMESG) ret = dirn;
471 return ret;
472}
473
474
476{
477 DWORD size = (DWORD)LMESG;
478 TCHAR dirn[LMESG];
479 CString ret = _T("");
480
481 BOOL rslt = GetDefaultUserProfileDirectory(dirn, &size);
482 if (rslt && size<=LMESG) ret = dirn;
483 return ret;
484}
485
486
487CString jbxwl::MakeWorkingFolderPath(LPCTSTR fnm, BOOL local, LPCTSTR dir, BOOL make)
488{
489 CString path = GetCurrentUserHomeFolder();
490
491 if (local) path += _T("\\AppData\\Local");
492 else path += _T("\\AppData\\Roaming");
493
494 if (dir!=NULL) path += dir;
495 else path += _T("\\");
496
497 if (make) {
498 char* mbstr = ts2mbs(path);
499 MakeSureDirectoryPathExists(mbstr);
500 ::free(mbstr);
501 }
502 if (fnm!=NULL) path += fnm;
503
504 return path;
505}
506
507
509{
510 char* path = GetProgramFolderA();
511
512 CString ret = mbs2ts(path);
513 ::free(path);
514
515 return ret;
516}
517
518
520{
521 TCHAR dirn[LMESG];
522
523 GetModuleFileName(NULL, dirn, (DWORD)LMESG); // エラーは敢えて無視
524 //
525 char* path = ts2mbs(dirn);
526 int len = (int)strlen(path);
527
528 for (int i=1; i<len; i++) {
529 if (path[len-i-1]=='\\') {
530 path[len-i] = '\0';
531 break;
532 }
533 }
534
535 return path;
536}
537
538
540{
541#ifdef _UNICODE
542 TCHAR dirn[LMESG];
543 GetCurrentDirectory(LMESG, dirn);
544
545#else
546 char dirn[LMESG];
547 GetCurrentDirectory(LMESG, dirn);
548
549#endif
550
551 CString folder = dirn;
552 return folder;
553}
554
555
556
558// メッセージ
559
560// 自ウィンドウにメッセージを送る
561void jbxwl::SendWinMessage(UINT mesg, WPARAM wparam, LPARAM lparam)
562{
563 CWinApp* app = AfxGetApp();
564 if (app!=NULL) {
565 CWnd* wnd = app->m_pMainWnd;
566 if (wnd!=NULL) wnd->SendMessage(mesg, wparam, lparam);
567 }
568}
569
570
571
573// Dialog
574
575// メッセージ Dialog
576int jbxwl::MessageDLG(LPCTSTR ttl, LPCTSTR msg, UINT type, HWND hWnd)
577{
578 int ret = ::MessageBox(hWnd, msg, ttl, type);
579 return ret;
580}
581
582
583
585// Clipboard
586
588{
589 if (data.IsEmpty()) return;
590
591 SaveToClipboard(CStringA(data).GetBuffer(), CStringA(data).GetLength());
592}
593
594
595void jbxwl::SaveToClipboard(void* ptr, size_t len)
596{
597 if (ptr == NULL) return;
598
599 HGLOBAL hMem = ::GlobalAlloc(GHND, len);
600 char* pszptr = (char*)::GlobalLock(hMem);
601
602 memcpy(pszptr, ptr, len);
603 //lstrcpy(pszptr, data);
604
605 ::GlobalUnlock(hMem);
606
607 if (!OpenClipboard(NULL)) {
608 ::GlobalFree(hMem);
609 return;
610 }
611 if (!EmptyClipboard()) {
612 ::GlobalFree(hMem);
613 return;
614 }
615 if (SetClipboardData(CF_TEXT, hMem) == NULL) {
616 ::GlobalFree(hMem);
617 }
618 CloseClipboard();
619
620 return;
621}
622
623
624
626// Key Event
627
629{
630 INPUT input;
631
632 input.type = INPUT_KEYBOARD;
633 input.ki.wVk = key;
634 input.ki.wScan = MapVirtualKeyW(key, 0);
635 input.ki.dwFlags = KEYEVENTF_EXTENDEDKEY;
636
637 if (action==SENDKEY_TapAction || action==SENDKEY_DownAction) {
638 SendInput(1, &input, sizeof(INPUT));
639 }
640 if (action==SENDKEY_TapAction || action==SENDKEY_UpAction) {
641 input.ki.dwFlags |= KEYEVENTF_KEYUP;
642 SendInput(1, &input, sizeof(INPUT));
643 }
644}
645
646
647//
648void jbxwl::SendKeyActionTap(WORD key1, WORD key2)
649{
653}
654
655
656//
657void jbxwl::SendKeyActionTap(WORD key1, WORD key2, WORD key3)
658{
664}
665
666
671BOOL jbxwl::DoSystemKeyAction(LPCTSTR com, BOOL child)
672{
673 if (com==NULL) return TRUE;
674
675 //
676 if (!tcscmp(com, _T("UP"))) {
677 SendKeyActionTap(VK_UP);
678 }
679 else if (!tcscmp(com, _T("DOWN"))) {
680 SendKeyActionTap(VK_DOWN);
681 }
682 else if (!tcscmp(com, _T("RIGHT"))) {
683 SendKeyActionTap(VK_RIGHT);
684 }
685 else if (!tcscmp(com, _T("LEFT"))) {
686 SendKeyActionTap(VK_LEFT);
687 }
688 else if (!tcscmp(com, _T("NEXT")) || !tcscmp(com, _T("TAB"))) {
689 SendKeyActionTap(VK_TAB);
690 }
691 else if (!tcscmp(com, _T("BACK"))) {
692 SendKeyActionTap(VK_LSHIFT, VK_TAB);
693 }
694 else if (!tcscmp(com, _T("ENTER"))) {
695 SendKeyActionTap(VK_RETURN);
696 }
697 else if (!tcscmp(com, _T("MENU")) || !tcscmp(com, _T("ALT"))) {
698 SendKeyActionTap(VK_LMENU);
699 }
700 else if (!tcscmp(com, _T("ESC"))) {
701 SendKeyActionTap(VK_ESCAPE);
702 }
703 //
704 else if (!tcscmp(com, _T("CHANGE"))) {
706 }
707 else if (!tcscmp(com, _T("CLOSE"))) {
708 if (child) SendKeyActionTapAlt(VK_F4);
709 else SendKeyActionTapCtrl(VK_F4);
710 }
711 //
712 else {
713 return FALSE;
714 }
715
716 return TRUE;
717}
718
719
720
722// Mouse Cursor
723
724static TCHAR* MouseCursolTable[] = {
725 IDC_APPSTARTING, // 標準の矢印カーソルと小さい砂時計カーソル
726 IDC_ARROW, // 標準の矢印カーソル
727 IDC_CROSS, // 十字カーソル
728 IDC_HAND, // Windows 2000:ハンドカーソル
729 IDC_HELP, // ヘルプカーソル(矢印と疑問符)
730 IDC_IBEAM, // アイビーム(縦線)カーソル
731 IDC_NO, // 禁止カーソル(円に左上から右下への斜線)
732 IDC_SIZEALL, // 4 方向の矢印カーソル
733 IDC_SIZENESW, // 右上と左下を指す両方向矢印カーソル
734 IDC_SIZENS, // 上下を指す両方向矢印カーソル
735 IDC_SIZENWSE, // 左上と右下を指す両方向矢印カーソル
736 IDC_SIZEWE, // 左右を指す両方向矢印カーソル
737 IDC_UPARROW, // 上を指す垂直の矢印カーソル
738 IDC_WAIT, // 砂時計カーソル
739 IDI_APPLICATION, // アプリケーションアイコン
740 IDI_ASTERISK, // 情報アイコン(吹き出しの中に i)
741 IDI_EXCLAMATION, // 感嘆符のアイコン
742 IDI_HAND, // ストップマークのアイコン(米国の歩行者用信号の赤と同じで、手を開いて制止しているデザインです)
743 IDI_QUESTION, // 疑問符のアイコン
744 IDI_WINLOGO, // Windows ロゴのアイコン
745 NULL
746};
747
748
750{
751 CURSORINFO ci;
752
753 ci.cbSize = sizeof(CURSORINFO);
754 GetCursorInfo(&ci);
755
756 if (ci.flags!=0) {
757 TCHAR** table = MouseCursolTable;
758 while (*table!=NULL) {
759 if (ci.hCursor==LoadCursor(NULL, (LPTSTR)*table)) return *table;
760 table++;
761 }
762 return NULL;
763 }
764
765 return NULL;
766}
767
768
769
771// Timer
772
779{
780 SYSTEMTIME tm;
781 GetLocalTime(&tm);
782
783 unsigned short nm = tm.wSecond*(unsigned short)1000 + tm.wMilliseconds;
784 return nm;
785}
786
787
799unsigned short jbxwl::GetMsecondsLapTimer(unsigned short pm, unsigned short* nt)
800{
801 SYSTEMTIME tm;
802 GetLocalTime(&tm);
803
804 unsigned short nm = tm.wSecond*(unsigned short)1000 + tm.wMilliseconds;
805 unsigned short ret;
806 if (pm>nm) ret = nm + ((unsigned short)60000 - pm);
807 else ret = nm - pm;
808
809 if (nt!=NULL) *nt = nm;
810 return ret;
811}
812
813
814
816// Process/Thread
817
818void jbxwl::WinSystem(char* command, DWORD flag, BOOL wait)
819{
820 STARTUPINFOA sinfo;
821 PROCESS_INFORMATION pinfo;
822
823 memset(&sinfo, 0, sizeof(STARTUPINFO));
824 sinfo.cb = sizeof(STARTUPINFO);
825 //sinfo.wShowWindow = SW_HIDE;
826
827 CreateProcessA(NULL, (LPSTR)command, NULL, NULL, FALSE, flag, NULL, NULL, (LPSTARTUPINFOA)&sinfo, &pinfo);
828
829 CloseHandle(pinfo.hThread);
830 if (wait) WaitForSingleObject(pinfo.hProcess, INFINITE);
831 CloseHandle(pinfo.hProcess);
832
833 return;
834}
835
836
837
839// EventHandler
840
842{
843 m_handle = NULL;
844 m_wait_err = 0;
845}
846
847
848EventHandler::EventHandler(BOOL manual, BOOL initial, LPCTSTR hname, LPSECURITY_ATTRIBUTES sec)
849{
850 m_handle = NULL;
851 m_wait_err = 0;
852 create(manual, initial, hname, sec);
853}
854
855
857{
858 if (m_handle!=NULL) {
859 CloseHandle(m_handle);
860 m_handle = NULL;
861 }
862 m_wait_err = 0;
863
864 return;
865}
866
867
868HANDLE EventHandler::create(BOOL manual, BOOL initial, LPCTSTR hname, LPSECURITY_ATTRIBUTES secu)
869{
870 if (m_handle!=NULL) return NULL;
871
872 m_handle = CreateEvent(secu, manual, initial, hname);
873 return m_handle;
874}
875
876
886BOOL EventHandler::wait(DWORD msec)
887{
888 m_wait_err = WAIT_FAILED;
889 if (m_handle==NULL) return FALSE;
890
891 m_wait_err = WaitForSingleObject(m_handle, msec);
892
893 if (m_wait_err!=WAIT_OBJECT_0) return FALSE;
894 return TRUE;
895}
896
897
898BOOL EventHandler::wait(HANDLE handle, DWORD msec)
899{
900 m_wait_err = WAIT_FAILED;
901 if (handle==NULL) return FALSE;
902
903 m_wait_err = WaitForSingleObject(handle, msec);
904
905 if (m_wait_err!=WAIT_OBJECT_0) return FALSE;
906 return TRUE;
907}
908
static TCHAR * MouseCursolTable[]
Definition WinTools.cpp:724
HANDLE create(BOOL manual=TRUE, BOOL initial=FALSE, LPCTSTR hname=NULL, LPSECURITY_ATTRIBUTES sec=NULL)
Definition WinTools.cpp:868
BOOL wait(DWORD msec=INFINITE)
Definition WinTools.cpp:886
CString make_file_path_t(LPCTSTR str)
Definition WinTools.cpp:295
CString GetDefaultUserHomeFolder(void)
Definition WinTools.cpp:475
SENDKEY_Action
Definition WinTools.h:135
@ SENDKEY_UpAction
Definition WinTools.h:138
@ SENDKEY_TapAction
Definition WinTools.h:136
@ SENDKEY_DownAction
Definition WinTools.h:137
Buffer utf8_to_sjis(void *ptr, size_t len)
Definition WinTools.cpp:196
tList * read_index_tList_file_t(LPCTSTR fn, char cc)
Definition WinTools.cpp:387
CString get_file_name_t(LPCTSTR str)
Definition WinTools.cpp:277
void SendKeyActionTap(WORD key)
Definition WinTools.h:144
char * GetProgramFolderA(void)
Definition WinTools.cpp:519
int cat_ts2Buffer(LPCTSTR str, Buffer *buf)
Definition WinTools.cpp:161
char * ts2mbs(LPCTSTR str)
Definition WinTools.h:57
void SendKeyActionTapAlt(WORD key)
Definition WinTools.h:149
int copy_ts2Buffer(LPCTSTR str, Buffer *buf)
Definition WinTools.cpp:136
Buffer sjis_to_utf8_byStr(CString str)
Definition WinTools.cpp:216
BOOL DoSystemKeyAction(LPCTSTR com, BOOL child=FALSE)
Definition WinTools.cpp:671
unsigned short GetMsecondsLapTimer(unsigned short pm, unsigned short *nt=NULL)
Definition WinTools.cpp:799
CString mbs2ts(char *str)
Definition WinTools.cpp:79
tList * get_dir_files_rcsv_t(LPCTSTR dirn)
Definition WinTools.cpp:370
void SendKeyAction(WORD key, SENDKEY_Action action)
Definition WinTools.cpp:628
void setSystemLocale(LPCTSTR locale=_T(""))
Definition WinTools.cpp:437
CString MakeWorkingFolderPath(LPCTSTR fnm, BOOL local, LPCTSTR dir=NULL, BOOL make=FALSE)
Definition WinTools.cpp:487
void WinSystem(char *command, DWORD flag, BOOL wait)
Definition WinTools.cpp:818
Buffer ts2Buffer(LPCTSTR str, int size=-1)
Definition WinTools.cpp:56
CString GetCurrentUserHomeFolder(void)
Definition WinTools.cpp:460
void SaveToClipboard_byStr(CString data)
Definition WinTools.cpp:587
Buffer utf8_to_sjis_byStr(CString str)
Definition WinTools.cpp:185
void setResourceLocale(void)
Definition WinTools.cpp:429
CString get_tstr_param_tList(tList *lt, char *key, LPCTSTR dflt)
Definition WinTools.cpp:413
int MessageDLG(LPCTSTR ttl, LPCTSTR msg, UINT type, HWND hWnd)
Definition WinTools.cpp:576
CString GetCurrentFolder(void)
Definition WinTools.cpp:539
void SendWinMessage(UINT mesg, WPARAM wparam=NULL, LPARAM lparam=NULL)
Definition WinTools.cpp:561
CString GetProgramFolder(void)
Definition WinTools.cpp:508
tList * get_dir_files_t(LPCTSTR dirn)
Definition WinTools.cpp:338
void SendKeyActionTapCtrl(WORD key)
Definition WinTools.h:151
CString getResourceLocale(void)
Definition WinTools.cpp:444
unsigned short GetMsecondsTimer(void)
Definition WinTools.cpp:778
void SaveToClipboard(void *ptr, size_t len)
Definition WinTools.cpp:595
Buffer tc2Buffer(TCHAR *tchar, int size=-1)
locale が正しくないと,日本語の変換は失敗する. ex.) setlocale(LC_CTYPE,"jpn") or setSystemLocale()
Definition WinTools.cpp:34
Buffer String2Buffer(CString str)
Definition WinTools.cpp:24
CString numbering_name_t(LPCTSTR fmt, int n)
Definition WinTools.cpp:403
BOOL file_exist_t(LPCTSTR fn)
Definition WinTools.cpp:258
CString LoadString_byID(UINT id)
Definition WinTools.h:174
TCHAR * GetMouseCursorType(void)
Definition WinTools.cpp:749
CString cut_file_extension_t(LPCTSTR str)
Definition WinTools.cpp:317
unsigned long int file_size_t(LPCTSTR fn)
Definition WinTools.cpp:250
Buffer sjis_to_utf8(void *ptr, size_t len)
Definition WinTools.cpp:227
#define IDS_STR_LOCALE
Definition resource.h:125